ninja: no work to do. --- skipping ysh/testdata/assign.osh --- (command.CommandList children: [ (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 11 col: 0 line: (SourceLine line_num: 1 content: "global_var=global\n" src: (source.MainFile path:ysh/testdata/no-dynamic-scope.osh) ) ) pairs: [ (AssignPair left: ...0x12fa lhs: (sh_lhs.Name left:...0x12fa name:global_var) op: assign_op.Equal rhs: (CompoundWord parts:[(Token id:Id.Lit_Chars length:6 col:11 line:...0x1302)]) ) ] ) (command.ShFunction name_tok: (Token id: Id.Lit_Chars length: 1 col: 0 line: (SourceLine line_num:3 content:"g() {\n" src:...0x1cd1) ) name: g body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:4 line:...0x12aa) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 2 line: (SourceLine line_num:4 content:" local g_var=f\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x125e]) (CompoundWord parts: [ (Token id:Id.Lit_VarLike length:6 col:8 line:...0x1266) (Token id:Id.Lit_Chars length:1 col:14 line:...0x1266) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:5 content:" echo $g_var\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1216]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:6 col:7 line:...0x121e) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:6 content:" echo $f_var\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x11d2]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:6 col:7 line:...0x11da) ) ] ) ] is_last_cmd: F ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 2 line: (SourceLine line_num:8 content:" var oil_var = global_var\n" src:...0x1cd1) ) lhs: [ (NameType left: (Token id:Id.Expr_Name length:7 col:6 line:...0x1192) name: oil_var ) ] rhs: (expr.Var left: (Token id:Id.Expr_Name length:10 col:16 line:...0x1192) name: global_var ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:9 content:" echo $oil_var\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x10de]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:8 col:7 line:...0x10e6) ) ] ) ] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:10 content:"}\n" src:...0x1cd1) ) ) ) (command.ShFunction name_tok: (Token id: Id.Lit_Chars length: 1 col: 0 line: (SourceLine line_num:12 content:"f() {\n" src:...0x1cd1) ) name: f body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:4 line:...0x1086) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 2 line: (SourceLine line_num:13 content:" local f_var=f\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1046]) (CompoundWord parts: [ (Token id:Id.Lit_VarLike length:6 col:8 line:...0x104e) (Token id:Id.Lit_Chars length:1 col:14 line:...0x104e) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:14 content:" echo $f_var\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0xffe]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:6 col:7 line:...0x1006) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 1 col: 2 line: (SourceLine line_num:15 content:" g\n" src:...0x1cd1) ) more_env: [] words: [(CompoundWord parts:[...0x1a66])] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:16 content:"}\n" src:...0x1cd1) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 1 col: 0 line: (SourceLine line_num:18 content:"f\n" src:...0x1cd1) ) more_env: [] words: [(CompoundWord parts:[...0x1a16])] is_last_cmd: F ) ] ) --- (command.CommandList children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num: 2 content: "echo 'This is a shell script with OSH extensions!'\n" src: (source.MainFile path:ysh/testdata/hello.osh) ) ) more_env: [] words: [ (CompoundWord parts:[...0x12f2]) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:5 line:...0x12f6) sval: "This is a shell script with OSH extensions!" right: (Token id:Id.Right_SingleQuote length:1 col:49 line:...0x12f6) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:3 content:"echo\n" src:...0x1cd1) ) more_env: [] words: [(CompoundWord parts:[...0x1296])] is_last_cmd: F ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:5 content:"var x = 1 + 2*3\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:1 col:4 line:...0x125a) name:x)] rhs: (expr.Binary op: (Token id:Id.Arith_Plus length:1 col:10 line:...0x125a) left: (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:8 line:...0x125a) val: (value.Int i:1) ) right: (expr.Binary op: (Token id:Id.Arith_Star length:1 col:13 line:...0x125a) left: (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:12 line:...0x125a) val: (value.Int i:2) ) right: (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:14 line:...0x125a) val: (value.Int i:3) ) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:7 content:"echo \"x: $x\"\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1172]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:5 line:...0x1176) parts: [ (Token id:Id.Lit_Chars length:3 col:6 line:...0x1176) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:2 col:9 line:...0x1176) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:11 line:...0x1176) ) ] ) ] is_last_cmd: F ) (command.Mutation keyword: (Token id: Id.KW_SetVar length: 6 col: 0 line: (SourceLine line_num:10 content:"setvar x += 1 \n" src:...0x1cd1) ) lhs: [(Token id:Id.Expr_Name length:1 col:7 line:...0x1106 tval:x)] op: (Token id:Id.Arith_PlusEqual length:2 col:9 line:...0x1106) rhs: (expr.Const c:(Token id:Id.Expr_DecInt length:1 col:12 line:...0x1106) val:(value.Int i:1)) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:12 content:"echo \"x: $x\"\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1036]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:5 line:...0x103a) parts: [ (Token id:Id.Lit_Chars length:3 col:6 line:...0x103a) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:2 col:9 line:...0x103a) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:11 line:...0x103a) ) ] ) ] is_last_cmd: F ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:14 content:"var mylist = [1, 2, 3]\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:6 col:4 line:...0x1a82) name:mylist)] rhs: (expr.List left: (Token id:Id.Op_LBracket length:1 col:13 line:...0x1a82) elts: [ (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:14 line:...0x1a82) val: (value.Int i:1) ) (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:17 line:...0x1a82) val: (value.Int i:2) ) (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:20 line:...0x1a82) val: (value.Int i:3) ) ] ctx: expr_context.Store ) ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:16 content:"var y = mylist[1] * 10\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:1 col:4 line:...0x18fa) name:y)] rhs: (expr.Binary op: (Token id:Id.Arith_Star length:1 col:18 line:...0x18fa) left: (Subscript left: (Token id:Id.Op_LBracket length:1 col:14 line:...0x18fa) obj: (expr.Var left:(Token id:Id.Expr_Name length:6 col:8 line:...0x18fa) name:mylist) index: (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:15 line:...0x18fa) val: (value.Int i:1) ) ) right: (expr.Const c: (Token id:Id.Expr_DecInt length:2 col:20 line:...0x18fa) val: (value.Int i:10) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:18 content:"echo \"y: $y\"\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x17ee]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:5 line:...0x17f2) parts: [ (Token id:Id.Lit_Chars length:3 col:6 line:...0x17f2) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:2 col:9 line:...0x17f2) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:11 line:...0x17f2) ) ] ) ] is_last_cmd: F ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:20 content:"var list2 = mylist ++ [4, 5]\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:5 col:4 line:...0x1792) name:list2)] rhs: (expr.Binary op: (Token id:Id.Arith_DPlus length:2 col:19 line:...0x1792) left: (expr.Var left:(Token id:Id.Expr_Name length:6 col:12 line:...0x1792) name:mylist) right: (expr.List left: (Token id:Id.Op_LBracket length:1 col:22 line:...0x1792) elts: [ (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:23 line:...0x1792) val: (value.Int i:4) ) (expr.Const c: (Token id:Id.Expr_DecInt length:1 col:26 line:...0x1792) val: (value.Int i:5) ) ] ctx: expr_context.Store ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 2 col: 0 line: (SourceLine line_num:26 content:"pp cell list2\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x15ee]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:4 col:3 line:...0x15f2)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:5 col:8 line:...0x15f2)]) ] is_last_cmd: F ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 5 col: 0 line: (SourceLine line_num: 28 content: "str1='shell string' # traditinoal shell-style assignment\n" src: ...0x1cd1 ) ) pairs: [ (AssignPair left: ...0x159a lhs: (sh_lhs.Name left:...0x159a name:str1) op: assign_op.Equal rhs: (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:5 line:...0x159e) sval: "shell string" right: (Token id:Id.Right_SingleQuote length:1 col:18 line:...0x159e) ) ] ) ) ] ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:31 content:"var str2 = \"Oil string\"\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:4 col:4 line:...0x1fbe) name:str2)] rhs: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:11 line:...0x1fbe) parts: [(Token id:Id.Lit_Chars length:10 col:12 line:...0x1fbe)] right: (Token id:Id.Right_DoubleQuote length:1 col:22 line:...0x1fbe) ) ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:33 content:"var str3 = str1 ++ str2\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:4 col:4 line:...0x1efa) name:str3)] rhs: (expr.Binary op: (Token id:Id.Arith_DPlus length:2 col:16 line:...0x1efa) left: (expr.Var left:(Token id:Id.Expr_Name length:4 col:11 line:...0x1efa) name:str1) right: (expr.Var left:(Token id:Id.Expr_Name length:4 col:19 line:...0x1efa) name:str2) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:35 content:"echo \"str3 = $str3\"\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1e2a]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:5 line:...0x1e2e) parts: [ (Token id:Id.Lit_Chars length:7 col:6 line:...0x1e2e) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:5 col:13 line:...0x1e2e) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:18 line:...0x1e2e) ) ] ) ] is_last_cmd: F ) ] ) --- (command.CommandList children: [ (command.ShFunction name_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num: 8 content: "argv() { spec/bin/argv.py \"$@\"; }\n" src: (source.MainFile path:ysh/testdata/array-rewrite-2.sh) ) ) name: argv body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:7 line:...0x128e) children: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:9 line:...0x128e) more_env: [] words: [ (CompoundWord parts: [ ...0x124e (Token id: Id.Lit_Slash length: 1 col: 13 line: ...0x128e ) (Token id: Id.Lit_Chars length: 3 col: 14 line: ...0x128e ) (Token id: Id.Lit_Slash length: 1 col: 17 line: ...0x128e ) (Token id: Id.Lit_Chars length: 7 col: 18 line: ...0x128e ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:26 line:...0x128e) parts: [ (SimpleVarSub tok: (Token id:Id.VSub_At length:2 col:27 line:...0x128e) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:29 line:...0x128e) ) ] ) ] is_last_cmd: F ) terminator: (Token id:Id.Op_Semi length:1 col:30 line:...0x128e) ) ] right: (Token id:Id.Lit_RBrace length:1 col:32 line:...0x128e) ) ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 16 col: 0 line: (SourceLine line_num:15 content:"CONFIG_HAVE_FOO=yes\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x116a lhs: (sh_lhs.Name left:...0x116a name:CONFIG_HAVE_FOO) op: assign_op.Equal rhs: (CompoundWord parts:[(Token id:Id.Lit_Chars length:3 col:16 line:...0x116e)]) ) ] ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 5 col: 0 line: (SourceLine line_num:16 content:"path='/etc/path with spaces'\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x111e lhs: (sh_lhs.Name left:...0x111e name:path) op: assign_op.Equal rhs: (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:5 line:...0x1122) sval: "/etc/path with spaces" right: (Token id:Id.Right_SingleQuote length:1 col:27 line:...0x1122) ) ] ) ) ] ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 6 col: 0 line: (SourceLine line_num:17 content:"flags=''\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x10be lhs: (sh_lhs.Name left:...0x10be name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:6 line:...0x10c2) sval: "" right: (Token id:Id.Right_SingleQuote length:1 col:7 line:...0x10c2) ) ] ) ) ] ) (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num: 20 content: "if [ -n \"${CONFIG_HAVE_FOO}\" ]; then\n" src: ...0x1cd1 ) ) arms: [ (IfArm keyword: ...0x1066 cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_LBracket length:1 col:3 line:...0x106a) more_env: [] words: [ (CompoundWord parts:[...0x1052]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:5 line:...0x106a)] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:8 line:...0x106a) parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:9 line:...0x106a) token: (Token id:Id.VSub_Name length:15 col:11 line:...0x106a) var_name: CONFIG_HAVE_FOO right: (Token id: Id.Right_DollarBrace length: 1 col: 26 line: ...0x106a ) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:27 line:...0x106a) ) ] ) (CompoundWord parts: [(Token id:Id.Lit_RBracket length:1 col:29 line:...0x106a)] ) ] is_last_cmd: F ) terminator: (Token id:Id.Op_Semi length:1 col:30 line:...0x106a) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:32 line:...0x106a) action: [ (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 6 col: 2 line: (SourceLine line_num: 21 content: " flags=\"${flags} --foo=$path\"\n" src: ...0x1cd1 ) ) pairs: [ (AssignPair left: ...0x1a6a lhs: (sh_lhs.Name left:...0x1a6a name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:8 line:...0x1a72) parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:9 line:...0x1a72) token: (Token id:Id.VSub_Name length:5 col:11 line:...0x1a72) var_name: flags right: (Token id:Id.Right_DollarBrace length:1 col:16 line:...0x1a72) ) (Token id: Id.Lit_Chars length: 7 col: 17 line: ...0x1a72 ) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:5 col:24 line:...0x1a72) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:29 line:...0x1a72) ) ] ) ) ] ) ] then_tok: ...0x1a8a ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:22 content:"fi\n" src:...0x1cd1) ) ) (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num: 24 content: "if [ -n \"${CONFIG_HAVE_BAR}\" ]; then\n" src: ...0x1cd1 ) ) arms: [ (IfArm keyword: ...0x19ea cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_LBracket length:1 col:3 line:...0x19ee) more_env: [] words: [ (CompoundWord parts:[...0x19d6]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:5 line:...0x19ee)] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:8 line:...0x19ee) parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:9 line:...0x19ee) token: (Token id:Id.VSub_Name length:15 col:11 line:...0x19ee) var_name: CONFIG_HAVE_BAR right: (Token id: Id.Right_DollarBrace length: 1 col: 26 line: ...0x19ee ) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:27 line:...0x19ee) ) ] ) (CompoundWord parts: [(Token id:Id.Lit_RBracket length:1 col:29 line:...0x19ee)] ) ] is_last_cmd: F ) terminator: (Token id:Id.Op_Semi length:1 col:30 line:...0x19ee) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:32 line:...0x19ee) action: [ (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 6 col: 2 line: (SourceLine line_num:25 content:" flags=\"${flags} --bar\"\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x1946 lhs: (sh_lhs.Name left:...0x1946 name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:8 line:...0x194e) parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:9 line:...0x194e) token: (Token id:Id.VSub_Name length:5 col:11 line:...0x194e) var_name: flags right: (Token id:Id.Right_DollarBrace length:1 col:16 line:...0x194e) ) (Token id: Id.Lit_Chars length: 6 col: 17 line: ...0x194e ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:23 line:...0x194e) ) ] ) ) ] ) ] then_tok: ...0x1966 ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:26 content:"fi\n" src:...0x1cd1) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num: 28 content: "argv ${flags} # unquoted splitting\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x18ca]) (CompoundWord parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:5 line:...0x18ce) token: (Token id:Id.VSub_Name length:5 col:7 line:...0x18ce) var_name: flags right: (Token id:Id.Right_DollarBrace length:1 col:12 line:...0x18ce) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 3 col: 0 line: (SourceLine line_num:40 content:"set -o errexit\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x17d2]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:4 line:...0x17d6)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:7 col:7 line:...0x17d6)]) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 0 line: (SourceLine line_num:41 content:"shopt -s parse_at simple_word_eval\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1786]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:6 line:...0x178a)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:8 col:9 line:...0x178a)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:16 col:18 line:...0x178a)]) ] is_last_cmd: F ) (command.Mutation keyword: (Token id: Id.KW_SetVar length: 6 col: 0 line: (SourceLine line_num: 43 content: "setvar CONFIG_HAVE_FOO = \"yes\" # TODO: change to single quotes\n" src: ...0x1cd1 ) ) lhs: [(Token id:Id.Expr_Name length:15 col:7 line:...0x172a tval:CONFIG_HAVE_FOO)] op: (Token id:Id.Arith_Equal length:1 col:23 line:...0x172a) rhs: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:25 line:...0x172a) parts: [(Token id:Id.Lit_Chars length:3 col:26 line:...0x172a)] right: (Token id:Id.Right_DoubleQuote length:1 col:29 line:...0x172a) ) ) (command.Mutation keyword: (Token id: Id.KW_SetVar length: 6 col: 0 line: (SourceLine line_num: 44 content: "setvar path = \"/etc/path with spaces\"\n" src: ...0x1cd1 ) ) lhs: [(Token id:Id.Expr_Name length:4 col:7 line:...0x1646 tval:path)] op: (Token id:Id.Arith_Equal length:1 col:12 line:...0x1646) rhs: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:14 line:...0x1646) parts: [(Token id:Id.Lit_Chars length:21 col:15 line:...0x1646)] right: (Token id:Id.Right_DoubleQuote length:1 col:36 line:...0x1646) ) ) (command.Mutation keyword: (Token id: Id.KW_SetVar length: 6 col: 0 line: (SourceLine line_num:45 content:"setvar flags = %()\n" src:...0x1cd1) ) lhs: [(Token id:Id.Expr_Name length:5 col:7 line:...0x156e tval:flags)] op: (Token id:Id.Arith_Equal length:1 col:13 line:...0x156e) rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen length:2 col:15 line:...0x156e) words: [] right: (Token id:Id.Right_ShArrayLiteral length:1 col:17 line:...0x156e) ) ) (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num:47 content:"if test -n $CONFIG_HAVE_FOO; then\n" src:...0x1cd1) ) arms: [ (IfArm keyword: ...0x1f3e cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:3 line:...0x1f42) more_env: [] words: [ (CompoundWord parts:[...0x1f2a]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:8 line:...0x1f42)] ) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:16 col:11 line:...0x1f42) ) ] ) ] is_last_cmd: F ) terminator: (Token id:Id.Op_Semi length:1 col:27 line:...0x1f42) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:29 line:...0x1f42) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 6 col: 2 line: (SourceLine line_num: 48 content: " append -- --foo=$path (flags)\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x1ec6]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:9 line:...0x1ece)] ) (CompoundWord parts: [ (Token id:Id.Lit_Chars length:5 col:12 line:...0x1ece) (Token id:Id.Lit_Equals length:1 col:17 line:...0x1ece) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:5 col:18 line:...0x1ece) ) ] ) ] typed_args: (ArgList left: (Token id:Id.Op_LParen length:1 col:24 line:...0x1ece) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name length:5 col:25 line:...0x1ece) name: flags ) ] named_args: [] right: (Token id:Id.Op_RParen length:1 col:30 line:...0x1ece) ) is_last_cmd: F ) ] then_tok: ...0x1ee2 ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:49 content:"fi\n" src:...0x1cd1) ) ) (command.If if_kw: (Token id: Id.KW_If length: 2 col: 0 line: (SourceLine line_num:51 content:"if test -n $CONFIG_HAVE_BAR; then\n" src:...0x1cd1) ) arms: [ (IfArm keyword: ...0x1dde cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:3 line:...0x1de2) more_env: [] words: [ (CompoundWord parts:[...0x1dca]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:8 line:...0x1de2)] ) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:16 col:11 line:...0x1de2) ) ] ) ] is_last_cmd: F ) terminator: (Token id:Id.Op_Semi length:1 col:27 line:...0x1de2) ) ] ) then_kw: (Token id:Id.KW_Then length:4 col:29 line:...0x1de2) action: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 6 col: 2 line: (SourceLine line_num:52 content:" append -- --bar (flags)\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1d62]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:9 line:...0x1d6a)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:5 col:12 line:...0x1d6a)] ) ] typed_args: (ArgList left: (Token id:Id.Op_LParen length:1 col:18 line:...0x1d6a) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name length:5 col:19 line:...0x1d6a) name: flags ) ] named_args: [] right: (Token id:Id.Op_RParen length:1 col:24 line:...0x1d6a) ) is_last_cmd: F ) ] then_tok: ...0x1d82 ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi length: 2 col: 0 line: (SourceLine line_num:53 content:"fi\n" src:...0x1cd1) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:55 content:"argv @flags\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1c82]) (CompoundWord parts:[(Token id:Id.Lit_Splice length:6 col:5 line:...0x1c86)]) ] is_last_cmd: F ) ] ) --- (command.CommandList children: [ (command.ShFunction name_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num: 8 content: "argv() { spec/bin/argv.py \"$@\"; }\n" src: (source.MainFile path:ysh/testdata/array-rewrite-1.sh) ) ) name: argv body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:7 line:...0x128a) children: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars length:4 col:9 line:...0x128a) more_env: [] words: [ (CompoundWord parts: [ ...0x124a (Token id: Id.Lit_Slash length: 1 col: 13 line: ...0x128a ) (Token id: Id.Lit_Chars length: 3 col: 14 line: ...0x128a ) (Token id: Id.Lit_Slash length: 1 col: 17 line: ...0x128a ) (Token id: Id.Lit_Chars length: 7 col: 18 line: ...0x128a ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:26 line:...0x128a) parts: [ (SimpleVarSub tok: (Token id:Id.VSub_At length:2 col:27 line:...0x128a) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:29 line:...0x128a) ) ] ) ] is_last_cmd: F ) terminator: (Token id:Id.Op_Semi length:1 col:30 line:...0x128a) ) ] right: (Token id:Id.Lit_RBrace length:1 col:32 line:...0x128a) ) ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 6 col: 0 line: (SourceLine line_num:14 content:"regex=(old1 old2)\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x1176 lhs: (sh_lhs.Name left:...0x1176 name:regex) op: assign_op.Equal rhs: (CompoundWord parts: [ (ShArrayLiteral left: (Token id:Id.Op_LParen length:1 col:6 line:...0x117a) words: [ (CompoundWord parts: [(Token id:Id.Lit_Chars length:4 col:7 line:...0x117a)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:4 col:12 line:...0x117a)] ) ] right: (Token id:Id.Right_ShArrayLiteral length:1 col:16 line:...0x117a) ) ] ) ) ] ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 6 col: 0 line: (SourceLine line_num:15 content:"flags=()\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x110a lhs: (sh_lhs.Name left:...0x110a name:flags) op: assign_op.Equal rhs: (CompoundWord parts: [ (ShArrayLiteral left: (Token id:Id.Op_LParen length:1 col:6 line:...0x110e) words: [] right: (Token id:Id.Right_ShArrayLiteral length:1 col:7 line:...0x110e) ) ] ) ) ] ) (command.ForEach keyword: (Token id: Id.KW_For length: 3 col: 0 line: (SourceLine line_num:17 content:"for r in \"${regex[@]}\"; do\n" src:...0x1cd1) ) iter_names: [r] iterable: (for_iter.Words words: [ (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:9 line:...0x10ba) parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:10 line:...0x10ba) token: (Token id:Id.VSub_Name length:5 col:12 line:...0x10ba) var_name: regex bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: (Token id:Id.Right_DollarBrace length:1 col:20 line:...0x10ba) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:21 line:...0x10ba) ) ] ) ] ) semi_tok: (Token id:Id.Op_Semi length:1 col:22 line:...0x10ba) body: (command.DoGroup left: (Token id:Id.KW_Do length:2 col:24 line:...0x10ba) children: [ (command.ShAssignment left: (Token id: Id.Lit_ArrayLhsOpen length: 6 col: 2 line: (SourceLine line_num: 18 content: " flags[${#flags[@]}]=\"--regex=$r\"\n" src: ...0x1cd1 ) ) pairs: [ (AssignPair left: ...0x102a lhs: (sh_lhs.IndexedName left: ...0x102a name: flags index: (CompoundWord parts: [ (BracedVarSub left: (Token id: Id.Left_DollarBrace length: 2 col: 0 line: (SourceLine line_num: 1 content: "${#flags[@]}" src: (source.Reparsed what: "array LHS" left_token: ...0x102a right_token: (Token id: Id.Lit_ArrayLhsClose length: 2 col: 20 line: ...0x1032 ) ) ) ) token: (Token id:Id.VSub_Name length:5 col:3 line:...0x1a5a) var_name: flags prefix_op: (Token id:Id.VSub_Pound length:1 col:2 line:...0x1a5a) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: (Token id:Id.Right_DollarBrace length:1 col:11 line:...0x1a5a) ) ] ) ) op: assign_op.Equal rhs: (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:22 line:...0x1032) parts: [ (Token id: Id.Lit_Chars length: 8 col: 23 line: ...0x1032 ) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:2 col:31 line:...0x1032) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:33 line:...0x1032) ) ] ) ) ] ) ] right: (Token id: Id.KW_Done length: 4 col: 0 line: (SourceLine line_num:19 content:"done\n" src:...0x1cd1) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:21 content:"argv \"${flags[@]}\"\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x19ee]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:5 line:...0x19f2) parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:6 line:...0x19f2) token: (Token id:Id.VSub_Name length:5 col:8 line:...0x19f2) var_name: flags bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: (Token id:Id.Right_DollarBrace length:1 col:16 line:...0x19f2) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:17 line:...0x19f2) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 0 line: (SourceLine line_num:34 content:"shopt -s simple_word_eval parse_at\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x18d6]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:6 line:...0x18da)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:16 col:9 line:...0x18da)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:8 col:26 line:...0x18da)]) ] is_last_cmd: F ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:36 content:"var regex2 = %(new1 new2)\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:6 col:4 line:...0x1876) name:regex2)] rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen length:2 col:13 line:...0x1876) words: [ (CompoundWord parts:[(Token id:Id.Lit_Chars length:4 col:15 line:...0x1876)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:4 col:20 line:...0x1876)]) ] right: (Token id:Id.Right_ShArrayLiteral length:1 col:24 line:...0x1876) ) ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:37 content:"var flags2 = %()\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:6 col:4 line:...0x17a2) name:flags2)] rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen length:2 col:13 line:...0x17a2) words: [] right: (Token id:Id.Right_ShArrayLiteral length:1 col:15 line:...0x17a2) ) ) (command.ForEach keyword: (Token id: Id.KW_For length: 3 col: 0 line: (SourceLine line_num:39 content:"for r in @regex2; do\n" src:...0x1cd1) ) iter_names: [r] iterable: (for_iter.Words words: [(CompoundWord parts:[(Token id:Id.Lit_Splice length:7 col:9 line:...0x16e6)])] ) semi_tok: (Token id:Id.Op_Semi length:1 col:16 line:...0x16e6) body: (command.DoGroup left: (Token id:Id.KW_Do length:2 col:18 line:...0x16e6) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 6 col: 2 line: (SourceLine line_num: 40 content: " append \"--regex=$r\" (flags2)\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x1676]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:9 line:...0x167e) parts: [ (Token id: Id.Lit_Chars length: 8 col: 10 line: ...0x167e ) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:2 col:18 line:...0x167e) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:20 line:...0x167e) ) ] ) ] typed_args: (ArgList left: (Token id:Id.Op_LParen length:1 col:22 line:...0x167e) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name length:6 col:23 line:...0x167e) name: flags2 ) ] named_args: [] right: (Token id:Id.Op_RParen length:1 col:29 line:...0x167e) ) is_last_cmd: F ) ] right: (Token id: Id.KW_Done length: 4 col: 0 line: (SourceLine line_num:41 content:"done\n" src:...0x1cd1) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:43 content:"argv @flags2\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1592]) (CompoundWord parts:[(Token id:Id.Lit_Splice length:7 col:5 line:...0x1596)]) ] is_last_cmd: F ) ] ) --- (command.CommandList children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 5 col: 0 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) ) ) more_env: [] words: [ (CompoundWord parts:[...0x12f6]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:2 col:6 line:...0x12fa)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:12 col:9 line:...0x12fa)]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:16 col:22 line:...0x12fa)]) ] is_last_cmd: F ) (command.ShAssignment left: (Token id: Id.Lit_VarLike length: 9 col: 0 line: (SourceLine line_num:4 content:"myglobal=global\n" src:...0x1cd1) ) pairs: [ (AssignPair left: ...0x128e lhs: (sh_lhs.Name left:...0x128e name:myglobal) op: assign_op.Equal rhs: (CompoundWord parts:[(Token id:Id.Lit_Chars length:6 col:9 line:...0x1292)]) ) ] ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num: 6 content: "var myarray = :| $myglobal $'line\\n' ${z:-default} |\n" src: ...0x1cd1 ) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:7 col:4 line:...0x1242) name:myarray)] rhs: (ShArrayLiteral left: (Token id:Id.Left_ColonPipe length:2 col:14 line:...0x1242) words: [ (CompoundWord parts: [(SimpleVarSub tok:(Token id:Id.VSub_DollarName length:9 col:17 line:...0x1242))] ) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_DollarSingleQuote length:2 col:27 line:...0x1242) sval: "line\n" right: (Token id:Id.Right_SingleQuote length:1 col:35 line:...0x1242) ) ] ) (CompoundWord parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:37 line:...0x1242) token: (Token id:Id.VSub_Name length:1 col:39 line:...0x1242) var_name: z suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen length:2 col:40 line:...0x1242) arg_word: (CompoundWord parts: [(Token id:Id.Lit_Chars length:7 col:42 line:...0x1242)] ) ) right: (Token id:Id.Right_DollarBrace length:1 col:49 line:...0x1242) ) ] ) ] right: (Token id:Id.Op_Pipe length:1 col:51 line:...0x1242) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:7 content:"spec/bin/argv.py @myarray\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts: [ ...0x1126 (Token id:Id.Lit_Slash length:1 col:4 line:...0x112a) (Token id:Id.Lit_Chars length:3 col:5 line:...0x112a) (Token id:Id.Lit_Slash length:1 col:8 line:...0x112a) (Token id:Id.Lit_Chars length:7 col:9 line:...0x112a) ] ) (CompoundWord parts:[(Token id:Id.Lit_Splice length:8 col:17 line:...0x112a)]) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:8 content:"echo len=$[len(myarray)]\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x10c6]) (CompoundWord parts: [ (Token id:Id.Lit_VarLike length:4 col:5 line:...0x10ca) (word_part.ExprSub left: (Token id:Id.Left_DollarBracket length:2 col:9 line:...0x10ca) child: (expr.FuncCall func: (expr.Var left: (Token id:Id.Expr_Name length:3 col:11 line:...0x10ca) name: len ) args: (ArgList left: (Token id:Id.Op_LParen length:1 col:14 line:...0x10ca) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name length:7 col:15 line:...0x10ca) name: myarray ) ] named_args: [] right: (Token id:Id.Op_RParen length:1 col:22 line:...0x10ca) ) ) right: (Token id:Id.Op_RBracket length:1 col:23 line:...0x10ca) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:9 content:"echo\n" src:...0x1cd1) ) more_env: [] words: [(CompoundWord parts:[...0x1a6e])] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 6 col: 0 line: (SourceLine line_num: 11 content: "append _ '1 2' ${myglobal:-default} (myarray)\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x1a32]) (CompoundWord parts:[(Token id:Id.Lit_Chars length:1 col:7 line:...0x1a36)]) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:9 line:...0x1a36) sval: "1 2" right: (Token id:Id.Right_SingleQuote length:1 col:13 line:...0x1a36) ) ] ) (CompoundWord parts: [ (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:15 line:...0x1a36) token: (Token id:Id.VSub_Name length:8 col:17 line:...0x1a36) var_name: myglobal suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen length:2 col:25 line:...0x1a36) arg_word: (CompoundWord parts: [(Token id:Id.Lit_Chars length:7 col:27 line:...0x1a36)] ) ) right: (Token id:Id.Right_DollarBrace length:1 col:34 line:...0x1a36) ) ] ) ] typed_args: (ArgList left: (Token id:Id.Op_LParen length:1 col:36 line:...0x1a36) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name length:7 col:37 line:...0x1a36) name: myarray ) ] named_args: [] right: (Token id:Id.Op_RParen length:1 col:44 line:...0x1a36) ) is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:12 content:"spec/bin/argv.py @myarray\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts: [ ...0x193a (Token id:Id.Lit_Slash length:1 col:4 line:...0x193e) (Token id:Id.Lit_Chars length:3 col:5 line:...0x193e) (Token id:Id.Lit_Slash length:1 col:8 line:...0x193e) (Token id:Id.Lit_Chars length:7 col:9 line:...0x193e) ] ) (CompoundWord parts:[(Token id:Id.Lit_Splice length:8 col:17 line:...0x193e)]) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:13 content:"echo len=$[len(myarray)]\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x18da]) (CompoundWord parts: [ (Token id:Id.Lit_VarLike length:4 col:5 line:...0x18de) (word_part.ExprSub left: (Token id:Id.Left_DollarBracket length:2 col:9 line:...0x18de) child: (expr.FuncCall func: (expr.Var left: (Token id:Id.Expr_Name length:3 col:11 line:...0x18de) name: len ) args: (ArgList left: (Token id:Id.Op_LParen length:1 col:14 line:...0x18de) pos_args: [ (expr.Var left: (Token id:Id.Expr_Name length:7 col:15 line:...0x18de) name: myarray ) ] named_args: [] right: (Token id:Id.Op_RParen length:1 col:22 line:...0x18de) ) ) right: (Token id:Id.Op_RBracket length:1 col:23 line:...0x18de) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:14 content:"echo\n" src:...0x1cd1) ) more_env: [] words: [(CompoundWord parts:[...0x17de])] is_last_cmd: F ) (command.ForEach keyword: (Token id: Id.KW_For length: 3 col: 0 line: (SourceLine line_num:16 content:"for item in (myarray) {\n" src:...0x1cd1) ) iter_names: [item] iterable: (for_iter.YshExpr e: (expr.Var left:(Token id:Id.Expr_Name length:7 col:13 line:...0x17a2) name:myarray) blame: (Token id:Id.KW_In length:2 col:9 line:...0x17a2) ) body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:22 line:...0x17a2) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:17 content:" echo \" $item\"\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x16f2]) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:7 line:...0x16fa) parts: [ (Token id:Id.Lit_Chars length:2 col:8 line:...0x16fa) (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:5 col:10 line:...0x16fa) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:15 line:...0x16fa) ) ] ) ] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:18 content:"}\n" src:...0x1cd1) ) ) ) ] ) --- (command.CommandList children: [ (command.ShFunction name_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num: 19 content: "argv() {\n" src: (source.MainFile path:ysh/testdata/sigil-pairs.sh) ) ) name: argv body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:7 line:...0x11c2) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 6 col: 2 line: (SourceLine line_num: 20 content: " python -c 'import sys;print(sys.argv[1:])' @ARGV\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x117a]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:2 col:9 line:...0x1182)] ) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:12 line:...0x1182) sval: "import sys;print(sys.argv[1:])" right: (Token id:Id.Right_SingleQuote length:1 col:43 line:...0x1182) ) ] ) (CompoundWord parts: [(Token id:Id.Lit_Splice length:5 col:45 line:...0x1182)] ) ] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:21 content:"}\n" src:...0x1cd1) ) ) ) (command.ShFunction name_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:23 content:"show() {\n" src:...0x1cd1) ) name: show body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:7 line:...0x10de) children: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:24 content:" echo '====='\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x109e]) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:7 line:...0x10a6) sval: "=====" right: (Token id:Id.Right_SingleQuote length:1 col:13 line:...0x10a6) ) ] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:25 content:" argv @ARGV\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x1042]) (CompoundWord parts: [(Token id:Id.Lit_Splice length:5 col:7 line:...0x104a)] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 2 line: (SourceLine line_num:26 content:" echo\n" src:...0x1cd1) ) more_env: [] words: [(CompoundWord parts:[...0x1002])] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:27 content:"}\n" src:...0x1cd1) ) ) ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:30 content:"var strarray = %(\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:8 col:4 line:...0x1a52) name:strarray)] rhs: (ShArrayLiteral left: (Token id:Id.Left_PercentParen length:2 col:15 line:...0x1a52) words: [ (CompoundWord parts: [ (Token id: Id.Lit_Chars length: 4 col: 4 line: (SourceLine line_num: 31 content: " bare words *.sh {a,b}@example.com 'sq' \"dq ${x:-default}\"\n" src: ...0x1cd1 ) ) ] ) (CompoundWord parts:[(Token id:Id.Lit_Chars length:5 col:9 line:...0x19c2)]) (CompoundWord parts: [ (Token id:Id.Lit_Star length:1 col:15 line:...0x19c2) (Token id:Id.Lit_Chars length:3 col:16 line:...0x19c2) ] ) (word.BracedTree parts: [ (word_part.BracedTuple words: [ (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:21 line:...0x19c2)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:23 line:...0x19c2)] ) ] ) (Token id:Id.Lit_Splice length:8 col:25 line:...0x19c2) (Token id:Id.Lit_Chars length:4 col:33 line:...0x19c2) ] ) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:38 line:...0x19c2) sval: sq right: (Token id:Id.Right_SingleQuote length:1 col:41 line:...0x19c2) ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:43 line:...0x19c2) parts: [ (Token id:Id.Lit_Chars length:3 col:44 line:...0x19c2) (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:47 line:...0x19c2) token: (Token id:Id.VSub_Name length:1 col:49 line:...0x19c2) var_name: x suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen length:2 col:50 line:...0x19c2) arg_word: (CompoundWord parts: [(Token id:Id.Lit_Chars length:7 col:52 line:...0x19c2)] ) ) right: (Token id:Id.Right_DollarBrace length:1 col:59 line:...0x19c2) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:60 line:...0x19c2) ) ] ) ] right: (Token id: Id.Right_ShArrayLiteral length: 1 col: 0 line: (SourceLine line_num:32 content:")\n" src:...0x1cd1) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:34 content:"show @strarray\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x18b6]) (CompoundWord parts:[(Token id:Id.Lit_Splice length:9 col:5 line:...0x18ba)]) ] is_last_cmd: F ) (command.VarDecl keyword: (Token id: Id.KW_Var length: 3 col: 0 line: (SourceLine line_num:36 content:"var cmd_sub = $(\n" src:...0x1cd1) ) lhs: [(NameType left:(Token id:Id.Expr_Name length:7 col:4 line:...0x186e) name:cmd_sub)] rhs: (CommandSub left_token: (Token id:Id.Left_DollarParen length:2 col:14 line:...0x186e) child: (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 4 line: (SourceLine line_num: 37 content: " echo bare words *.sh {a,b}@example.com 'sq' \"dq ${x:-default}\"\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x17d6]) (CompoundWord parts: [(Token id:Id.Lit_Chars length:4 col:9 line:...0x17de)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:5 col:14 line:...0x17de)] ) (CompoundWord parts: [ (Token id:Id.Lit_Star length:1 col:20 line:...0x17de) (Token id:Id.Lit_Chars length:3 col:21 line:...0x17de) ] ) (word.BracedTree parts: [ (word_part.BracedTuple words: [ (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:26 line:...0x17de)] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:28 line:...0x17de)] ) ] ) (Token id:Id.Lit_Splice length:8 col:30 line:...0x17de) (Token id:Id.Lit_Chars length:4 col:38 line:...0x17de) ] ) (CompoundWord parts: [ (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:43 line:...0x17de) sval: sq right: (Token id:Id.Right_SingleQuote length:1 col:46 line:...0x17de) ) ] ) (CompoundWord parts: [ (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:48 line:...0x17de) parts: [ (Token id: Id.Lit_Chars length: 3 col: 49 line: ...0x17de ) (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:52 line:...0x17de) token: (Token id:Id.VSub_Name length:1 col:54 line:...0x17de) var_name: x suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen length:2 col:55 line:...0x17de) arg_word: (CompoundWord parts: [(Token id:Id.Lit_Chars length:7 col:57 line:...0x17de)] ) ) right: (Token id:Id.Right_DollarBrace length:1 col:64 line:...0x17de) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:65 line:...0x17de) ) ] ) ] is_last_cmd: F ) right: (Token id: Id.Eof_RParen length: 1 col: 0 line: (SourceLine line_num:38 content:")\n" src:...0x1cd1) ) ) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num:40 content:"show $cmd_sub\n" src:...0x1cd1) ) more_env: [] words: [ (CompoundWord parts:[...0x16b2]) (CompoundWord parts: [(SimpleVarSub tok:(Token id:Id.VSub_DollarName length:8 col:5 line:...0x16b6))] ) ] is_last_cmd: F ) (command.Simple blame_tok: (Token id: Id.Lit_Chars length: 4 col: 0 line: (SourceLine line_num: 42 content: "show $['quoted ' ++ 'words ' ++ \"dq ${x:-default}\"]\n" src: ...0x1cd1 ) ) more_env: [] words: [ (CompoundWord parts:[...0x166a]) (CompoundWord parts: [ (word_part.ExprSub left: (Token id:Id.Left_DollarBracket length:2 col:5 line:...0x166e) child: (expr.Binary op: (Token id:Id.Arith_DPlus length:2 col:29 line:...0x166e) left: (expr.Binary op: (Token id:Id.Arith_DPlus length:2 col:17 line:...0x166e) left: (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:7 line:...0x166e) sval: "quoted " right: (Token id:Id.Right_SingleQuote length:1 col:15 line:...0x166e) ) right: (SingleQuoted left: (Token id:Id.Left_SingleQuote length:1 col:20 line:...0x166e) sval: "words " right: (Token id:Id.Right_SingleQuote length:1 col:27 line:...0x166e) ) ) right: (DoubleQuoted left: (Token id:Id.Left_DoubleQuote length:1 col:32 line:...0x166e) parts: [ (Token id: Id.Lit_Chars length: 3 col: 33 line: ...0x166e ) (BracedVarSub left: (Token id:Id.Left_DollarBrace length:2 col:36 line:...0x166e) token: (Token id:Id.VSub_Name length:1 col:38 line:...0x166e) var_name: x suffix_op: (suffix_op.Unary op: (Token id:Id.VTest_ColonHyphen length:2 col:39 line:...0x166e) arg_word: (CompoundWord parts: [(Token id:Id.Lit_Chars length:7 col:41 line:...0x166e)] ) ) right: (Token id:Id.Right_DollarBrace length:1 col:48 line:...0x166e) ) ] right: (Token id:Id.Right_DoubleQuote length:1 col:49 line:...0x166e) ) ) right: (Token id:Id.Op_RBracket length:1 col:50 line:...0x166e) ) ] ) ] is_last_cmd: F ) ] )