ninja: no work to do. --- (command.CommandList children: [ (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 11 span_id: 0 line: (SourceLine line_num: 1 content: "global_var=global\n" src: (source.MainFile path:ysh/testdata/no-dynamic-scope.osh) ) tval: "global_var=" ) pairs: [ (AssignPair left: ...0x1402 lhs: (sh_lhs.Name left:...0x1402 name:global_var) op: assign_op.Equal rhs: (CompoundWord parts: [(Token id:Id.Lit_Chars col:11 length:6 span_id:1 line:...0x140e tval:global)] ) ) ] redirects: [] ) (command.ShFunction name_tok: (Token id: Id.Lit_Chars col: 0 length: 1 span_id: 4 line: (SourceLine line_num:3 content:"g() {\n" src:...0x1d89) tval: g ) name: g body: (BraceGroup left: (Token id:Id.Lit_LBrace col:4 length:1 span_id:8 line:...0x13aa tval:"{") children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 5 span_id: 11 line: (SourceLine line_num:4 content:" local g_var=f\n" src:...0x1d89) tval: local ) more_env: [] words: [ (CompoundWord parts:[...0x135e]) (CompoundWord parts: [ (Token id: Id.Lit_VarLike col: 8 length: 6 span_id: 13 line: ...0x1366 tval: "g_var=" ) (Token id: Id.Lit_Chars col: 14 length: 1 span_id: 14 line: ...0x1366 tval: f ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 17 line: (SourceLine line_num:5 content:" echo $g_var\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x1316]) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 7 length: 6 span_id: 19 line: ...0x131e tval: "$g_var" ) var_name: g_var ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 22 line: (SourceLine line_num:6 content:" echo $f_var\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x12d2]) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 7 length: 6 span_id: 24 line: ...0x12da tval: "$f_var" ) var_name: f_var ) ] ) ] redirects: [] do_fork: T ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 2 length: 3 span_id: 28 line: (SourceLine line_num:8 content:" var oil_var = global_var\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:6 length:7 span_id:30 line:...0x1292 tval:oil_var) name: oil_var ) ] rhs: (expr.Var left: (Token id: Id.Expr_Name col: 16 length: 10 span_id: 34 line: ...0x1292 tval: global_var ) name: global_var ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 37 line: (SourceLine line_num:9 content:" echo $oil_var\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x11da]) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 7 length: 8 span_id: 39 line: ...0x11e2 tval: "$oil_var" ) var_name: oil_var ) ] ) ] redirects: [] do_fork: T ) ] redirects: [] right: (Token id: Id.Lit_RBrace col: 0 length: 1 span_id: 41 line: (SourceLine line_num:10 content:"}\n" src:...0x1d89) tval: "}" ) ) ) (command.ShFunction name_tok: (Token id: Id.Lit_Chars col: 0 length: 1 span_id: 44 line: (SourceLine line_num:12 content:"f() {\n" src:...0x1d89) tval: f ) name: f body: (BraceGroup left: (Token id:Id.Lit_LBrace col:4 length:1 span_id:48 line:...0x117e tval:"{") children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 5 span_id: 51 line: (SourceLine line_num:13 content:" local f_var=f\n" src:...0x1d89) tval: local ) more_env: [] words: [ (CompoundWord parts:[...0x113e]) (CompoundWord parts: [ (Token id: Id.Lit_VarLike col: 8 length: 6 span_id: 53 line: ...0x1146 tval: "f_var=" ) (Token id: Id.Lit_Chars col: 14 length: 1 span_id: 54 line: ...0x1146 tval: f ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 57 line: (SourceLine line_num:14 content:" echo $f_var\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x10f6]) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 7 length: 6 span_id: 59 line: ...0x10fe tval: "$f_var" ) var_name: f_var ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 1 span_id: 62 line: (SourceLine line_num:15 content:" g\n" src:...0x1d89) tval: g ) more_env: [] words: [(CompoundWord parts:[...0x10b6])] redirects: [] do_fork: T ) ] redirects: [] right: (Token id: Id.Lit_RBrace col: 0 length: 1 span_id: 64 line: (SourceLine line_num:16 content:"}\n" src:...0x1d89) tval: "}" ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 1 span_id: 67 line: (SourceLine line_num:18 content:"f\n" src:...0x1d89) tval: f ) more_env: [] words: [(CompoundWord parts:[...0x1066])] redirects: [] do_fork: T ) ] ) --- (command.CommandList children: [ (command.ShFunction name_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 50 line: (SourceLine line_num: 19 content: "argv() {\n" src: (source.MainFile path:ysh/testdata/sigil-pairs.sh) ) tval: argv ) name: argv body: (BraceGroup left: (Token id:Id.Lit_LBrace col:7 length:1 span_id:54 line:...0x12ca tval:"{") children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 6 span_id: 57 line: (SourceLine line_num: 20 content: " python -c 'import sys;print(sys.argv[1:])' @ARGV\n" src: ...0x1d89 ) tval: python ) more_env: [] words: [ (CompoundWord parts:[...0x1282]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:2 span_id:59 line:...0x128a tval:-c)] ) (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 12 length: 1 span_id: 61 line: ...0x128a tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 13 length: 30 span_id: 62 line: ...0x128a tval: "import sys;print(sys.argv[1:])" ) ] right: (Token id: Id.Right_SingleQuote col: 43 length: 1 span_id: 63 line: ...0x128a tval: "'" ) ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_Splice col: 45 length: 5 span_id: 65 line: ...0x128a tval: "@ARGV" ) ] ) ] redirects: [] do_fork: T ) ] redirects: [] right: (Token id: Id.Lit_RBrace col: 0 length: 1 span_id: 67 line: (SourceLine line_num:21 content:"}\n" src:...0x1d89) tval: "}" ) ) ) (command.ShFunction name_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 70 line: (SourceLine line_num:23 content:"show() {\n" src:...0x1d89) tval: show ) name: show body: (BraceGroup left: (Token id:Id.Lit_LBrace col:7 length:1 span_id:74 line:...0x11ee tval:"{") children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 77 line: (SourceLine line_num:24 content:" echo '====='\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x11ae]) (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 7 length: 1 span_id: 79 line: ...0x11b6 tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 8 length: 5 span_id: 80 line: ...0x11b6 tval: "=====" ) ] right: (Token id: Id.Right_SingleQuote col: 13 length: 1 span_id: 81 line: ...0x11b6 tval: "'" ) ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 84 line: (SourceLine line_num:25 content:" argv @ARGV\n" src:...0x1d89) tval: argv ) more_env: [] words: [ (CompoundWord parts:[...0x115a]) (CompoundWord parts: [ (Token id: Id.Lit_Splice col: 7 length: 5 span_id: 86 line: ...0x1162 tval: "@ARGV" ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 89 line: (SourceLine line_num:26 content:" echo\n" src:...0x1d89) tval: echo ) more_env: [] words: [(CompoundWord parts:[...0x111a])] redirects: [] do_fork: T ) ] redirects: [] right: (Token id: Id.Lit_RBrace col: 0 length: 1 span_id: 91 line: (SourceLine line_num:27 content:"}\n" src:...0x1d89) tval: "}" ) ) ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 95 line: (SourceLine line_num:30 content:"var strarray = %(\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:8 span_id:97 line:...0x10c2 tval:strarray) name: strarray ) ] rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen col:15 length:2 span_id:101 line:...0x10c2 tval:"%(") words: [ (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 4 length: 4 span_id: 104 line: (SourceLine line_num: 31 content: " bare words *.sh {a,b}@example.com 'sq' \"dq ${x:-default}\"\n" src: ...0x1d89 ) tval: bare ) ] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:5 span_id:106 line:...0x102e tval:words)] ) (CompoundWord parts: [ (Token id: Id.Lit_Star col: 15 length: 1 span_id: 108 line: ...0x102e tval: "*" ) (Token id: Id.Lit_Chars col: 16 length: 3 span_id: 109 line: ...0x102e tval: .sh ) ] ) (word.BracedTree parts: [ (word_part.BracedTuple words: [ (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 21 length: 1 span_id: 112 line: ...0x102e tval: a ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 23 length: 1 span_id: 114 line: ...0x102e tval: b ) ] ) ] ) (Token id: Id.Lit_Splice col: 25 length: 8 span_id: 116 line: ...0x102e tval: "@example" ) (Token id: Id.Lit_Chars col: 33 length: 4 span_id: 117 line: ...0x102e tval: .com ) ] ) (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 38 length: 1 span_id: 119 line: ...0x102e tval: "'" ) tokens: [(Token id:Id.Lit_Chars col:39 length:2 span_id:120 line:...0x102e tval:sq)] right: (Token id: Id.Right_SingleQuote col: 41 length: 1 span_id: 121 line: ...0x102e tval: "'" ) ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 43 length: 1 span_id: 123 line: ...0x102e tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 44 length: 3 span_id: 124 line: ...0x102e tval: "dq " ) (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 47 length: 2 span_id: 125 line: ...0x102e tval: "${" ) token: (Token id: Id.VSub_Name col: 49 length: 1 span_id: 126 line: ...0x102e tval: x ) var_name: x suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 50 length: 2 span_id: 127 line: ...0x102e ) arg_word: (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 52 length: 7 span_id: 128 line: ...0x102e tval: default ) ] ) ) right: (Token id: Id.Right_DollarBrace col: 59 length: 1 span_id: 129 line: ...0x102e tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 60 length: 1 span_id: 130 line: ...0x102e tval: "\"" ) ) ] ) ] right: (Token id: Id.Right_ShArrayLiteral col: 0 length: 1 span_id: 132 line: (SourceLine line_num:32 content:")\n" src:...0x1d89) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 135 line: (SourceLine line_num:34 content:"show @strarray\n" src:...0x1d89) tval: show ) more_env: [] words: [ (CompoundWord parts:[...0x19ce]) (CompoundWord parts: [(Token id:Id.Lit_Splice col:5 length:9 span_id:137 line:...0x19d2 tval:"@strarray")] ) ] redirects: [] do_fork: T ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 140 line: (SourceLine line_num:36 content:"var cmd_sub = $(\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:7 span_id:142 line:...0x1982 tval:cmd_sub) name: cmd_sub ) ] rhs: (CommandSub left_token: (Token id: Id.Left_DollarParen col: 14 length: 2 span_id: 146 line: ...0x1982 tval: "$(" ) child: (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 4 length: 4 span_id: 149 line: (SourceLine line_num: 37 content: " echo bare words *.sh {a,b}@example.com 'sq' \"dq ${x:-default}\"\n" src: ...0x1d89 ) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x18ea]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:4 span_id:151 line:...0x18f2 tval:bare)] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 14 length: 5 span_id: 153 line: ...0x18f2 tval: words ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_Star col: 20 length: 1 span_id: 155 line: ...0x18f2 tval: "*" ) (Token id: Id.Lit_Chars col: 21 length: 3 span_id: 156 line: ...0x18f2 tval: .sh ) ] ) (word.BracedTree parts: [ (word_part.BracedTuple words: [ (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 26 length: 1 span_id: 159 line: ...0x18f2 tval: a ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 28 length: 1 span_id: 161 line: ...0x18f2 tval: b ) ] ) ] ) (Token id: Id.Lit_Splice col: 30 length: 8 span_id: 163 line: ...0x18f2 tval: "@example" ) (Token id: Id.Lit_Chars col: 38 length: 4 span_id: 164 line: ...0x18f2 tval: .com ) ] ) (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 43 length: 1 span_id: 166 line: ...0x18f2 tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 44 length: 2 span_id: 167 line: ...0x18f2 tval: sq ) ] right: (Token id: Id.Right_SingleQuote col: 46 length: 1 span_id: 168 line: ...0x18f2 tval: "'" ) ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 48 length: 1 span_id: 170 line: ...0x18f2 tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 49 length: 3 span_id: 171 line: ...0x18f2 tval: "dq " ) (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 52 length: 2 span_id: 172 line: ...0x18f2 tval: "${" ) token: (Token id: Id.VSub_Name col: 54 length: 1 span_id: 173 line: ...0x18f2 tval: x ) var_name: x suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 55 length: 2 span_id: 174 line: ...0x18f2 ) arg_word: (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 57 length: 7 span_id: 175 line: ...0x18f2 tval: default ) ] ) ) right: (Token id: Id.Right_DollarBrace col: 64 length: 1 span_id: 176 line: ...0x18f2 tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 65 length: 1 span_id: 177 line: ...0x18f2 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) right: (Token id: Id.Eof_RParen col: 0 length: 1 span_id: 179 line: (SourceLine line_num:38 content:")\n" src:...0x1d89) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 182 line: (SourceLine line_num:40 content:"show $cmd_sub\n" src:...0x1d89) tval: show ) more_env: [] words: [ (CompoundWord parts:[...0x17ca]) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 5 length: 8 span_id: 184 line: ...0x17ce tval: "$cmd_sub" ) var_name: cmd_sub ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 187 line: (SourceLine line_num: 42 content: "show $['quoted ' ++ 'words ' ++ \"dq ${x:-default}\"]\n" src: ...0x1d89 ) tval: show ) more_env: [] words: [ (CompoundWord parts:[...0x177e]) (CompoundWord parts: [ (word_part.ExprSub left: (Token id: Id.Left_DollarBracket col: 5 length: 2 span_id: 189 line: ...0x1782 tval: "$[" ) child: (expr.Binary op: (Token id:Id.Arith_DPlus col:29 length:2 span_id:200 line:...0x1782) left: (expr.Binary op: (Token id:Id.Arith_DPlus col:17 length:2 span_id:194 line:...0x1782) left: (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 7 length: 1 span_id: 190 line: ...0x1782 tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 8 length: 7 span_id: 191 line: ...0x1782 tval: "quoted " ) ] right: (Token id: Id.Right_SingleQuote col: 15 length: 1 span_id: 192 line: ...0x1782 tval: "'" ) ) right: (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 20 length: 1 span_id: 196 line: ...0x1782 tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 21 length: 6 span_id: 197 line: ...0x1782 tval: "words " ) ] right: (Token id: Id.Right_SingleQuote col: 27 length: 1 span_id: 198 line: ...0x1782 tval: "'" ) ) ) right: (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 32 length: 1 span_id: 202 line: ...0x1782 tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 33 length: 3 span_id: 203 line: ...0x1782 tval: "dq " ) (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 36 length: 2 span_id: 204 line: ...0x1782 tval: "${" ) token: (Token id: Id.VSub_Name col: 38 length: 1 span_id: 205 line: ...0x1782 tval: x ) var_name: x suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 39 length: 2 span_id: 206 line: ...0x1782 ) arg_word: (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 41 length: 7 span_id: 207 line: ...0x1782 tval: default ) ] ) ) right: (Token id: Id.Right_DollarBrace col: 48 length: 1 span_id: 208 line: ...0x1782 tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 49 length: 1 span_id: 209 line: ...0x1782 tval: "\"" ) ) ) right: (Token id:Id.Op_RBracket col:50 length:1 span_id:210 line:...0x1782) ) ] ) ] redirects: [] do_fork: T ) ] ) --- skipping ysh/testdata/assign.osh --- (command.CommandList children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 5 span_id: 1 line: (SourceLine line_num: 2 content: "shopt -s oil-parse-at static-word-eval\n" src: (source.MainFile path:ysh/testdata/array-splice-demo.osh) ) tval: shopt ) more_env: [] words: [ (CompoundWord parts:[...0x13fe]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:6 length:2 span_id:3 line:...0x1402 tval:-s)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:12 span_id:5 line:...0x1402 tval:oil-parse-at)] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 22 length: 16 span_id: 7 line: ...0x1402 tval: static-word-eval ) ] ) ] redirects: [] do_fork: T ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 9 span_id: 10 line: (SourceLine line_num:4 content:"myglobal=global\n" src:...0x1d89) tval: "myglobal=" ) pairs: [ (AssignPair left: ...0x138a lhs: (sh_lhs.Name left:...0x138a name:myglobal) op: assign_op.Equal rhs: (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:6 span_id:11 line:...0x1392 tval:global)] ) ) ] redirects: [] ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 14 line: (SourceLine line_num: 6 content: "var myarray = :| $myglobal $'line\\n' ${z:-default} |\n" src: ...0x1d89 ) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:7 span_id:16 line:...0x133a tval:myarray) name: myarray ) ] rhs: (ShArrayLiteral left: (Token id:Id.Left_ColonPipe col:14 length:2 span_id:20 line:...0x133a tval:":|") words: [ (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 17 length: 9 span_id: 22 line: ...0x133a tval: "$myglobal" ) var_name: myglobal ) ] ) (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_DollarSingleQuote col: 27 length: 2 span_id: 24 line: ...0x133a tval: "$'" ) tokens: [ (Token id: Id.Char_Literals col: 29 length: 4 span_id: 25 line: ...0x133a tval: line ) (Token id: Id.Char_OneChar col: 33 length: 2 span_id: 26 line: ...0x133a tval: "\\n" ) ] right: (Token id: Id.Right_SingleQuote col: 35 length: 1 span_id: 27 line: ...0x133a tval: "'" ) ) ] ) (CompoundWord parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 37 length: 2 span_id: 29 line: ...0x133a tval: "${" ) token: (Token id:Id.VSub_Name col:39 length:1 span_id:30 line:...0x133a tval:z) var_name: z suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen col:40 length:2 span_id:31 line:...0x133a) arg_word: (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 42 length: 7 span_id: 32 line: ...0x133a tval: default ) ] ) ) right: (Token id: Id.Right_DollarBrace col: 49 length: 1 span_id: 33 line: ...0x133a tval: "}" ) ) ] ) ] right: (Token id:Id.Op_Pipe col:51 length:1 span_id:35 line:...0x133a) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 37 line: (SourceLine line_num:7 content:"spec/bin/argv.py @myarray\n" src:...0x1d89) tval: spec ) more_env: [] words: [ (CompoundWord parts: [ ...0x121e (Token id:Id.Lit_Slash col:4 length:1 span_id:38 line:...0x1222 tval:/) (Token id:Id.Lit_Chars col:5 length:3 span_id:39 line:...0x1222 tval:bin) (Token id:Id.Lit_Slash col:8 length:1 span_id:40 line:...0x1222 tval:/) (Token id:Id.Lit_Chars col:9 length:7 span_id:41 line:...0x1222 tval:argv.py) ] ) (CompoundWord parts: [(Token id:Id.Lit_Splice col:17 length:8 span_id:43 line:...0x1222 tval:"@myarray")] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 45 line: (SourceLine line_num:8 content:"echo len=$[len(myarray)]\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x11ba]) (CompoundWord parts: [ (Token id: Id.Lit_VarLike col: 5 length: 4 span_id: 47 line: ...0x11be tval: "len=" ) (word_part.ExprSub left: (Token id: Id.Left_DollarBracket col: 9 length: 2 span_id: 48 line: ...0x11be tval: "$[" ) child: (expr.FuncCall func: (expr.Var left: (Token id: Id.Expr_Name col: 11 length: 3 span_id: 49 line: ...0x11be tval: len ) name: len ) args: (ArgList left: (Token id:Id.Op_LParen col:14 length:1 span_id:50 line:...0x11be) pos_args: [ (expr.Var left: (Token id: Id.Expr_Name col: 15 length: 7 span_id: 51 line: ...0x11be tval: myarray ) name: myarray ) ] named_args: [] right: (Token id:Id.Op_RParen col:22 length:1 span_id:52 line:...0x11be) ) ) right: (Token id:Id.Op_RBracket col:23 length:1 span_id:53 line:...0x11be) ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 55 line: (SourceLine line_num:9 content:"echo\n" src:...0x1d89) tval: echo ) more_env: [] words: [(CompoundWord parts:[...0x10b6])] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 6 span_id: 58 line: (SourceLine line_num: 11 content: "append _ '1 2' ${myglobal:-default} (myarray)\n" src: ...0x1d89 ) tval: append ) more_env: [] words: [ (CompoundWord parts:[...0x107a]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:7 length:1 span_id:60 line:...0x107e tval:_)] ) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote col:9 length:1 span_id:62 line:...0x107e tval:"'") tokens: [(Token id:Id.Lit_Chars col:10 length:3 span_id:63 line:...0x107e tval:"1 2")] right: (Token id: Id.Right_SingleQuote col: 13 length: 1 span_id: 64 line: ...0x107e tval: "'" ) ) ] ) (CompoundWord parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 15 length: 2 span_id: 66 line: ...0x107e tval: "${" ) token: (Token id:Id.VSub_Name col:17 length:8 span_id:67 line:...0x107e tval:myglobal) var_name: myglobal suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen col:25 length:2 span_id:68 line:...0x107e) arg_word: (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 27 length: 7 span_id: 69 line: ...0x107e tval: default ) ] ) ) right: (Token id: Id.Right_DollarBrace col: 34 length: 1 span_id: 70 line: ...0x107e tval: "}" ) ) ] ) ] redirects: [] typed_args: (ArgList left: (Token id:Id.Op_LParen col:36 length:1 span_id:72 line:...0x107e) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name col:37 length:7 span_id:73 line:...0x107e tval:myarray) name: myarray ) ] named_args: [] right: (Token id:Id.Op_RParen col:44 length:1 span_id:74 line:...0x107e) ) do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 76 line: (SourceLine line_num:12 content:"spec/bin/argv.py @myarray\n" src:...0x1d89) tval: spec ) more_env: [] words: [ (CompoundWord parts: [ ...0x1a2a (Token id:Id.Lit_Slash col:4 length:1 span_id:77 line:...0x1a2e tval:/) (Token id:Id.Lit_Chars col:5 length:3 span_id:78 line:...0x1a2e tval:bin) (Token id:Id.Lit_Slash col:8 length:1 span_id:79 line:...0x1a2e tval:/) (Token id:Id.Lit_Chars col:9 length:7 span_id:80 line:...0x1a2e tval:argv.py) ] ) (CompoundWord parts: [(Token id:Id.Lit_Splice col:17 length:8 span_id:82 line:...0x1a2e tval:"@myarray")] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 84 line: (SourceLine line_num:13 content:"echo len=$[len(myarray)]\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x19c6]) (CompoundWord parts: [ (Token id: Id.Lit_VarLike col: 5 length: 4 span_id: 86 line: ...0x19ca tval: "len=" ) (word_part.ExprSub left: (Token id: Id.Left_DollarBracket col: 9 length: 2 span_id: 87 line: ...0x19ca tval: "$[" ) child: (expr.FuncCall func: (expr.Var left: (Token id: Id.Expr_Name col: 11 length: 3 span_id: 88 line: ...0x19ca tval: len ) name: len ) args: (ArgList left: (Token id:Id.Op_LParen col:14 length:1 span_id:89 line:...0x19ca) pos_args: [ (expr.Var left: (Token id: Id.Expr_Name col: 15 length: 7 span_id: 90 line: ...0x19ca tval: myarray ) name: myarray ) ] named_args: [] right: (Token id:Id.Op_RParen col:22 length:1 span_id:91 line:...0x19ca) ) ) right: (Token id:Id.Op_RBracket col:23 length:1 span_id:92 line:...0x19ca) ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 94 line: (SourceLine line_num:14 content:"echo\n" src:...0x1d89) tval: echo ) more_env: [] words: [(CompoundWord parts:[...0x18c6])] redirects: [] do_fork: T ) (command.ForEach keyword: (Token id: Id.KW_For col: 0 length: 3 span_id: 97 line: (SourceLine line_num:16 content:"for item in (myarray) {\n" src:...0x1d89) tval: for ) iter_names: [item] iterable: (for_iter.YshExpr e: (expr.Var left: (Token id:Id.Expr_Name col:13 length:7 span_id:104 line:...0x188a tval:myarray) name: myarray ) blame: (Token id:Id.KW_In col:9 length:2 span_id:101 line:...0x188a tval:in) ) body: (BraceGroup left: (Token id:Id.Lit_LBrace col:22 length:1 span_id:107 line:...0x188a tval:"{") children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 110 line: (SourceLine line_num:17 content:" echo \" $item\"\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x17de]) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 7 length: 1 span_id: 112 line: ...0x17e6 tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 8 length: 2 span_id: 113 line: ...0x17e6 tval: " " ) (NameTok left: (Token id: Id.VSub_DollarName col: 10 length: 5 span_id: 114 line: ...0x17e6 tval: "$item" ) var_name: item ) ] right: (Token id: Id.Right_DoubleQuote col: 15 length: 1 span_id: 115 line: ...0x17e6 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) ] redirects: [] right: (Token id: Id.Lit_RBrace col: 0 length: 1 span_id: 117 line: (SourceLine line_num:18 content:"}\n" src:...0x1d89) tval: "}" ) ) redirects: [] ) ] ) --- (command.CommandList children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 1 line: (SourceLine line_num: 2 content: "echo 'This is a shell script with OSH extensions!'\n" src: (source.MainFile path:ysh/testdata/hello.osh) ) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x13fa]) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote col:5 length:1 span_id:3 line:...0x13fe tval:"'") tokens: [ (Token id: Id.Lit_Chars col: 6 length: 43 span_id: 4 line: ...0x13fe tval: "This is a shell script with OSH extensions!" ) ] right: (Token id: Id.Right_SingleQuote col: 49 length: 1 span_id: 5 line: ...0x13fe tval: "'" ) ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 7 line: (SourceLine line_num:3 content:"echo\n" src:...0x1d89) tval: echo ) more_env: [] words: [(CompoundWord parts:[...0x13a6])] redirects: [] do_fork: T ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 10 line: (SourceLine line_num:5 content:"var x = 1 + 2*3\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:1 span_id:12 line:...0x136a tval:x) name: x ) ] rhs: (expr.Binary op: (Token id:Id.Arith_Plus col:10 length:1 span_id:18 line:...0x136a) left: (expr.Const c: (Token id:Id.Expr_DecInt col:8 length:1 span_id:16 line:...0x136a tval:1) val: (value.Int i:1) ) right: (expr.Binary op: (Token id:Id.Arith_Star col:13 length:1 span_id:21 line:...0x136a) left: (expr.Const c: (Token id:Id.Expr_DecInt col:12 length:1 span_id:20 line:...0x136a tval:2) val: (value.Int i:2) ) right: (expr.Const c: (Token id:Id.Expr_DecInt col:14 length:1 span_id:22 line:...0x136a tval:3) val: (value.Int i:3) ) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 25 line: (SourceLine line_num:7 content:"echo \"x: $x\"\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x1282]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote col:5 length:1 span_id:27 line:...0x1286 tval:"\"") parts: [ (Token id: Id.Lit_Chars col: 6 length: 3 span_id: 28 line: ...0x1286 tval: "x: " ) (NameTok left: (Token id: Id.VSub_DollarName col: 9 length: 2 span_id: 29 line: ...0x1286 tval: "$x" ) var_name: x ) ] right: (Token id: Id.Right_DoubleQuote col: 11 length: 1 span_id: 30 line: ...0x1286 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) (command.Mutation keyword: (Token id: Id.KW_SetVar col: 0 length: 6 span_id: 36 line: (SourceLine line_num:10 content:"setvar x += 1 \n" src:...0x1d89) tval: setvar ) lhs: [ (NameTok left: (Token id:Id.Expr_Name col:7 length:1 span_id:38 line:...0x1216 tval:x) var_name: x ) ] op: (Token id:Id.Arith_PlusEqual col:9 length:2 span_id:40 line:...0x1216) rhs: (expr.Const c: (Token id:Id.Expr_DecInt col:12 length:1 span_id:42 line:...0x1216 tval:1) val: (value.Int i:1) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 46 line: (SourceLine line_num:12 content:"echo \"x: $x\"\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x1146]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote col:5 length:1 span_id:48 line:...0x114a tval:"\"") parts: [ (Token id: Id.Lit_Chars col: 6 length: 3 span_id: 49 line: ...0x114a tval: "x: " ) (NameTok left: (Token id: Id.VSub_DollarName col: 9 length: 2 span_id: 50 line: ...0x114a tval: "$x" ) var_name: x ) ] right: (Token id: Id.Right_DoubleQuote col: 11 length: 1 span_id: 51 line: ...0x114a tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 54 line: (SourceLine line_num:14 content:"var mylist = [1, 2, 3]\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:6 span_id:56 line:...0x10ea tval:mylist) name: mylist ) ] rhs: (expr.List left: (Token id:Id.Op_LBracket col:13 length:1 span_id:60 line:...0x10ea) elts: [ (expr.Const c: (Token id:Id.Expr_DecInt col:14 length:1 span_id:61 line:...0x10ea tval:1) val: (value.Int i:1) ) (expr.Const c: (Token id:Id.Expr_DecInt col:17 length:1 span_id:64 line:...0x10ea tval:2) val: (value.Int i:2) ) (expr.Const c: (Token id:Id.Expr_DecInt col:20 length:1 span_id:67 line:...0x10ea tval:3) val: (value.Int i:3) ) ] ctx: expr_context.Store ) ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 71 line: (SourceLine line_num:16 content:"var y = mylist[1] * 10\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:1 span_id:73 line:...0x1a0a tval:y) name: y ) ] rhs: (expr.Binary op: (Token id:Id.Arith_Star col:18 length:1 span_id:82 line:...0x1a0a) left: (Subscript left: (Token id:Id.Op_LBracket col:14 length:1 span_id:78 line:...0x1a0a) obj: (expr.Var left: (Token id:Id.Expr_Name col:8 length:6 span_id:77 line:...0x1a0a tval:mylist) name: mylist ) index: (expr.Const c: (Token id:Id.Expr_DecInt col:15 length:1 span_id:79 line:...0x1a0a tval:1) val: (value.Int i:1) ) ) right: (expr.Const c: (Token id:Id.Expr_DecInt col:20 length:2 span_id:84 line:...0x1a0a tval:10) val: (value.Int i:10) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 87 line: (SourceLine line_num:18 content:"echo \"y: $y\"\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x18fe]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote col:5 length:1 span_id:89 line:...0x1902 tval:"\"") parts: [ (Token id: Id.Lit_Chars col: 6 length: 3 span_id: 90 line: ...0x1902 tval: "y: " ) (NameTok left: (Token id: Id.VSub_DollarName col: 9 length: 2 span_id: 91 line: ...0x1902 tval: "$y" ) var_name: y ) ] right: (Token id: Id.Right_DoubleQuote col: 11 length: 1 span_id: 92 line: ...0x1902 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 95 line: (SourceLine line_num:20 content:"var list2 = mylist ++ [4, 5]\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:5 span_id:97 line:...0x18a2 tval:list2) name: list2 ) ] rhs: (expr.Binary op: (Token id:Id.Arith_DPlus col:19 length:2 span_id:103 line:...0x18a2) left: (expr.Var left: (Token id:Id.Expr_Name col:12 length:6 span_id:101 line:...0x18a2 tval:mylist) name: mylist ) right: (expr.List left: (Token id:Id.Op_LBracket col:22 length:1 span_id:105 line:...0x18a2) elts: [ (expr.Const c: (Token id:Id.Expr_DecInt col:23 length:1 span_id:106 line:...0x18a2 tval:4) val: (value.Int i:4) ) (expr.Const c: (Token id:Id.Expr_DecInt col:26 length:1 span_id:109 line:...0x18a2 tval:5) val: (value.Int i:5) ) ] ctx: expr_context.Store ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 2 span_id: 123 line: (SourceLine line_num:26 content:"pp cell list2\n" src:...0x1d89) tval: pp ) more_env: [] words: [ (CompoundWord parts:[...0x16fe]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:3 length:4 span_id:125 line:...0x1702 tval:cell)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:8 length:5 span_id:127 line:...0x1702 tval:list2)] ) ] redirects: [] do_fork: T ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 5 span_id: 130 line: (SourceLine line_num: 28 content: "str1='shell string' # traditinoal shell-style assignment\n" src: ...0x1d89 ) tval: "str1=" ) pairs: [ (AssignPair left: ...0x16aa lhs: (sh_lhs.Name left:...0x16aa name:str1) op: assign_op.Equal rhs: (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 5 length: 1 span_id: 131 line: ...0x16ae tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 6 length: 12 span_id: 132 line: ...0x16ae tval: "shell string" ) ] right: (Token id: Id.Right_SingleQuote col: 18 length: 1 span_id: 133 line: ...0x16ae tval: "'" ) ) ] ) ) ] redirects: [] ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 142 line: (SourceLine line_num:31 content:"var str2 = \"Oil string\"\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:4 span_id:144 line:...0x1626 tval:str2) name: str2 ) ] rhs: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote col:11 length:1 span_id:148 line:...0x1626 tval:"\"") parts: [ (Token id: Id.Lit_Chars col: 12 length: 10 span_id: 149 line: ...0x1626 tval: "Oil string" ) ] right: (Token id:Id.Right_DoubleQuote col:22 length:1 span_id:150 line:...0x1626 tval:"\"") ) ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 153 line: (SourceLine line_num:33 content:"var str3 = str1 ++ str2\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:4 span_id:155 line:...0x155e tval:str3) name: str3 ) ] rhs: (expr.Binary op: (Token id:Id.Arith_DPlus col:16 length:2 span_id:161 line:...0x155e) left: (expr.Var left: (Token id:Id.Expr_Name col:11 length:4 span_id:159 line:...0x155e tval:str1) name: str1 ) right: (expr.Var left: (Token id:Id.Expr_Name col:19 length:4 span_id:163 line:...0x155e tval:str2) name: str2 ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 166 line: (SourceLine line_num:35 content:"echo \"str3 = $str3\"\n" src:...0x1d89) tval: echo ) more_env: [] words: [ (CompoundWord parts:[...0x1f36]) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 5 length: 1 span_id: 168 line: ...0x1f3a tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 6 length: 7 span_id: 169 line: ...0x1f3a tval: "str3 = " ) (NameTok left: (Token id: Id.VSub_DollarName col: 13 length: 5 span_id: 170 line: ...0x1f3a tval: "$str3" ) var_name: str3 ) ] right: (Token id: Id.Right_DoubleQuote col: 18 length: 1 span_id: 171 line: ...0x1f3a tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) ] ) --- (command.CommandList children: [ (command.ShFunction name_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 19 line: (SourceLine line_num: 8 content: "argv() { spec/bin/argv.py \"$@\"; }\n" src: (source.MainFile path:ysh/testdata/array-rewrite-1.sh) ) tval: argv ) name: argv body: (BraceGroup left: (Token id:Id.Lit_LBrace col:7 length:1 span_id:23 line:...0x1392 tval:"{") children: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 9 length: 4 span_id: 25 line: ...0x1392 tval: spec ) more_env: [] words: [ (CompoundWord parts: [ ...0x1352 (Token id: Id.Lit_Slash col: 13 length: 1 span_id: 26 line: ...0x1392 tval: / ) (Token id: Id.Lit_Chars col: 14 length: 3 span_id: 27 line: ...0x1392 tval: bin ) (Token id: Id.Lit_Slash col: 17 length: 1 span_id: 28 line: ...0x1392 tval: / ) (Token id: Id.Lit_Chars col: 18 length: 7 span_id: 29 line: ...0x1392 tval: argv.py ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 26 length: 1 span_id: 31 line: ...0x1392 tval: "\"" ) parts: [ (NameTok left: (Token id: Id.VSub_At col: 27 length: 2 span_id: 32 line: ...0x1392 tval: "$@" ) var_name: "@" ) ] right: (Token id: Id.Right_DoubleQuote col: 29 length: 1 span_id: 33 line: ...0x1392 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:30 length:1 span_id:34 line:...0x1392) ) ] redirects: [] right: (Token id:Id.Lit_RBrace col:32 length:1 span_id:36 line:...0x1392 tval:"}") ) ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 6 span_id: 49 line: (SourceLine line_num:14 content:"regex=(old1 old2)\n" src:...0x1d89) tval: "regex=" ) pairs: [ (AssignPair left: ...0x127e lhs: (sh_lhs.Name left:...0x127e name:regex) op: assign_op.Equal rhs: (CompoundWord parts: [ (ShArrayLiteral left: (Token id:Id.Op_LParen col:6 length:1 span_id:50 line:...0x1282) words: [ (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 7 length: 4 span_id: 51 line: ...0x1282 tval: old1 ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 12 length: 4 span_id: 53 line: ...0x1282 tval: old2 ) ] ) ] right: (Token id:Id.Right_ShArrayLiteral col:16 length:1 span_id:54 line:...0x1282) ) ] ) ) ] redirects: [] ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 6 span_id: 56 line: (SourceLine line_num:15 content:"flags=()\n" src:...0x1d89) tval: "flags=" ) pairs: [ (AssignPair left: ...0x120e lhs: (sh_lhs.Name left:...0x120e name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (ShArrayLiteral left: (Token id:Id.Op_LParen col:6 length:1 span_id:57 line:...0x1212) words: [] right: (Token id:Id.Right_ShArrayLiteral col:7 length:1 span_id:58 line:...0x1212) ) ] ) ) ] redirects: [] ) (command.ForEach keyword: (Token id: Id.KW_For col: 0 length: 3 span_id: 61 line: (SourceLine line_num:17 content:"for r in \"${regex[@]}\"; do\n" src:...0x1d89) tval: for ) iter_names: [r] iterable: (for_iter.Words words: [ (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 9 length: 1 span_id: 67 line: ...0x11ba tval: "\"" ) parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 10 length: 2 span_id: 68 line: ...0x11ba tval: "${" ) token: (Token id: Id.VSub_Name col: 12 length: 5 span_id: 69 line: ...0x11ba tval: regex ) var_name: regex bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: (Token id: Id.Right_DollarBrace col: 20 length: 1 span_id: 73 line: ...0x11ba tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 21 length: 1 span_id: 74 line: ...0x11ba tval: "\"" ) ) ] ) ] ) semi_tok: (Token id:Id.Op_Semi col:22 length:1 span_id:75 line:...0x11ba) body: (command.DoGroup left: (Token id:Id.KW_Do col:24 length:2 span_id:77 line:...0x11ba tval:do) children: [ (command.ShAssignment left: (Token id: Id.Lit_ArrayLhsOpen col: 2 length: 6 span_id: 80 line: (SourceLine line_num: 18 content: " flags[${#flags[@]}]=\"--regex=$r\"\n" src: ...0x1d89 ) tval: "flags[" ) pairs: [ (AssignPair left: ...0x112e lhs: (sh_lhs.IndexedName left: ...0x112e name: flags index: (CompoundWord parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 0 length: 2 span_id: 94 line: (SourceLine line_num: 1 content: "${#flags[@]}" src: (source.Reparsed what: "array LHS" left_token: ...0x112e right_token: (Token id: Id.Lit_ArrayLhsClose col: 20 length: 2 span_id: 88 line: ...0x1136 tval: "]=" ) ) ) tval: "${" ) token: (Token id: Id.VSub_Name col: 3 length: 5 span_id: 96 line: ...0x10b2 tval: flags ) var_name: flags prefix_op: (Token id: Id.VSub_Pound col: 2 length: 1 span_id: 95 line: ...0x10b2 tval: "#" ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: (Token id: Id.Right_DollarBrace col: 11 length: 1 span_id: 100 line: ...0x10b2 tval: "}" ) ) ] ) ) op: assign_op.Equal rhs: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 22 length: 1 span_id: 89 line: ...0x1136 tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 23 length: 8 span_id: 90 line: ...0x1136 tval: "--regex=" ) (NameTok left: (Token id: Id.VSub_DollarName col: 31 length: 2 span_id: 91 line: ...0x1136 tval: "$r" ) var_name: r ) ] right: (Token id: Id.Right_DoubleQuote col: 33 length: 1 span_id: 92 line: ...0x1136 tval: "\"" ) ) ] ) ) ] redirects: [] ) ] right: (Token id: Id.KW_Done col: 0 length: 4 span_id: 102 line: (SourceLine line_num:19 content:"done\n" src:...0x1d89) tval: done ) ) redirects: [] ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 105 line: (SourceLine line_num:21 content:"argv \"${flags[@]}\"\n" src:...0x1d89) tval: argv ) more_env: [] words: [ (CompoundWord parts:[...0x1042]) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 5 length: 1 span_id: 107 line: ...0x1046 tval: "\"" ) parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 6 length: 2 span_id: 108 line: ...0x1046 tval: "${" ) token: (Token id:Id.VSub_Name col:8 length:5 span_id:109 line:...0x1046 tval:flags) var_name: flags bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: (Token id: Id.Right_DollarBrace col: 16 length: 1 span_id: 113 line: ...0x1046 tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 17 length: 1 span_id: 114 line: ...0x1046 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 5 span_id: 146 line: (SourceLine line_num:34 content:"shopt -s simple_word_eval parse_at\n" src:...0x1d89) tval: shopt ) more_env: [] words: [ (CompoundWord parts:[...0x19d2]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:6 length:2 span_id:148 line:...0x19d6 tval:-s)] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 9 length: 16 span_id: 150 line: ...0x19d6 tval: simple_word_eval ) ] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:26 length:8 span_id:152 line:...0x19d6 tval:parse_at)] ) ] redirects: [] do_fork: T ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 155 line: (SourceLine line_num:36 content:"var regex2 = %(new1 new2)\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:6 span_id:157 line:...0x196a tval:regex2) name: regex2 ) ] rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen col:13 length:2 span_id:161 line:...0x196a tval:"%(") words: [ (CompoundWord parts: [(Token id:Id.Lit_Chars col:15 length:4 span_id:162 line:...0x196a tval:new1)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:20 length:4 span_id:164 line:...0x196a tval:new2)] ) ] right: (Token id:Id.Right_ShArrayLiteral col:24 length:1 span_id:165 line:...0x196a) ) ) (command.VarDecl keyword: (Token id: Id.KW_Var col: 0 length: 3 span_id: 167 line: (SourceLine line_num:37 content:"var flags2 = %()\n" src:...0x1d89) tval: var ) lhs: [ (NameType left: (Token id:Id.Expr_Name col:4 length:6 span_id:169 line:...0x1896 tval:flags2) name: flags2 ) ] rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen col:13 length:2 span_id:173 line:...0x1896 tval:"%(") words: [] right: (Token id:Id.Right_ShArrayLiteral col:15 length:1 span_id:174 line:...0x1896) ) ) (command.ForEach keyword: (Token id: Id.KW_For col: 0 length: 3 span_id: 177 line: (SourceLine line_num:39 content:"for r in @regex2; do\n" src:...0x1d89) tval: for ) iter_names: [r] iterable: (for_iter.Words words: [ (CompoundWord parts: [ (Token id: Id.Lit_Splice col: 9 length: 7 span_id: 183 line: ...0x17da tval: "@regex2" ) ] ) ] ) semi_tok: (Token id:Id.Op_Semi col:16 length:1 span_id:184 line:...0x17da) body: (command.DoGroup left: (Token id:Id.KW_Do col:18 length:2 span_id:186 line:...0x17da tval:do) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 6 span_id: 189 line: (SourceLine line_num: 40 content: " append \"--regex=$r\" (flags2)\n" src: ...0x1d89 ) tval: append ) more_env: [] words: [ (CompoundWord parts:[...0x176e]) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 9 length: 1 span_id: 191 line: ...0x1776 tval: "\"" ) parts: [ (Token id: Id.Lit_Chars col: 10 length: 8 span_id: 192 line: ...0x1776 tval: "--regex=" ) (NameTok left: (Token id: Id.VSub_DollarName col: 18 length: 2 span_id: 193 line: ...0x1776 tval: "$r" ) var_name: r ) ] right: (Token id: Id.Right_DoubleQuote col: 20 length: 1 span_id: 194 line: ...0x1776 tval: "\"" ) ) ] ) ] redirects: [] typed_args: (ArgList left: (Token id:Id.Op_LParen col:22 length:1 span_id:196 line:...0x1776) pos_args: [ (expr.Var left: (Token id: Id.Expr_Name col: 23 length: 6 span_id: 197 line: ...0x1776 tval: flags2 ) name: flags2 ) ] named_args: [] right: (Token id:Id.Op_RParen col:29 length:1 span_id:198 line:...0x1776) ) do_fork: T ) ] right: (Token id: Id.KW_Done col: 0 length: 4 span_id: 200 line: (SourceLine line_num:41 content:"done\n" src:...0x1d89) tval: done ) ) redirects: [] ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 203 line: (SourceLine line_num:43 content:"argv @flags2\n" src:...0x1d89) tval: argv ) more_env: [] words: [ (CompoundWord parts:[...0x1682]) (CompoundWord parts: [(Token id:Id.Lit_Splice col:5 length:7 span_id:205 line:...0x1686 tval:"@flags2")] ) ] redirects: [] do_fork: T ) ] ) --- (command.CommandList children: [ (command.ShFunction name_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 19 line: (SourceLine line_num: 8 content: "argv() { spec/bin/argv.py \"$@\"; }\n" src: (source.MainFile path:ysh/testdata/array-rewrite-2.sh) ) tval: argv ) name: argv body: (BraceGroup left: (Token id:Id.Lit_LBrace col:7 length:1 span_id:23 line:...0x1396 tval:"{") children: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 9 length: 4 span_id: 25 line: ...0x1396 tval: spec ) more_env: [] words: [ (CompoundWord parts: [ ...0x1356 (Token id: Id.Lit_Slash col: 13 length: 1 span_id: 26 line: ...0x1396 tval: / ) (Token id: Id.Lit_Chars col: 14 length: 3 span_id: 27 line: ...0x1396 tval: bin ) (Token id: Id.Lit_Slash col: 17 length: 1 span_id: 28 line: ...0x1396 tval: / ) (Token id: Id.Lit_Chars col: 18 length: 7 span_id: 29 line: ...0x1396 tval: argv.py ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 26 length: 1 span_id: 31 line: ...0x1396 tval: "\"" ) parts: [ (NameTok left: (Token id: Id.VSub_At col: 27 length: 2 span_id: 32 line: ...0x1396 tval: "$@" ) var_name: "@" ) ] right: (Token id: Id.Right_DoubleQuote col: 29 length: 1 span_id: 33 line: ...0x1396 tval: "\"" ) ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:30 length:1 span_id:34 line:...0x1396) ) ] redirects: [] right: (Token id:Id.Lit_RBrace col:32 length:1 span_id:36 line:...0x1396 tval:"}") ) ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 16 span_id: 52 line: (SourceLine line_num:15 content:"CONFIG_HAVE_FOO=yes\n" src:...0x1d89) tval: "CONFIG_HAVE_FOO=" ) pairs: [ (AssignPair left: ...0x126e lhs: (sh_lhs.Name left:...0x126e name:CONFIG_HAVE_FOO) op: assign_op.Equal rhs: (CompoundWord parts: [(Token id:Id.Lit_Chars col:16 length:3 span_id:53 line:...0x1276 tval:yes)] ) ) ] redirects: [] ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 5 span_id: 55 line: (SourceLine line_num:16 content:"path='/etc/path with spaces'\n" src:...0x1d89) tval: "path=" ) pairs: [ (AssignPair left: ...0x121e lhs: (sh_lhs.Name left:...0x121e name:path) op: assign_op.Equal rhs: (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 5 length: 1 span_id: 56 line: ...0x1222 tval: "'" ) tokens: [ (Token id: Id.Lit_Chars col: 6 length: 21 span_id: 57 line: ...0x1222 tval: "/etc/path with spaces" ) ] right: (Token id: Id.Right_SingleQuote col: 27 length: 1 span_id: 58 line: ...0x1222 tval: "'" ) ) ] ) ) ] redirects: [] ) (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 0 length: 6 span_id: 60 line: (SourceLine line_num:17 content:"flags=''\n" src:...0x1d89) tval: "flags=" ) pairs: [ (AssignPair left: ...0x11be lhs: (sh_lhs.Name left:...0x11be name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (SingleQuoted left: (Token id: Id.Left_SingleQuote col: 6 length: 1 span_id: 61 line: ...0x11c2 tval: "'" ) tokens: [] right: (Token id: Id.Right_SingleQuote col: 7 length: 1 span_id: 62 line: ...0x11c2 tval: "'" ) ) ] ) ) ] redirects: [] ) (command.If if_kw: (Token id: Id.KW_If col: 0 length: 2 span_id: 66 line: (SourceLine line_num: 20 content: "if [ -n \"${CONFIG_HAVE_FOO}\" ]; then\n" src: ...0x1d89 ) tval: if ) arms: [ (IfArm keyword: ...0x1162 cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_LBracket col: 3 length: 1 span_id: 68 line: ...0x1166 tval: "[" ) more_env: [] words: [ (CompoundWord parts:[...0x1152]) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 5 length: 2 span_id: 70 line: ...0x1166 tval: -n ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 8 length: 1 span_id: 72 line: ...0x1166 tval: "\"" ) parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 9 length: 2 span_id: 73 line: ...0x1166 tval: "${" ) token: (Token id: Id.VSub_Name col: 11 length: 15 span_id: 74 line: ...0x1166 tval: CONFIG_HAVE_FOO ) var_name: CONFIG_HAVE_FOO right: (Token id: Id.Right_DollarBrace col: 26 length: 1 span_id: 75 line: ...0x1166 tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 27 length: 1 span_id: 76 line: ...0x1166 tval: "\"" ) ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_RBracket col: 29 length: 1 span_id: 78 line: ...0x1166 tval: "]" ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:30 length:1 span_id:79 line:...0x1166) ) ] ) then_kw: (Token id:Id.KW_Then col:32 length:4 span_id:81 line:...0x1166 tval:then) action: [ (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 2 length: 6 span_id: 84 line: (SourceLine line_num: 21 content: " flags=\"${flags} --foo=$path\"\n" src: ...0x1d89 ) tval: "flags=" ) pairs: [ (AssignPair left: ...0x10be lhs: (sh_lhs.Name left:...0x10be name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 8 length: 1 span_id: 85 line: ...0x10c6 tval: "\"" ) parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 9 length: 2 span_id: 86 line: ...0x10c6 tval: "${" ) token: (Token id: Id.VSub_Name col: 11 length: 5 span_id: 87 line: ...0x10c6 tval: flags ) var_name: flags right: (Token id: Id.Right_DollarBrace col: 16 length: 1 span_id: 88 line: ...0x10c6 tval: "}" ) ) (Token id: Id.Lit_Chars col: 17 length: 7 span_id: 89 line: ...0x10c6 tval: " --foo=" ) (NameTok left: (Token id: Id.VSub_DollarName col: 24 length: 5 span_id: 90 line: ...0x10c6 tval: "$path" ) var_name: path ) ] right: (Token id: Id.Right_DoubleQuote col: 29 length: 1 span_id: 91 line: ...0x10c6 tval: "\"" ) ) ] ) ) ] redirects: [] ) ] spids: [66 81] ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi col: 0 length: 2 span_id: 93 line: (SourceLine line_num:22 content:"fi\n" src:...0x1d89) tval: fi ) redirects: [] ) (command.If if_kw: (Token id: Id.KW_If col: 0 length: 2 span_id: 96 line: (SourceLine line_num: 24 content: "if [ -n \"${CONFIG_HAVE_BAR}\" ]; then\n" src: ...0x1d89 ) tval: if ) arms: [ (IfArm keyword: ...0x1036 cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_LBracket col: 3 length: 1 span_id: 98 line: ...0x103a tval: "[" ) more_env: [] words: [ (CompoundWord parts:[...0x1026]) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 5 length: 2 span_id: 100 line: ...0x103a tval: -n ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 8 length: 1 span_id: 102 line: ...0x103a tval: "\"" ) parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 9 length: 2 span_id: 103 line: ...0x103a tval: "${" ) token: (Token id: Id.VSub_Name col: 11 length: 15 span_id: 104 line: ...0x103a tval: CONFIG_HAVE_BAR ) var_name: CONFIG_HAVE_BAR right: (Token id: Id.Right_DollarBrace col: 26 length: 1 span_id: 105 line: ...0x103a tval: "}" ) ) ] right: (Token id: Id.Right_DoubleQuote col: 27 length: 1 span_id: 106 line: ...0x103a tval: "\"" ) ) ] ) (CompoundWord parts: [ (Token id: Id.Lit_RBracket col: 29 length: 1 span_id: 108 line: ...0x103a tval: "]" ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:30 length:1 span_id:109 line:...0x103a) ) ] ) then_kw: (Token id:Id.KW_Then col:32 length:4 span_id:111 line:...0x103a tval:then) action: [ (command.ShAssignment left: (Token id: Id.Lit_VarLike col: 2 length: 6 span_id: 114 line: (SourceLine line_num:25 content:" flags=\"${flags} --bar\"\n" src:...0x1d89) tval: "flags=" ) pairs: [ (AssignPair left: ...0x1a3a lhs: (sh_lhs.Name left:...0x1a3a name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (DoubleQuoted left: (Token id: Id.Left_DoubleQuote col: 8 length: 1 span_id: 115 line: ...0x1a42 tval: "\"" ) parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 9 length: 2 span_id: 116 line: ...0x1a42 tval: "${" ) token: (Token id: Id.VSub_Name col: 11 length: 5 span_id: 117 line: ...0x1a42 tval: flags ) var_name: flags right: (Token id: Id.Right_DollarBrace col: 16 length: 1 span_id: 118 line: ...0x1a42 tval: "}" ) ) (Token id: Id.Lit_Chars col: 17 length: 6 span_id: 119 line: ...0x1a42 tval: " --bar" ) ] right: (Token id: Id.Right_DoubleQuote col: 23 length: 1 span_id: 120 line: ...0x1a42 tval: "\"" ) ) ] ) ) ] redirects: [] ) ] spids: [96 111] ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi col: 0 length: 2 span_id: 122 line: (SourceLine line_num:26 content:"fi\n" src:...0x1d89) tval: fi ) redirects: [] ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 125 line: (SourceLine line_num: 28 content: "argv ${flags} # unquoted splitting\n" src: ...0x1d89 ) tval: argv ) more_env: [] words: [ (CompoundWord parts:[...0x19b6]) (CompoundWord parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace col: 5 length: 2 span_id: 127 line: ...0x19ba tval: "${" ) token: (Token id:Id.VSub_Name col:7 length:5 span_id:128 line:...0x19ba tval:flags) var_name: flags right: (Token id: Id.Right_DollarBrace col: 12 length: 1 span_id: 129 line: ...0x19ba tval: "}" ) ) ] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 3 span_id: 161 line: (SourceLine line_num:40 content:"set -o errexit\n" src:...0x1d89) tval: set ) more_env: [] words: [ (CompoundWord parts:[...0x18be]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:4 length:2 span_id:163 line:...0x18c2 tval:-o)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:7 length:7 span_id:165 line:...0x18c2 tval:errexit)] ) ] redirects: [] do_fork: T ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 5 span_id: 167 line: (SourceLine line_num:41 content:"shopt -s parse_at simple_word_eval\n" src:...0x1d89) tval: shopt ) more_env: [] words: [ (CompoundWord parts:[...0x1872]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:6 length:2 span_id:169 line:...0x1876 tval:-s)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:8 span_id:171 line:...0x1876 tval:parse_at)] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 18 length: 16 span_id: 173 line: ...0x1876 tval: simple_word_eval ) ] ) ] redirects: [] do_fork: T ) (command.Mutation keyword: (Token id: Id.KW_SetVar col: 0 length: 6 span_id: 176 line: (SourceLine line_num: 43 content: "setvar CONFIG_HAVE_FOO = \"yes\" # TODO: change to single quotes\n" src: ...0x1d89 ) tval: setvar ) lhs: [ (NameTok left: (Token id: Id.Expr_Name col: 7 length: 15 span_id: 178 line: ...0x180e tval: CONFIG_HAVE_FOO ) var_name: CONFIG_HAVE_FOO ) ] op: (Token id:Id.Arith_Equal col:23 length:1 span_id:180 line:...0x180e) rhs: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote col:25 length:1 span_id:182 line:...0x180e tval:"\"") parts: [(Token id:Id.Lit_Chars col:26 length:3 span_id:183 line:...0x180e tval:yes)] right: (Token id:Id.Right_DoubleQuote col:29 length:1 span_id:184 line:...0x180e tval:"\"") ) ) (command.Mutation keyword: (Token id: Id.KW_SetVar col: 0 length: 6 span_id: 188 line: (SourceLine line_num: 44 content: "setvar path = \"/etc/path with spaces\"\n" src: ...0x1d89 ) tval: setvar ) lhs: [ (NameTok left: (Token id:Id.Expr_Name col:7 length:4 span_id:190 line:...0x172a tval:path) var_name: path ) ] op: (Token id:Id.Arith_Equal col:12 length:1 span_id:192 line:...0x172a) rhs: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote col:14 length:1 span_id:194 line:...0x172a tval:"\"") parts: [ (Token id: Id.Lit_Chars col: 15 length: 21 span_id: 195 line: ...0x172a tval: "/etc/path with spaces" ) ] right: (Token id:Id.Right_DoubleQuote col:36 length:1 span_id:196 line:...0x172a tval:"\"") ) ) (command.Mutation keyword: (Token id: Id.KW_SetVar col: 0 length: 6 span_id: 198 line: (SourceLine line_num:45 content:"setvar flags = %()\n" src:...0x1d89) tval: setvar ) lhs: [ (NameTok left: (Token id:Id.Expr_Name col:7 length:5 span_id:200 line:...0x164e tval:flags) var_name: flags ) ] op: (Token id:Id.Arith_Equal col:13 length:1 span_id:202 line:...0x164e) rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen col:15 length:2 span_id:204 line:...0x164e tval:"%(") words: [] right: (Token id:Id.Right_ShArrayLiteral col:17 length:1 span_id:205 line:...0x164e) ) ) (command.If if_kw: (Token id: Id.KW_If col: 0 length: 2 span_id: 208 line: (SourceLine line_num:47 content:"if test -n $CONFIG_HAVE_FOO; then\n" src:...0x1d89) tval: if ) arms: [ (IfArm keyword: ...0x1576 cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 3 length: 4 span_id: 210 line: ...0x157a tval: test ) more_env: [] words: [ (CompoundWord parts:[...0x1566]) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 8 length: 2 span_id: 212 line: ...0x157a tval: -n ) ] ) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 11 length: 16 span_id: 214 line: ...0x157a tval: "$CONFIG_HAVE_FOO" ) var_name: CONFIG_HAVE_FOO ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:27 length:1 span_id:215 line:...0x157a) ) ] ) then_kw: (Token id:Id.KW_Then col:29 length:4 span_id:217 line:...0x157a tval:then) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 6 span_id: 220 line: (SourceLine line_num: 48 content: " append -- --foo=$path (flags)\n" src: ...0x1d89 ) tval: append ) more_env: [] words: [ (CompoundWord parts:[...0x1fa2]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:2 span_id:222 line:...0x1faa tval:--)] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 12 length: 5 span_id: 224 line: ...0x1faa tval: --foo ) (Token id: Id.Lit_Equals col: 17 length: 1 span_id: 225 line: ...0x1faa tval: "=" ) (NameTok left: (Token id: Id.VSub_DollarName col: 18 length: 5 span_id: 226 line: ...0x1faa tval: "$path" ) var_name: path ) ] ) ] redirects: [] typed_args: (ArgList left: (Token id:Id.Op_LParen col:24 length:1 span_id:228 line:...0x1faa) pos_args: [ (expr.Var left: (Token id: Id.Expr_Name col: 25 length: 5 span_id: 229 line: ...0x1faa tval: flags ) name: flags ) ] named_args: [] right: (Token id:Id.Op_RParen col:30 length:1 span_id:230 line:...0x1faa) ) do_fork: T ) ] spids: [208 217] ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi col: 0 length: 2 span_id: 232 line: (SourceLine line_num:49 content:"fi\n" src:...0x1d89) tval: fi ) redirects: [] ) (command.If if_kw: (Token id: Id.KW_If col: 0 length: 2 span_id: 235 line: (SourceLine line_num:51 content:"if test -n $CONFIG_HAVE_BAR; then\n" src:...0x1d89) tval: if ) arms: [ (IfArm keyword: ...0x1eb2 cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 3 length: 4 span_id: 237 line: ...0x1eb6 tval: test ) more_env: [] words: [ (CompoundWord parts:[...0x1ea2]) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 8 length: 2 span_id: 239 line: ...0x1eb6 tval: -n ) ] ) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 11 length: 16 span_id: 241 line: ...0x1eb6 tval: "$CONFIG_HAVE_BAR" ) var_name: CONFIG_HAVE_BAR ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:27 length:1 span_id:242 line:...0x1eb6) ) ] ) then_kw: (Token id:Id.KW_Then col:29 length:4 span_id:244 line:...0x1eb6 tval:then) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 6 span_id: 247 line: (SourceLine line_num:52 content:" append -- --bar (flags)\n" src:...0x1d89) tval: append ) more_env: [] words: [ (CompoundWord parts:[...0x1e32]) (CompoundWord parts: [(Token id:Id.Lit_Chars col:9 length:2 span_id:249 line:...0x1e3a tval:--)] ) (CompoundWord parts: [ (Token id: Id.Lit_Chars col: 12 length: 5 span_id: 251 line: ...0x1e3a tval: --bar ) ] ) ] redirects: [] typed_args: (ArgList left: (Token id:Id.Op_LParen col:18 length:1 span_id:253 line:...0x1e3a) pos_args: [ (expr.Var left: (Token id: Id.Expr_Name col: 19 length: 5 span_id: 254 line: ...0x1e3a tval: flags ) name: flags ) ] named_args: [] right: (Token id:Id.Op_RParen col:24 length:1 span_id:255 line:...0x1e3a) ) do_fork: T ) ] spids: [235 244] ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi col: 0 length: 2 span_id: 257 line: (SourceLine line_num:53 content:"fi\n" src:...0x1d89) tval: fi ) redirects: [] ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 260 line: (SourceLine line_num:55 content:"argv @flags\n" src:...0x1d89) tval: argv ) more_env: [] words: [ (CompoundWord parts:[...0x1d4a]) (CompoundWord parts: [(Token id:Id.Lit_Splice col:5 length:6 span_id:262 line:...0x1d4e tval:"@flags")] ) ] redirects: [] do_fork: T ) ] )