===== CASE: FOO=1 break ===== FOO=1 break ^~~~ [ -c flag ]:1: Control flow shouldn't have environment bindings ===== CASE: break 1 2 ===== break 1 2 ^ [ -c flag ]:1: Unexpected argument to 'break' ===== CASE: x"y"() { echo hi; } ===== x"y"() { echo hi; } ^ [ -c flag ]:1: Invalid function name ===== CASE: function x"y" { echo hi; } ===== function x"y" { echo hi; } ^ [ -c flag ]:1: Invalid KSH-style function name ===== CASE: } ===== } ^ [ -c flag ]:1: Unexpected right brace ===== CASE: case foo in *) echo ===== case foo in *) echo ^ [ -c flag ]:1: Expected ;; or esac ===== CASE: ls foo| ===== ls foo| ^ [ -c flag ]:1: Unexpected EOF while parsing command ===== CASE: ls foo&& ===== ls foo&& ^ [ -c flag ]:1: Unexpected EOF while parsing command ===== CASE: foo() ===== foo() ^ [ -c flag ]:1: Unexpected word while parsing compound command ===== CASE: break >out ===== (command.ControlFlow token:(Token id:Id.ControlFlow_Break span_id:0 val:break)) skipping _oil-parse-error Skipping some cmd-parse cases on oil-native ===== CASE: PYTHONPATH=. FOO=(1 2) python ===== PYTHONPATH=. FOO=(1 2) python ^~~~ [ -c flag ]:1: Environment bindings can't contain array literals ===== CASE: PYTHONPATH+=1 python ===== PYTHONPATH+=1 python ^~~~~~~~~~~~ [ -c flag ]:1: Expected = in environment binding, got += ===== CASE: echo line 2 echo $( echo ===== echo $( echo ^ [ -c flag ]:3: Invalid word while parsing command list ===== CASE: echo line 2 echo ` echo ===== echo ` echo ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo line 2 echo ` echo \` ===== echo ` echo \` ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo line 2 echo ` echo \`unclosed ` ===== echo ` echo \`unclosed ` ^ [ backticks in [ -c flag ] ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo < << ===== echo < << ^~ [ -c flag ]:1: Invalid token after redirect operator ===== CASE: echo $( echo > >> ) ===== echo $( echo > >> ) ^~ [ -c flag ]:1: Invalid token after redirect operator ===== CASE: cat < 0 && 43 > 42)) ===== (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts:[(Token id:Id.Lit_Digits span_id:1 val:1)]) right: (compound_word parts:[(Token id:Id.Lit_Digits span_id:5 val:0)]) ) right: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts:[(Token id:Id.Lit_Digits span_id:9 val:43)]) right: (compound_word parts:[(Token id:Id.Lit_Digits span_id:13 val:42)]) ) ) spids: [0 16] ) skipping _oil-parse-error ===== CASE: if ((1 > 0 && 43 > 42)); then echo yes; fi ===== (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts:[(Token id:Id.Lit_Digits span_id:3 val:1)]) right: (compound_word parts:[(Token id:Id.Lit_Digits span_id:7 val:0)]) ) right: (arith_expr.Binary op_id: Id.Arith_Great left: (compound_word parts:[(Token id:Id.Lit_Digits span_id:11 val:43)]) right: (compound_word parts:[(Token id:Id.Lit_Digits span_id:15 val:42)]) ) ) spids: [2 18] ) terminator: (Token id:Id.Op_Semi span_id:18 val:_) ) ] ) action: [ (command.Sentence child: (command.Simple words: [ (compound_word parts:[(Token id:Id.Lit_Chars span_id:22 val:echo)]) (compound_word parts:[(Token id:Id.Lit_Chars span_id:24 val:yes)]) ] do_fork: T ) terminator: (Token id:Id.Op_Semi span_id:25 val:_) ) ] spids: [0 20] ) ] spids: [-1 27] ) skipping _oil-parse-error ===== CASE: for ((x = 1; x < 5; ++x)); do echo $x; done ===== (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (Token id:Id.Lit_ArithVarLike span_id:3 val:x) right: (compound_word parts:[(Token id:Id.Lit_Digits span_id:7 val:1)]) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (Token id:Id.Lit_ArithVarLike span_id:10 val:x) right: (compound_word parts:[(Token id:Id.Lit_Digits span_id:14 val:5)]) ) update: (arith_expr.UnaryAssign op_id: Id.Arith_DPlus child: (Token id:Id.Lit_ArithVarLike span_id:18 val:x) ) body: (command.DoGroup children: [ (command.Sentence child: (command.Simple words: [ (compound_word parts:[(Token id:Id.Lit_Chars span_id:25 val:echo)]) (compound_word parts: [(simple_var_sub token:(Token id:Id.VSub_DollarName span_id:27 val:'$x'))] ) ] do_fork: T ) terminator: (Token id:Id.Op_Semi span_id:28 val:_) ) ] spids: [23 30] ) ) skipping _oil-parse-error Skipping parse_dparen cases skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping oil_nested_proc skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping oil_var_decl skipping _oil-parse-error skipping _oil-parse-error skipping oil_place_mutation ===== CASE: case $foo { (*.py) echo "python" ;; } ===== (command.Case to_match: (compound_word parts: [(simple_var_sub token:(Token id:Id.VSub_DollarName span_id:4 val:'$foo'))] ) arms: [ (case_arm pat_list: [ (compound_word parts: [(Token id:Id.Lit_Star span_id:10 val:'*') (Token id:Id.Lit_Chars span_id:11 val:.py)] ) ] action: [ (command.Simple words: [ (compound_word parts:[(Token id:Id.Lit_Chars span_id:14 val:echo)]) (compound_word parts: [ (double_quoted left: (Token id:Id.Left_DoubleQuote span_id:16 val:'"') parts: [(Token id:Id.Lit_Chars span_id:17 val:python)] multiline: F spids: [16 18] ) ] ) ] do_fork: T ) ] spids: [9 12 20 -1] ) ] spids: [2 6 23] ) ===== CASE: case "foo" { (*.py) echo "python" ;; } ===== (command.Case to_match: (compound_word parts: [ (double_quoted left: (Token id:Id.Left_DoubleQuote span_id:4 val:'"') parts: [(Token id:Id.Lit_Chars span_id:5 val:foo)] multiline: F spids: [4 6] ) ] ) arms: [ (case_arm pat_list: [ (compound_word parts: [(Token id:Id.Lit_Star span_id:12 val:'*') (Token id:Id.Lit_Chars span_id:13 val:.py)] ) ] action: [ (command.Simple words: [ (compound_word parts:[(Token id:Id.Lit_Chars span_id:16 val:echo)]) (compound_word parts: [ (double_quoted left: (Token id:Id.Left_DoubleQuote span_id:18 val:'"') parts: [(Token id:Id.Lit_Chars span_id:19 val:python)] multiline: F spids: [18 20] ) ] ) ] do_fork: T ) ] spids: [11 14 22 -1] ) ] spids: [2 8 25] ) skipping _oil-parse-error skipping _oil-parse-error skipping oil_for skipping oil_for skipping oil_issue_1118 ===== CASE: for x in & ===== for x in & ^ [ -c flag ]:1: Invalid word in for loop ===== CASE: for (( i=0; i<10; i++ )) ls ===== for (( i=0; i<10; i++ )) ls ^~ [ -c flag ]:1: Invalid word after for expression ===== CASE: for ( i=0; i<10; i++ ) ===== for ( i=0; i<10; i++ ) ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: for $x in 1 2 3; do echo $i; done ===== for $x in 1 2 3; do echo $i; done ^~ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: for x.y in 1 2 3; do echo $i; done ===== for x.y in 1 2 3; do echo $i; done ^~~ [ -c flag ]:1: Invalid loop variable name 'x.y' ===== CASE: for x in 1 2 3; & ===== for x in 1 2 3; & ^ [ -c flag ]:1: ===== CASE: for foo BAD ===== for foo BAD ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: for var in x; do echo $var; done ===== (command.ForEach iter_names: [var] iterable: (for_iter.Words words:[(compound_word parts:[(Token id:Id.Lit_Chars span_id:6 val:x)])]) body: (command.DoGroup children: [ (command.Sentence child: (command.Simple words: [ (compound_word parts:[(Token id:Id.Lit_Chars span_id:11 val:echo)]) (compound_word parts: [(simple_var_sub token:(Token id:Id.VSub_DollarName span_id:13 val:'$var'))] ) ] do_fork: T ) terminator: (Token id:Id.Op_Semi span_id:14 val:_) ) ] spids: [9 16] ) spids: [0 4 7] ) skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping _oil-parse-error skipping invalid_parens on oil-native skipping _runtime-parse-error ---------------------- ===== CASE: test/parse-errors/01-bad-func.sh ===== Skipping file test/parse-errors/01-bad-func.sh oil-native ===== CASE: test/parse-errors/02-bad-func.sh ===== foo() ^ 'test/parse-errors/02-bad-func.sh':3: Unexpected word while parsing compound command ===== CASE: test/parse-errors/05-unterminated-single.sh ===== A B echo 'C ^ 'test/parse-errors/05-unterminated-single.sh':5: Unexpected EOF in single-quoted string that began here ===== CASE: test/parse-errors/06-unterminated-double-long.sh ===== A B echo 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 " ^ 'test/parse-errors/06-unterminated-double-long.sh':9: Unexpected EOF reading double-quoted string that began here ===== CASE: test/parse-errors/06-unterminated-double.sh ===== A B echo "0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 ^ 'test/parse-errors/06-unterminated-double.sh':6: Unexpected EOF reading double-quoted string that began here ===== CASE: test/parse-errors/07-unterminated-here-doc-2.sh ===== cat << "$@" ^ 'test/parse-errors/07-unterminated-here-doc-2.sh':2: Invalid here doc delimiter ===== CASE: test/parse-errors/07-unterminated-here-doc.sh ===== cat <