array=(a b c) ls ^~~~~~ :1: Environment bindings can't contain array literals ....(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:empty) op: assign_op.Equal rhs: {(sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:1))} spids: [0] ) ] ) ] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:1) words: [{(a)} {(b)} {(c)}] ) } spids: [0] ) ] ) ] )(command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:1) words: [{(a)} {(b)} {(c)}] ) } spids: [0] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:8) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array2) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:11) words: [{(d)} {(e)} {(f)}] ) } spids: [10] ) ] ) ] )(C {(ls)} {(foo)})(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F)(command.AndOr ops:[Id.Op_DPipe] children:[(C {(ls)} {(foo)}) (C {(die)})])(command.AndOr ops: [Id.Op_DPipe] children: [(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)})] )(command.Case to_match:{(foo)})(command.Case to_match: {(word)} arms: [ (case_arm pat_list: [{(foo)} {(foo2)} {(foo3)}] action: [(C {(echo)} {(hi)})] spids: [7 12 18 -1] ) ] )(command.Case to_match: {(word)} arms: [(case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(one-line)})] spids:[6 7 13 -1])] )(command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 -1]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})] spids:[17 18 24 -1]) ] )(command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 -1]) (case_arm pat_list: [{(bar)}] action: [ (command.Sentence child: (C {(echo)} {(bar)}) terminator: (Token id:Id.Op_Semi val:';' span_id:27) ) ] spids: [20 21 -1 29] ) ] )(command.Case to_match: {(word)} arms: [ (case_arm pat_list:[{(foo)}] action:[(C {(echo)} {(foo)})] spids:[7 8 14 -1]) (case_arm pat_list:[{(bar)}] action:[(C {(echo)} {(bar)})] spids:[20 21 -1 27]) ] )(command.Simple words: [ (compound_word parts:[(word_part.Literal token:(Token id:Id.Lit_Chars val:ls span_id:0))]) (compound_word parts:[(word_part.Literal token:(Token id:Id.Lit_Chars val:foo span_id:2))]) ] ) (command.ShFunction name: fun body: (command.BraceGroup children: [ (command.Sentence child: (command.Simple words: [ (compound_word parts: [(word_part.Literal token:(Token id:Id.Lit_Chars val:echo span_id:6))] ) (compound_word parts: [(word_part.Literal token:(Token id:Id.Lit_Chars val:hi span_id:8))] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:9) ) ] spids: [4] ) spids: [0 3] ) (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_li.....st: (command.CommandList children:[(C {(echo)} {(12)})]) ) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7) command_list: (command.CommandList children:[(C {(echo)} {(34)})]) ) } )(C {(echo)} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:3) command_list: (command.CommandList children:[(C {(echo)} {(12)})]) ) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8) command_list: (command.CommandList children:[(C {(echo)} {(34)})]) ) ) } )(command.CommandList children: [ (command.DBracket expr: (bool_expr.Binary op_id:Id.BoolBinary_gt left:{($ Id.VSub_Pound '$#')} right:{(1)}) ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id:Id.BoolBinary_gt left:{($ Id.VSub_Pound '$#')} right:{(1)}) right: (bool_expr.WordTest w:{(foo)}) ) ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.DBracket expr: (bool_expr.Binary op_id:Id.BoolBinary_gt left:{($ Id.VSub_Pound '$#')} right:{(1)}) ) ] action: [(C {(echo)} {(hi)})] spids: [0 12] ) ] ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.Binary op_id:Id.BoolBinary_EqualTilde left:{(foo)} right:{(foo)}) ) ] )(command.CommandList children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: {(foo)} right: {(Id.Lit_Other '(') (foo) (Id.Lit_Other '|') (bar) (Id.Lit_Other ')')} ) ) ] )(command.CommandList children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) ) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i iter_words: [{(1)} {(2)} {(3)}] do_arg_iter: F body: (command.DoGroup children:[(C {(echo)} {($ Id.VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: F body: (command.DoGroup children:[(C {(echo)} {($ Id.VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: T body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ Id.VSub_DollarName '$i')}) terminator: (Token id:Id.Op_Semi val:';' span_id:10) ) ] ) ) ] )(command.CommandList children: [ (command.ForEach iter_name: i do_arg_iter: T body: (command.DoGroup children:[(C {(echo)} {($ Id.VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:8)) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Id.Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {($ Id.VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef t..oken:(Token id:Id.Lit_ArithVarLike val:i span_id:8)) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) update: (arith_expr.UnaryAssign op_id:Id.Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {($ Id.VSub_DollarName '$i')})]) ) ] )(command.CommandList children: [ (command.ForExpr body:(command.DoGroup children:[(C {(echo)} {($ Id.VSub_DollarName '$i')})])) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: (Token id:Id.Op_Semi val:';' span_id:9) ) ] ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.Subshell command_list:(command.CommandList children:[(C {(echo)} {(hi)})])) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ Id.VSub_DollarName '$i')}) terminator: (Token id:Id.Op_Semi val:';' span_id:18) ) ] ) ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: (Token id:Id.Op_Semi val:';' span_id:9) ) ] ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: (Token id:Id.Op_Semi val:';' span_id:12) ) ] ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.Subshell command_list:(command.CommandList children:[(C {(echo)} {(hi)})])) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ Id.VSub_DollarName '$i')}) terminator: (Token id:Id.Op_Semi val:';' span_id:20) ) ] ) ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.ForEach iter_name: i iter_words: [{(x)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {($ Id.VSub_DollarName '$i')}) terminator: (Token id:Id.Op_Semi val:';' span_id:18) ) ] ) ) ) ] )(command.CommandList children: [ (command.ShFunction name: foo body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: (Token id:Id.Op_Semi val:';' span_id:9) ) ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'1>&' span_id:13) fd: 1 arg_word: {(2)} ) (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:16) fd: 2 arg_word: {(/dev/null)} ) ] ) ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Se.. ls foo| ^ :1: Unexpected EOF while parsing command .....ntence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3) ) ] action: [ (command.Sentence child: (C {(echo)} {(yes)}) terminator: (Token id:Id.Op_Semi val:';' span_id:10) ) ] spids: [0 5] ) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Subshell command_list:(command.CommandList children:[(C {(true)})])) terminator: (Token id:Id.Op_Semi val:';' span_id:5) ) ] action: [ (command.Sentence child: (C {(echo)} {(yes)}) terminator: (Token id:Id.Op_Semi val:';' span_id:12) ) ] spids: [0 7] ) ] ) ] )(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)(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.TildeSub token:(Token id:Id.Lit_TildeLike val:'~' span_id:2))} {(word_part.TildeSub token:(Token id:Id.Lit_TildeLike val:'~root' span_id:4))} {(word_part.TildeSub token:(Token id:Id.Lit_TildeLike val:'~' span_id:6)) (/src)} {(word_part.TildeSub token:(Token id:Id.Lit_TildeLike val:'~' span_id:9)) (/src/foo)} {(word_part.TildeSub token:(Token id:Id.Lit_TildeLike val:'~root' span_id:12)) (/src)} {(Id.Lit_TildeLike '~weird') (Id.KW_Bang '!') (name/blah) (Id.KW_Bang '!') (blah)} ) ] )(command.CommandList children: [ (command.WhileUntil keyword: (Token id:Id.KW_Until val:until span_id:0) cond: [(command.Sentence child:(C {(false)}) terminator:(Token id:Id.Op_Semi val:';' span_id:3))] body: (command.DoGroup children: [ (C {(echo)} {(hi)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:13) ) ] ) ) ] )(command.CommandList children: [ (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:0) cond: [(command.Sentence child:(C {(true)}) terminator:(Token id:Id.Op_Semi val:';' span_id:3))] body: (command.DoGroup children: [ (C {(echo)} {(hi)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:13) ) ] ) ) ] )(command.CommandList children: [ (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:0) cond: [(C {(true)})] body: (command.DoGroup children: [ (C {(echo)} {(hi)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:21) ) ] ) ) ] )(command.Simple words: [{(ls)} {(foo)}] redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'2>' span_id:4) fd:2 arg_word:{(/dev/null)})] )(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F)(command.AndOr ops: [Id.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: [Id.Op_DPipe] children: [ .. (( 1 + )) ^ :1: Token can't be used in prefix position . A= (1 2) ^ :1: Expected ( after =, got ' ' . [[ foo bar ]] ^~~ :1: Expected ]] [[ foo -eq ]] ^ :1: Expected ]] [[ foo$(echo <) -eq foo ]] ^ :1: Invalid token after redirect operator . ls < ^ :1: Invalid token after redirect operator ls < < ^ :1: Invalid token after redirect operator echo foo$(ls <)bar ^ :1: Invalid token after redirect operator BAD_ENV=(1 2 3) ls ^~~~~~~~ :1: Environment bindings can't contain array literals for ((i=1; i<)); do echo $i; done ^ :1: Token can't be used in prefix position for ((i=1; i<5; ++i)) OOPS echo $i; ERR ^~~~ :1: Invalid word after for expression for ((i=1; i<5; ++i)); OOPS echo $i; ERR ^~~~ :1: Expected word type Id.KW_Do, got Id.Word_Compound for $bad in 1 2; do echo hi; done ^~~~ :1: Loop variable name should be a constant for foo BAD ^~~ :1: Unexpected word after for loop variable if foo; then echo hi; z ^ :1: Expected word type Id.KW_Fi, got Id.Eof_Real foo$(invalid) () { echo hi; } ^~~ :1: Invalid function name . foo="" echo "bar ^ :1: Unexpected EOF reading double-quoted string that began here .. for x in 1 2 $( ^ :1: Invalid word in for loop . for [ i = 1; i < 10; i++ ] ^ :1: Invalid loop variable name for = in a ^ :1: Invalid loop variable name . for x in 1 2 $(cat <:1: Couldn't find terminator for here doc that starts here . foo"bar" () { ^~~ :1: Invalid function name ....(command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:11) ) (C {(ls)} {(/)}) ] )(command.CommandList children:[(C {(ls)} {(foo)})])(command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(die)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:11) ) (C {(ls)} {(/)}) ] )(command.CommandList children: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children:[(C {(ls)} {(foo)}) (C {(wc)} {(-l)})] negated:F) (C {(echo)} {(fail)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:16) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children:[(C {(echo)} {(bar)}) (C {(wc)} {(-c)})] negated:F) (C {(echo)} {(f2)}) ] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_id: 17 stdin_parts: [ ('1 ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:6) command_list: (command.CommandList children:[(C {(echo)} {(2)}) (C {(echo)} {(3)})]) ) (' 4\n') ] ) ] )(command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] )(command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(echo)} {(hi)}) ] )(command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{(tac)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (command.Simple words: [{(tac)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:9) fd: -1 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] )(command.Pipeline children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_id: 12 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) (C {(tac)}) ] negated: F )(command.Pipeline children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 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.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_......id: 10 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:5) ) (C {(echo)} {(hi)}) ] )(command.CommandList children: [ (command.Sentence child: (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_id: 14 stdin_parts: [('PIPE 1\n') ('PIPE 2\n')] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:5) ) (C {(echo)} {(hi)}) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:3) fd: -1 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('one tab then foo: ') ($ Id.VSub_DollarName '$foo') ('\n')] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(DQ (EOF))} here_end_span_id: 9 stdin_parts: [('$v\n') ('"two\n')] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:4))} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:3) fd: -1 here_begin: {(EO) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\F' span_id:5))} here_end_span_id: 8 stdin_parts: [('single-quoted: $var\n')] ) ] )(command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF1)} here_end_span_id: 15 stdin_parts: [('PIPE A1\n') ('PIPE A2\n')] ) ] ) (command.Simple words: [{(tac)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:9) fd: -1 here_begin: {(EOF2)} here_end_span_id: 19 stdin_parts: [('PIPE B1\n') ('PIPE B2\n')] ) ] ) ] negated: F ) ] )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2) fd: -1 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [($ Id.VSub_DollarName '$v') ('\n') (Id.Right_DoubleQuote '"') ('two\n')] ) ] )(C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 3)}) ) ) ) } ) ] ) ) } )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: ...Id.Arith_Star left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 3)}) ) ) ) } ) ] ) ) ] )(C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) ) ) } ) ] ) ) } )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) ) ) } ) ] ) ) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:4) words: [{(a)} {(b)} {(c)}] ) } spids: [3] ) ] ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:array) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2) words: [{(a)} {(b)} {(c)}] ) } spids: [1] ) ] ) ] ) ) ] )(command.CommandList children: [ (C { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:0) command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 11 17 -1] ) ] ) ] ) ) } ) ] )(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 -1])] ..... ) ] ) ) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(comsub)})] spids: [10 11 16 -1] ) ] ) ] ) ) } ) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(comsub1)})] spids: [10 11 16 -1] ) ] ) (command.Case to_match: {(bar)} arms: [ (case_arm pat_list: [{(two)}] action: [(C {(echo)} {(comsub2)})] spids: [26 27 32 -1] ) ] ) ] ) ) } ) ] )(C {(echo)} { (DQ ('double ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:4) command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) (' quoted') ) } {(two)} )(command.CommandList children: [ (command.Sentence child: (C {(echo)} {(one)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3) ) (command.Sentence child: (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7) command_list: (command.CommandList children: [ (command.Case to_match: {(one)} arms: [ (case_arm pat_list: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:15) command_list: (command.CommandList children:[(C {(echo)} {(one)})]) ) } ] action: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:24) command_list: (command.CommandList children:[(C {(comsub)})]) ) } ) ] spids: [15 20 27 -1] ) ] ) ] ) ) } ) terminator: (Token id:Id.Op_Semi val:';' span_id:32) ) (C {(echo)} {(two)}) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children:[(command.Case to_match:{(foo)})]) ) ] )(command.CommandList children: [ (C { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:0) command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal .... left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:10)) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id: Id.Arith_DPlus child: (sh_lhs_expr.Name name:i) ) body: (command.DoGroup children:[(C {(echo)} {(hi)})]) ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:10)) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 3)}) ) update: (arith_expr.UnaryAssign op_id:Id.Arith_DPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children:[(C {(echo)} {(hi)})]) ) ] ) ) ] )(C {(echo)} { (word_part.ArithSub anode: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.IndexedName name: a index: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 3)}) ) ) ) right: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:x span_id:14)) ) ) } )(C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (C {(one) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:4) command_list: (command.CommandList children:[(C {(echo)} {(two)})]) ) (one) } ) ] ) ) } {(three)} )(command.BraceGroup children: [ (command.Sentence child:(C {(cd)} {(/)}) terminator:(Token id:Id.Op_Semi val:';' span_id:5)) (command.Sentence child: (C {(echo)} {(PWD)}) terminator: (Token id:Id.Op_Semi val:';' span_id:10) ) ] )(command.CommandList children: [ (command.Sentence child: (command.BraceGroup children: [ (command.Sentence child: (C {(cd)} {(/)}) terminator: (Token id:Id.Op_Semi val:';' span_id:5) ) (command.Sentence child: (C {(echo)} {(PWD)}) terminator: (Token id:Id.Op_Semi val:';' span_id:10) ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:13) ) (C {(echo)} {(PWD)}) ] )(command.CommandList children: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (C {(cd)} {(/)}) terminator: (Token id:Id.Op_Semi val:';' span_id:4...) ) (C {(echo)} {(PWD)} {(1)}) ] ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:12) ) (C {(echo)} {(PWD)} {(2)}) ] )(command.CommandList children: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list: (command.CommandList children: [ (command.Sentence child: (command.ShFunction name: fun body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: (Token id:Id.Op_Semi val:';' span_id:12) ) ] ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:15) ) (C {(fun)}) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (command.ShFunction name: fun body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(hi)}) terminator: (Token id:Id.Op_Semi val:';' span_id:10) ) ] ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:13) ) (C {(fun)}) ] ) ) ] )(command.CommandList children: [ (command.Sentence child: (C {(echo)} {(one)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3) ) (command.Sentence child: (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7) command_list: (command.CommandList children: [ (command.Sentence child: (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (C {(cd)} {(/)}) terminator: (Token id:Id.Op_Semi val:';' span_id:13) ) (C {(echo)} {(subshell_PWD)}) ] ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:19) ) (C {(echo)} {(comsub_PWD)}) ] ) ) } ) terminator: (Token id:Id.Op_Semi val:';' span_id:25) ) (C {(echo)} {(two)}) ] )(command.CommandList children: [ (C { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:0) command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [{(one)}] action: [(C {(echo)} {(hi)})] spids: [9 10 16 -1] ) ] ) ] ) ) } ) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Case to_match: {(foo)} arms: [(case_arm pat_list:[{(one)}] ... errcmd=( "${SETUP_STATE[$err.cmd]}" ) ^ :1: Unexpected token in arithmetic context ...action:[(C {(echo)} {(hi)})] spids:[9 10 16 -1])] ) ] ) ) ] )(C {(echo)} {(ab) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:3) command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) (cd) } {(ef)} )(command.CommandList children: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:marks span_id:8) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {(${ Id.VSub_Name tag_marker) (Id.Lit_Digits 002) (${ Id.VSub_Name cons_ptr) } ) ) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:22) ) ] )(command.CommandList children: [ (C {(echo)} { (word_part.ArithSub anode: (arith_expr.ArithWord w: {(Id.Lit_Digits 0) (Id.Lit_ArithVarLike x) ($ Id.VSub_DollarName '$foo')} ) ) } ) ] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:errcmd) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2) words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:SETUP_STATE span_id:6) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ ($ Id.VSub_DollarName '$err') (.cmd))}) ) ) ) } ] ) } spids: [1] ) ] ) ] )(command.CommandList children: [(C {(echo)} {(command_sub left_token:(Token id:Id.Left_DollarParen val:'$(' span_id:2) command_list:(command.NoOp))})] )(command.CommandList children: [(C {(echo)} {(command_sub left_token:(Token id:Id.Left_Backtick val:'`' span_id:2) command_list:(command.NoOp))})] )(command.CommandList children: [ (C {(cmd)} {(flag)} {(command_sub left_token:(Token id:Id.Left_Backtick val:'`' span_id:4) command_list:(command.NoOp))} {(flag2)} ) ] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FOO) op: assign_op.Equal rhs: {(DQ (bar)) (command_sub left_token:(Token id:Id.Left_Backtick val:'`' span_id:4) command_list:(command.NoOp)) (DQ (baz)) } spids: [0] ) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3) ) ] action: [ (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) ] spids: [0 5] ) ] ) ] )(command.CommandList children: [ (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:0) cond: [(command.Sentence child:(C {(true)}) terminator:(Token id:Id.Op_Semi val:';' span_id:3))] body: (command.DoGroup children: [ (command.BraceGroup children: [ (C {(e....cho)} {(hi)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:15) ) ] ) ] ) ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3) ) ] action: [ (command.Subshell command_list: (command.CommandList children:[(C {(echo)} {(hi)})]) ) ] spids: [0 5] ) ] ) ] )(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:11) ) ] action: [(C {(echo)} {(hi)})] spids: [8 13] ) ] ) ] spids: [0 5] ) ] ) (C {(echo)} {(hi)}) ] )(command.CommandList children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(cd)} {(DQ ($ Id.VSub_DollarName '$PACKDIR'))}) (command.ForEach iter_name: e iter_words: [{($ Id.VSub_DollarName '$existing')}] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ (' ') ($ Id.VSub_DollarName '$fullbases') (' '))} arms: [ (case_arm pat_list: [ {(Id.Lit_Star '*') (DQ (' ') ($ Id.VSub_DollarName '$e') (' ')) (Id.Lit_Star '*') } ] spids: [34 41 43 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$e') (.pack))} {(DQ ($ Id.VSub_DollarName '$e') (.idx))} {(DQ ($ Id.VSub_DollarName '$e') (.keep))} ) ] spids: [46 47 68 -1] ) ] ) ] ) ) ] ) ] ) ) ] )(command.CommandList children: [ (command.Sentence child: (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/diff-lib.sh)}) terminator: (Token id:Id.Op_Semi val:';' span_id:7) ) ] )(command.CommandList children:[(C {(echo)} {(foo) (Id.Lit_Pound '#') (bar)})])(command.CommandList children:[(C {(echo)} {(foo)})])(command.CommandList children:[(C {(echo)} {(foo)})])(command.Case to_match: {(DQ ($ Id.VSub_DollarName '$fd') (',') ($ Id.VSub_DollarName '$command'))} arms: [ (case_arm pat_list: [{(3) (Id.Lit_Comma ',') (Id.Lit_Pound '#') (Id.Lit_Star '*')} {(3) (Id.Lit_Comma ',')}] spids: [11 18 25 -1] ) ] )(command.CommandList children: [ (command.Case to_match: {(foo)} arms: [ (case_arm pat_list: [ { (single_quoted left: (Token id:Id.L..............eft_SingleQuoteC val:"$'" span_id:7) tokens: [(Token id:Id.Char_OneChar val:"\\'" span_id:8)] ) } ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.PlusEqual rhs: { (DQ (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\\\' span_id:15) ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:17)) } spids: [13] ) ] ) ] spids: [7 10 20 -1] ) ] ) ] )(command.CommandList children: [ (C { (single_quoted left: (Token id:Id.Left_SingleQuoteC val:"$'" span_id:1) tokens: [ (Token id:Id.Char_Literals val:abc span_id:2) (Token id:Id.Char_OneChar val:'\\n' span_id:3) (Token id:Id.Char_Literals val:def span_id:4) ] ) } ) ] )(command.Simple words: [{(echo)} {(hi)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Clobber val:'>|' span_id:4) fd: -1 arg_word: {(clobbered.txt)} ) ] )(redir.Redir op:(Token id:Id.Redir_GreatAnd val:'1>&' span_id:0) fd:1 arg_word:{(2)})(redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:0) fd: -1 here_begin: {(EOF)} here_end_span_id: None )(redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:0) fd: -1 here_begin: {(EOF)} here_end_span_id: None )(command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:0) fd: -1 here_begin: {(EOF)} here_end_span_id: 10 stdin_parts: [('hi\n')] ) (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:3) fd:-1 arg_word:{(out.txt)}) ] )(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:0) fd:-1 arg_word:{(out.txt)})(redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:0) fd: -1 here_begin: {(EOF)} here_end_span_id: None )(command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:0) fd:-1 arg_word:{(out.txt)}) (redir.Redir op:(Token id:Id.Redir_GreatAnd val:'1>&' span_id:5) fd:1 arg_word:{(2)}) ] )(command.Simple words: [{(cat)}] redirects: [(redir.Redir op:(Token id:Id.Redir_LessAnd val:'<&' span_id:3) fd:-1 arg_word:{(3)})] )(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs:(sh_lhs_expr.Name name:ONE) op:assign_op.Equal rhs:{(1)} spids:[0]) (assign_pair lhs:(sh_lhs_expr.Name name:TWO) op:assign_op.Equal rhs:{(2)} spids:[3]) ] ) ] )(command.CommandList children: [ (command.Simple redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:0) fd:-1 arg_word:{(out.txt)}) ] ) ] )(C {(echo)} {(DQ (one)) (two)} {(DQ (three)) (DQ (four))} {(five)})(command.CommandList children: [ (command.Simple words: [{(env)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:0) fd:-1 arg_word:{(out.txt)}) ] more_env: [(env_pair name:PYTHONPATH val:{(.)} spids:[3])] ) ] )(command.CommandList children: [ (command.Simple words: [{(echo)} {(1)} {(2)} {(3)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:2) fd:-1 arg_word:{(out.txt)}) ] ) ] )(C {(ls)} {(foo)})(command.Simple words:[{(ls)} {(foo)}] more_env:[(env_pair name:FOO val:{(bar)} spids:[0])])(command.Simple words: [{(ls)} {(foo)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:3) fd:-1 arg_word:{(output.txt)}) ] more_env: [(env_pair name:FOO val:{(bar)} spids:[0]) (env_pair name:SPAM val:{(eggs)} spids:[6])] )(command.Si. ---------------------------------------------------------------------- Ran 79 tests in 0.088s OK mple words: [{(ls)} {(foo)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:3) fd:-1 arg_word:{(output.txt)}) (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:13) fd:-1 arg_word:{(output2.txt)}) ] more_env: [(env_pair name:FOO val:{(bar)} spids:[0]) (env_pair name:SPAM val:{(eggs)} spids:[6])] )