....(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:empty spids:[0]) op: Equal rhs: {(word_part.ArrayLiteralPart)} spids: [0] ) ] spids: [0] ) ] ) (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array spids:[0]) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [0] ) ] spids: [0] ) ] ) Line 1 of '' ls array=(a b c) ^~~~~~ Commands can't contain array literals Line 1 of '' array=(a b c) ls ^~~~~~ Environment bindings can't contain array literals (command.CommandList children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array spids:[0]) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [0] ) ] spids: [0] ) terminator: ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array2 spids:[10]) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(d)} {(e)} {(f)}])} spids: [10] ) ] spids: [10] ) ] ) (C {(ls)} {(foo)}) (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (command.AndOr ops:[Op_DPipe] children:[(C {(ls)} {(foo)}) (C {(die)})]) (command.AndOr ops: [Op_DPipe] children: [(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] ) (command.Case to_match:{(foo)} spids:[0 4 6]) (command.Case to_match: {(word)} arms: [ (case_arm pat_list: [{(foo)} {(foo2)} {(foo3)}] action: [(C {(echo)} {(hi)})] spids: [7 12 18 16777215] ) ] spids: [0 4 20] ) (command.Case to_match: {(word)} arms: [(case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(one-line)})] spids:[6 7 13 16777215])] spids: [0 4 15] ) (command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 16777215]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})] spids:[17 18 24 16777215]) ] spids: [0 4 26] ) (command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 16777215]) (case_arm pat_list: [{(bar)}] action: [(command.Sentence child:(C {(echo)} {(bar)}) terminator:)] spids: [20 21 16777215 29] ) ] spids: [0 4 29] ) (command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 16777215]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})] spids:[20 21 16777215 27]) ] spids: [0 4 27] ) (command.SimpleCommand words: [ (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:ls span_id:0))] ) (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:foo span_id:2))] ) ] ) (command.FuncDef name: func body: (command.BraceGroup children: [ (command.Sentence child: (command.SimpleCommand words: [ (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:echo span_id:6))] ) (word.CompoundWord parts: [(word_part.LiteralPart token:(token id:Lit_Chars val:hi span_id:8))] ) ] ) terminator: (token id:Op_Semi val:';' span_id:9) ) ] spids: [4] ) spids: [0 3] ) (C {(echo)} { (word_part.CommandSubPart command_list:..... (command.CommandList children:[(C {(echo)} {(12)})]) left_token: spids: [2 6] ) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(34)})]) left_token: spids: [7 11] ) } ) (C {(echo)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(12)})]) left_token: spids: [3 7] ) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(34)})]) left_token: spids: [8 12] ) ) } ) (command.CommandList children: [ (command.DBracket expr: (bool_expr.BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) ) ] ) (command.CommandList children: [ (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) right: (bool_expr.WordTest w:{(foo)}) ) ) ] ) (command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.DBracket expr: (bool_expr.BoolBinary op_id:BoolBinary_gt left:{($ VSub_Pound '$#')} right:{(1)}) ) ] action: [(C {(echo)} {(hi)})] spids: [16777215 12] ) ] spids: [16777215 19] ) ] ) (command.CommandList children: [ (command.DBracket expr: (bool_expr.BoolBinary op_id:BoolBinary_EqualTilde left:{(foo)} right:{(foo)}) ) ] ) (command.CommandList children: [ (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_EqualTilde left: {(foo)} right: {(Lit_Other '(') (foo) (Lit_Other '|') (bar) (Lit_Other ')')} ) ) ] ) (command.CommandList children: [ (command.DParen child: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) spids: [0 9] ) ] ) (command.CommandList children: [ (command.ForEach iter_name: i iter_words: [{(1)} {(2)} {(3)}] do_arg_iter: F body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})] spids:[13 20]) spids: [5 11] ) ] ) (command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: F body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})] spids:[8 15]) spids: [5 6] ) ] ) (command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: T body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] spids: [5 12] ) spids: [16777215 16777215] ) ] ) (command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: T body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})] spids:[4 11]) spids: [16777215 16777215] ) ] ) (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:i spids:[3]) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(lhs_expr.LhsName name:i spids:[14])) body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})] spids:[19 26]) ) ] ) (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAs.sign op_id: Arith_Equal left: (lhs_expr.LhsName name:i spids:[3]) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Arith_DPlus child:(lhs_expr.LhsName name:i spids:[14])) body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})] spids:[18 25]) ) ] ) (command.CommandList children: [ (command.ForExpr body: (command.DoGroup children:[(C {(echo)} {($ VSub_DollarName '$i')})] spids:[9 16]) ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [4] ) spids: [0 3] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) spids: [4 10] ) spids: [0 3] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] spids: [13 20] ) spids: [9 11] ) spids: [0 3] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [4] ) spids: [0 3] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [7] ) spids: [0 6] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) spids: [6 12] ) spids: [0 5] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] spids: [15 22] ) spids: [11 13] ) spids: [0 5] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ VSub_DollarName '$i')}) terminator: ) ] spids: [13 20] ) spids: [9 11] ) spids: [0 3] ) ] ) (command.CommandList children: [ (command.FuncDef name: foo body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [4] ) redirects: [ (redir.Redir op:&'> fd:1 arg_word:{(2)}) (redir.Redir op:'> fd:2 arg_word:{(/dev/null)}) ] spids: [0 .........3] ) ] ) (command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [(command.Sentence child:(C {(echo)} {(yes)}) terminator:)] spids: [16777215 5] ) ] spids: [16777215 12] ) ] ) (command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children:[(C {(true)})]) spids: [2 4] ) terminator: ) ] action: [(command.Sentence child:(C {(echo)} {(yes)}) terminator:)] spids: [16777215 7] ) ] spids: [16777215 14] ) ] ) (command.CommandList children:[(C {(ifFOO)})]) (C {(ls)} {(foo)}) (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (command.Pipeline children:[(C {(echo)} {(foo)}) (C {(grep)} {(foo)})] negated:T) (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)}) (C {(less)})] negated:F) Line 1 of '' ls foo| ^ Unexpected EOF while parsing command (command.CommandList children: [ (command.Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[1]) ] ) (command.CommandList children: [ (command.Pipeline children:[(C {(ls)}) (C {(cat)}) (C {(cat)})] negated:F stderr_indices:[0]) ] ) (command.CommandList children: [ (command.Pipeline children: [(C {(ls)}) (C {(cat)}) (C {(cat)})] negated: F stderr_indices: [0 1] ) ] ) (command.CommandList children: [ (C {(ls)} {(word_part.TildeSubPart token:)} {(word_part.TildeSubPart token:)} {(word_part.TildeSubPart token:) (/src)} {(word_part.TildeSubPart token:) (/src/foo)} {(word_part.TildeSubPart token:) (/src)} {(Lit_TildeLike '~weird') (KW_Bang '!') (name/blah) (KW_Bang '!') (blah)} ) ] ) (command.CommandList children: [ (command.WhileUntil keyword: cond: [(command.Sentence child:(C {(false)}) terminator:)] body: (command.DoGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] spids: [5 15] ) ) ] ) (command.CommandList children: [ (command.WhileUntil keyword: cond: [(command.Sentence child:(C {(true)}) terminator:)] body: (command.DoGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] spids: [5 15] ) ) ] ) (command.CommandList children: [ (command.WhileUntil keyword: cond: [(C {(true)})] body: (command.DoGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] spids: [7 26] ) ) ] ) (command.SimpleCommand words: [{(ls)} {(foo)}] redirects: [(redir.Redir op:'> fd:2 arg_word:{(/dev/null)})] ) (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (command.AndOr ops: [Op_DPipe] children: [(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] ) (command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)}) ] ) terminator: ) (C {(ls)} {(/)}) ] ) (command.CommandList children:[(C {(ls)} {(foo)})]) (command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ ............. (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)}) ] ) terminator: ) (C {(ls)} {(/)}) ] ) (command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(echo)} {(fail)}) ] ) terminator: ) (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children:[(C {(echo)} {(bar)}) (C {(wc)} {(-c)})] negated:F) (C {(echo)} {(f2)}) ] ) ] ) Line 1 of '' (( 1 + )) ^ Token can't be used in prefix position Line 1 of '' A= (1 2) ^ Expected ( after =, got ' ' Line 1 of '' [[ foo bar ]] ^~~ Expected ]] Line 1 of '' [[ foo -eq ]] ^ Expected ]] Line 1 of '' [[ foo$(echo <) -eq foo ]] ^ Invalid token after redirect operator Line 1 of '' ls < ^ Invalid token after redirect operator Line 1 of '' ls < < ^ Invalid token after redirect operator Line 1 of '' echo foo$(ls <)bar ^ Invalid token after redirect operator Line 1 of '' BAD_ENV=(1 2 3) ls ^~~~~~~~ Environment bindings can't contain array literals Line 1 of '' ls BAD_ENV=(1 2 3) ^~~~~~~~ Commands can't contain array literals Line 1 of '' ENV1=A ENV2=B local foo=bar ^~~~~ Assignments shouldn't have environment bindings Line 1 of '' for ((i=1; i<)); do echo $i; done ^ Token can't be used in prefix position Line 1 of '' for ((i=1; i<5; ++i)) OOPS echo $i; ERR ^~~~ Invalid word after for expression Line 1 of '' for ((i=1; i<5; ++i)); OOPS echo $i; ERR ^~~~ Expected word type KW_Do, got Word_Compound Line 1 of '' for $bad in 1 2; do echo hi; done ^~~~ Loop variable name should be a constant Line 1 of '' for foo BAD ^~~ Unexpected word after for loop variable Line 1 of '' if foo; then echo hi; z ^ Expected word type KW_Fi, got Eof_Real Line 1 of '' foo$(invalid) () { echo hi; } ^~~ Invalid function name Line 1 of '' foo="" echo "bar ^ Unexpected EOF reading double-quoted string that began here Line 1 of '' for x in 1 2 $( ^ Invalid word in for loop Line 1 of '' for ( i = 1; i < 10; i++ ) ^ Loop variable name should be a constant Line 1 of '' for = in a ^ Invalid loop variable name Line 1 of '' for x in 1 2 $(cat <' foo"bar" () { ^~~ Invalid function name Line 1 of '' x=1 >/dev/null ^~ Global assignment shouldn't have redirects Line 1 of '' echo hi; x=1 >/dev/null ^~ Global assignment shouldn't have redirects Line 1 of '' declare x=1 >/dev/null ^~~~~~~ Assignments shouldn't have redirects (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 17 stdin_parts: [ ('1 ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(2)}) (C {(echo)} {(3)})]) left_token: spids: [6 14] ) (' 4\n') ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc ...... op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(tac)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (command.SimpleCommand words: [{(tac)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] ) (command.Pipeline children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 12 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F ) (command.Pipeline children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F ) (command.CommandList children: [ (command.Sentence child: (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: ) (C {(echo)} {(hi)}) ] ) (command.CommandList children: [ (command.Sentence child: (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: ) (C {(echo)} {(hi)}) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('one tab then foo: ') ($ VSub_DollarName '$foo') ('\n')] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(DQ (EOF))} here_end_span_id: 9 stdin_parts: [('$v\n') ('"two\n')] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(SQ )} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EO) (word_part.EscapedLiteralPart token:)} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] ) (command.CommandList children: [ (command.Pipeline children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (command.SimpleCommand words: [{(tac)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] negated: F ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [($ VSub_DollarName '$v') ('\n') (Right_DoubleQuote '"') ('two\n')] ) ] ) (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) spids: [5 14] ) } ) ] ) left_token: spids: [2 16] ) } ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) spids: [3 12] ) } ) ] ) spids: [0 14] ) ] ) (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) spids: [5 10] ) } ) ] ) left_token: spids: [2 11] ) } ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) spids: [3 8] ) } ) ] ) spids: [0 9] ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Assignment keyword: Assign_None ... pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array spids:[3]) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [3] ) ] spids: [3] ) ] ) left_token: spids: [2 11] ) } ) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:array spids:[1]) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{(a)} {(b)} {(c)}])} spids: [1] ) ] spids: [1] ) ] ) spids: [0 9] ) ] ) (command.CommandList children: [ (C { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 11 17 16777215] ) ] spids: [2 6 20] ) ] ) left_token: spids: [0 22] ) } ) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 11 17 16777215] ) ] spids: [2 6 20] ) ] ) spids: [0 22] ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(comsub)})] spids: [10 11 16 16777215] ) ] spids: [4 8 18] ) ] ) left_token: spids: [2 19] ) } ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(comsub1)})] spids: [10 11 16 16777215] ) ] spids: [4 8 18] ) (command.Case to_match: {(bar)} arms: [ (case_arm pat_list: [{(two)}] action: [(C {(echo)} {(comsub2)})] spids: [26 27 32 16777215] ) ] spids: [20 24 34] ) ] ) left_token: spids: [2 36] ) } ) ] ) (C {(echo)} { (DQ ('double ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) left_token: spids: [4 8] ) (' quoted') ) } {(two)} ) (command.CommandList children: [ (command.Sentence child:(C {(echo)} {(one)}) terminator:) (command.Sentence child: (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(one)} arms: [ (case_arm pat_list: [ { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(one)})]) left_token: spids: [15 19] ) } ] action: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(comsub)})]) left_token: spids: [24 26] ) } ) ] spids: [15 20 27 16777215] ) ] spids: [9 13 29] ) ] ) left_token: spids: [7 31] ) } ) terminator: ) (C {(echo)} {(two)}) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children:[(command.Case to_match:{(foo)} spids:[2 6 9])]) spids: [0 11] ) ] ) (command.CommandList children: [ (C { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:i spids:[5]) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id: Arith_DPlus child: (lhs_expr.LhsName name:i spids:[16]) ) body: (command.DoGroup children:[(C {(echo)} {(hi)})] spids:[21 29]) ) ] ) left_token: spids: [0 31] ) } ) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:i spids:[5]) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.ArithBinary op_id: Arith_Less left: (arith_expr.ArithVarRef token:) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id: Arith_DPlus child: (lhs_expr.LhsName name:i spids:[16]) ) body: (command.DoGroup childr......en:[(C {(echo)} {(hi)})] spids:[21 29]) ) ] ) spids: [0 31] ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Sentence child: (command.FuncDef name: func body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: ) ] spids: [7] ) spids: [3 6] ) terminator: ) (C {(func)}) ] ) left_token: spids: [2 18] ) } ) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (command.FuncDef name: func body: (command.BraceGroup children: [(command.Sentence child:(C {(echo)} {(hi)}) terminator:)] spids: [5] ) spids: [1 4] ) terminator: ) (C {(func)}) ] ) spids: [0 16] ) ] ) (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsIndexedName name: a index: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Lit_Digits 3)}) ) ) ) right: (arith_expr.ArithVarRef token:) ) spids: [2 16] ) } ) (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(one) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(two)})]) left_token: spids: [4 8] ) (one) } ) ] ) left_token: spids: [2 10] ) } {(three)} ) (command.BraceGroup children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:) (command.Sentence child:(C {(echo)} {(PWD)}) terminator:) ] spids: [0] ) (command.CommandList children: [ (command.Sentence child: (command.BraceGroup children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:) (command.Sentence child:(C {(echo)} {(PWD)}) terminator:) ] spids: [0] ) terminator: ) (C {(echo)} {(PWD)}) ] ) (command.CommandList children: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:) (C {(echo)} {(PWD)} {(1)}) ] ) spids: [0 11] ) terminator: ) (C {(echo)} {(PWD)} {(2)}) ] ) (command.CommandLi....st children: [ (command.Sentence child:(C {(echo)} {(one)}) terminator:) (command.Sentence child: (C {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (C {(cd)} {(/)}) terminator: ) (C {(echo)} {(subshell_PWD)}) ] ) spids: [9 18] ) terminator: ) (C {(echo)} {(comsub_PWD)}) ] ) left_token: spids: [7 24] ) } ) terminator: ) (C {(echo)} {(two)}) ] ) (command.CommandList children: [ (C { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 10 16 16777215] ) ] spids: [2 6 19] ) ] ) left_token: spids: [0 21] ) } ) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 10 16 16777215] ) ] spids: [2 6 19] ) ] ) spids: [0 21] ) ] ) (C {(echo)} {(ab) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) left_token: spids: [3 7] ) (cd) } {(ef)} ) (command.CommandList children: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolUnary op_id: BoolUnary_n child: { (DQ (word_part.BracedVarSub token: bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {(${ VSub_Name tag_marker) (Lit_Digits 002) (${ VSub_Name cons_ptr)} ) ) spids: [7 18] ) ) } ) ) terminator: ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.ArithSubPart anode: (arith_expr.ArithWord w: {(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_DollarName '$foo')} ) spids: [3 10] ) } ) ] ) Line 1 of '' errcmd=( "${SETUP_STATE[$err.cmd]}" ) ^ Unexpected token in arithmetic context (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:errcmd spids:[1]) op: Equal rhs:.... { (word_part.ArrayLiteralPart words: [ { (DQ (word_part.BracedVarSub token: bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ ($ VSub_DollarName '$err') (.cmd))}) ) spids: [5 13] ) ) } ] ) } spids: [1] ) ] spids: [1] ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.NoOp) left_token: spids: [2 3] ) } ) ] ) (command.CommandList children: [ (C {(echo)} { (word_part.CommandSubPart command_list: (command.NoOp) left_token: spids: [2 4] ) } ) ] ) (command.CommandList children: [ (C {(cmd)} {(flag)} { (word_part.CommandSubPart command_list: (command.NoOp) left_token: spids: [4 9] ) } {(flag2)} ) ] ) (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:FOO spids:[0]) op: Equal rhs: {(DQ (bar)) (word_part.CommandSubPart command_list: (command.NoOp) left_token: spids: [4 10] ) (DQ (baz)) } spids: [0] ) ] spids: [0] ) ] ) (command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [ (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) spids: [7 14] ) ] spids: [16777215 5] ) ] spids: [16777215 16] ) ] ) (command.CommandList children: [ (command.WhileUntil keyword: cond: [(command.Sentence child:(C {(true)}) terminator:)] body: (command.DoGroup children: [ (command.BraceGroup children: [(C {(echo)} {(hi)}) (command.ControlFlow token:)] spids: [7] ) ] spids: [5 19] ) ) ] ) (command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [ (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) spids: [7 14] ) ] spids: [16777215 5] ) ] spids: [16777215 16] ) ] ) (command.CommandList children: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [ (command.If arms: [ (if_arm cond: [(command.Sentence child:(C {(true)}) terminator:)] action: [(C {(echo)} {(hi)})] spids: [16777215 13] ) ] spids: [16777215 21] ) ] spids: [16777215 5] ) ] spids: [16777215 23] ) (C {(echo)} {(hi)}) ] ) (command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_DollarName ........'$PACKDIR'))}) (command.ForEach iter_name: e iter_words: [{($ VSub_DollarName '$existing')}] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ (' ') ($ VSub_DollarName '$fullbases') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (DQ (' ') ($ VSub_DollarName '$e') (' ')) (Lit_Other '*') } ] spids: [34 41 43 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$e') (.pack))} {(DQ ($ VSub_DollarName '$e') (.idx))} {(DQ ($ VSub_DollarName '$e') (.keep))} ) ] spids: [46 47 68 16777215] ) ] spids: [23 31 71] ) ] spids: [20 74] ) spids: [16 16777215] ) ] ) ] ) spids: [0 76] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(.)} {(DQ ($ VSub_DollarName '$TEST_DIRECTORY')) (/diff-lib.sh)}) terminator: ) ] ) (command.CommandList children:[(C {(echo)} {(foo) (Lit_Pound '#') (bar)})]) (command.CommandList children:[(C {(echo)} {(foo)})]) (command.CommandList children:[(C {(echo)} {(foo)})]) (command.Case to_match: {(DQ ($ VSub_DollarName '$fd') (',') ($ VSub_DollarName '$command'))} arms: [ (case_arm pat_list: [{(3) (Lit_Comma ',') (Lit_Pound '#') (Lit_Other '*')} {(3) (Lit_Comma ',')}] spids: [11 18 25 16777215] ) ] spids: [0 8 27] ) (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [ { (word_part.SingleQuotedPart left: tokens: [] spids: [7 9] ) } ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ret spids:[13]) op: PlusEqual rhs: {(DQ (word_part.EscapedLiteralPart token:)) (word_part.EscapedLiteralPart token: ) } spids: [13] ) ] spids: [13] ) ] spids: [7 10 20 16777215] ) ] spids: [1 5 22] ) ] ) (command.CommandList children: [ (C { (word_part.SingleQuotedPart left: tokens: [ ] spids: [1 5] ) } ) ] ) (command.SimpleCommand words: [{(echo)} {(hi)}] redirects: [(redir.Redir op:|'> fd:16777215 arg_word:{(clobbered.txt)})] ) (redir.Redir op:&'> fd:1 arg_word:{(2)}) (redir.HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None) (redir.HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: ............. ---------------------------------------------------------------------- Ran 83 tests in 0.194s OK fd: 16777215 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('hi\n')] ) (redir.Redir op:'> fd:16777215 arg_word:{(out.txt)}) ] ) (redir.Redir op:'> fd:16777215 arg_word:{(out.txt)}) (redir.HereDoc op: fd:16777215 here_begin:{(EOF)} here_end_span_id:None) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:'> fd:16777215 arg_word:{(out.txt)}) (redir.Redir op:&'> fd:1 arg_word:{(2)}) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [(redir.Redir op: fd:16777215 arg_word:{(3)})] ) (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:ONE spids:[0]) op:Equal rhs:{(1)} spids:[0]) (assign_pair lhs:(lhs_expr.LhsName name:TWO spids:[3]) op:Equal rhs:{(2)} spids:[3]) ] spids: [0] ) ] ) (command.CommandList children: [ (command.SimpleCommand redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] ) (C {(echo)} {(DQ (one)) (two)} {(DQ (three)) (DQ (four))} {(five)}) (command.CommandList children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:foo spids:[2]) op: Equal rhs: {(bar)} spids: [2] ) (assign_pair lhs:(lhs_expr.LhsName name:spam spids:[5]) op:Equal spids:[5]) (assign_pair lhs:(lhs_expr.LhsName name:eggs spids:[7]) op:Equal spids:[7]) (assign_pair lhs:(lhs_expr.LhsName name:one spids:[9]) op:Equal rhs:{(1)} spids:[9]) ] spids: [0] ) ] ) (command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:foo spids:[0]) op:Equal rhs:{(bar)} spids:[0])] spids: [0] ) ] ) Line 1 of '' FOO=bar local foo=$(env) ^~~~ Assignments shouldn't have environment bindings (command.CommandList children: [ (command.SimpleCommand words: [{(env)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] more_env: [(env_pair name:PYTHONPATH val:{(.)} spids:[3])] ) ] ) (command.CommandList children: [ (command.SimpleCommand words: [{(echo)} {(1)} {(2)} {(3)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(out.txt)})] ) ] ) (C {(ls)} {(foo)}) (command.SimpleCommand words:[{(ls)} {(foo)}] more_env:[(env_pair name:FOO val:{(bar)} spids:[0])]) (command.SimpleCommand words: [{(ls)} {(foo)}] redirects: [(redir.Redir op:'> fd:16777215 arg_word:{(output.txt)})] more_env: [(env_pair name:FOO val:{(bar)} spids:[0]) (env_pair name:SPAM val:{(eggs)} spids:[6])] ) (command.SimpleCommand words: [{(ls)} {(foo)}] redirects: [ (redir.Redir op:'> fd:16777215 arg_word:{(output.txt)}) (redir.Redir op:'> fd:16777215 arg_word:{(output2.txt)}) ] more_env: [(env_pair name:FOO val:{(bar)} spids:[0]) (env_pair name:SPAM val:{(eggs)} spids:[6])] ) (command.CommandList children: [ (command.Assignment keyword: Assign_Readonly pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:ONE spids:[2]) op:Equal rhs:{(1)} spids:[2]) (assign_pair lhs:(lhs_expr.LhsName name:TWO spids:[5]) op:Equal rhs:{(2)} spids:[5]) (assign_pair lhs:(lhs_expr.LhsName name:THREE spids:[8]) op:Equal spids:[8]) ] spids: [0] ) ] )