===== CASE: FOO=1 break ===== Line 1 of '' FOO=1 break ^~~~ Control flow shouldn't have environment bindings ===== CASE: break 1 2 ===== Line 1 of '' break 1 2 ^ Unexpected argument to 'break' ===== CASE: break >out ===== Line 1 of '' break >out ^~~~~ Control flow shouldn't have redirects ===== CASE: for x in & ===== Line 1 of '' for x in & ^ Invalid word in for loop ===== CASE: for (( i=0; i<10; i++ )) ls ===== Line 1 of '' for (( i=0; i<10; i++ )) ls ^~ Invalid word after for expression ===== CASE: for $x in 1 2 3; do echo $i; done ===== Line 1 of '' for $x in 1 2 3; do echo $i; done ^~ Loop variable name should be a constant ===== CASE: for x.y in 1 2 3; do echo $i; done ===== Line 1 of '' for x.y in 1 2 3; do echo $i; done ^~~ Invalid loop variable name ===== CASE: for x in 1 2 3; & ===== Line 1 of '' for x in 1 2 3; & ^ Expected word type KW_Do, got Op_Amp ===== CASE: for foo BAD ===== Line 1 of '' for foo BAD ^~~ Unexpected word after for loop variable ===== CASE: x"y"() { echo hi; } ===== Line 1 of '' x"y"() { echo hi; } ^ Invalid function name ===== CASE: function x"y" { echo hi; } ===== Line 1 of '' function x"y" { echo hi; } ^ Invalid KSH-style function name ===== CASE: } ===== Line 1 of '' } ^ Unexpected right brace ===== CASE: case foo in *) echo ===== Line 1 of '' case foo in *) echo ^ Expected ;; or esac ===== CASE: ls foo| ===== Line 1 of '' ls foo| ^ Unexpected EOF while parsing command ===== CASE: ls foo&& ===== Line 1 of '' ls foo&& ^ Unexpected EOF while parsing command ===== CASE: foo() ===== Line 1 of '' foo() ^ Unexpected word while parsing compound command ===== CASE: PYTHONPATH=. FOO=(1 2) python ===== Line 1 of '' PYTHONPATH=. FOO=(1 2) python ^~~~ Environment bindings can't contain array literals ===== CASE: echo foo FOO=(1 2) ===== Line 1 of '' echo foo FOO=(1 2) ^~~~ Commands can't contain array literals ===== CASE: PYTHONPATH+=1 python ===== Line 1 of '' PYTHONPATH+=1 python ^~~~~~~~~~~~ Expected = in environment binding, got += ===== CASE: echo < << ===== Line 1 of '' echo < << ^~ Invalid token after redirect operator ===== CASE: echo $( echo > >> ) ===== Line 1 of '' echo $( echo > >> ) ^~ Invalid token after redirect operator ===== CASE: FOO=1 BAR=2 > out ===== Line 1 of '' FOO=1 BAR=2 > out ^~~~ Global assignment shouldn't have redirects ===== CASE: > out FOO=1 BAR=2 ===== Line 1 of '' > out FOO=1 BAR=2 ^~~~ Global assignment shouldn't have redirects ===== CASE: local BAR=2 > out ===== Line 1 of '' local BAR=2 > out ^~~~~ Assignments shouldn't have redirects ===== CASE: cat <' $(( 1 * )) ^ Token can't be used in prefix position ===== CASE: cat <' invalid: ${a!} ^ Expected } after var sub, got '!' ===== CASE: cat <' $(for x in ) ^ Invalid word in for loop ===== CASE: cat << $(invalid here end) ===== Line 1 of '' cat << $(invalid here end) ^~ Unterminated here doc began here ===== CASE: cat << $((1+2)) ===== Line 1 of '' cat << $((1+2)) ^~~ Unterminated here doc began here ===== CASE: cat << a=(1 2 3) ===== Line 1 of '' cat << a=(1 2 3) ^~ Unterminated here doc began here ===== CASE: cat << \a$(invalid) ===== Line 1 of '' cat << \a$(invalid) ^~ Unterminated here doc began here ===== CASE: cat << "double"$(invalid) ===== Line 1 of '' cat << "double"$(invalid) ^ Unterminated here doc began here ===== CASE: cat << ~foo/$(invalid) ===== Line 1 of '' cat << ~foo/$(invalid) ^~~~ Unterminated here doc began here ===== CASE: cat << $var/$(invalid) ===== Line 1 of '' cat << $var/$(invalid) ^~~~ Unterminated here doc began here ===== CASE: echo ${ ===== Line 1 of '' echo ${ ^ Unexpected token '' ===== CASE: ${foo:} ===== Line 1 of '' ${foo:} ^ Token can't be used in prefix position ===== CASE: echo ${a[@Z ===== Line 1 of '' echo ${a[@Z ^ Expected ] after subscript, got 'Z' ===== CASE: echo ${x.} ===== Line 1 of '' echo ${x.} ^ Expected } after var sub, got '.' ===== CASE: echo ${!x.} ===== Line 1 of '' echo ${!x.} ^ Expected } after var sub, got '.' ===== CASE: echo ${a:1;} ===== Line 1 of '' echo ${a:1;} ^ Unexpected token in slice: ';' ===== CASE: echo ${a:1:2;} ===== Line 1 of '' echo ${a:1:2;} ^ Unexpected token after slice: ';' ===== CASE: echo ${#a. ===== Line 1 of '' echo ${#a. ^ Expected } after length expression, got '.' ===== CASE: for (( i = 0; i < 10; i++ ; ===== Line 1 of '' for (( i = 0; i < 10; i++ ; ^ Expected ) to end for loop expression, got '' ===== CASE: for (( i = 0; i < 10; i++ / ===== Line 1 of '' for (( i = 0; i < 10; i++ / ^ Unexpected end of input ===== CASE: echo @(extglob|foo ===== Line 1 of '' echo @(extglob|foo ^~ Unexpected EOF reading extended glob that began here ===== CASE: a=(1 & 2) ===== Line 1 of '' a=(1 & 2) ^ Unexpected token in array literal: '&' ===== CASE: a= (1 2) ===== Line 1 of '' a= (1 2) ^ Expected ( after =, got ' ' ===== CASE: a=(1 2 ===== Line 1 of '' a=(1 2 ^ Unexpected token in array literal: '' ===== CASE: a=(1 ${2@} ) ===== Line 1 of '' a=(1 ${2@} ) ^ Expected } after var sub, got '@' ===== CASE: echo ${x/} ===== Line 1 of '' echo ${x/} ^ Pattern in ${x/pat/replace} must not be empty ===== CASE: echo ${x//} ===== Line 1 of '' echo ${x//} ^ Expected } after pat sub, got '' ===== CASE: echo ${x///foo} ===== Line 1 of '' echo ${x///foo} ^~~ Expected } after pat sub, got 'foo' ===== CASE: "unterminated double ===== Line 1 of '' "unterminated double ^ Unexpected EOF reading double-quoted string that began here ===== CASE: 'unterminated single ===== Line 1 of '' 'unterminated single ^ Unexpected EOF in single-quoted string that began here ===== CASE: "unterminated double multiline line 1 line 2 ===== Line 2 of '' "unterminated double multiline ^ Unexpected EOF reading double-quoted string that began here ===== CASE: 'unterminated single multiline line 1 line 2 ===== Line 2 of '' 'unterminated single multiline ^ Unexpected EOF in single-quoted string that began here ===== CASE: echo $(( 1 + 2 ; ===== Line 1 of '' echo $(( 1 + 2 ; ^ Expected first ) to end arith sub, got ';' ===== CASE: echo $(( 1 + 2 ); ===== Line 1 of '' echo $(( 1 + 2 ); ^ Expected second ) to end arith sub, got ';' ===== CASE: echo $(( ===== Line 1 of '' echo $(( ^ Unexpected end of input ===== CASE: echo $(( 1 ===== Line 1 of '' echo $(( 1 ^ Expected first ) to end arith sub, got '' ===== CASE: echo $[ 1 + 2 ; ===== Line 1 of '' echo $[ 1 + 2 ; ^ Expected ], got ';' ===== CASE: echo $[ 1 + 2 / ===== Line 1 of '' echo $[ 1 + 2 / ^ Unexpected end of input ===== CASE: echo $[ 1 + 2 / 3 ===== Line 1 of '' echo $[ 1 + 2 / 3 ^ Expected ], got '' ===== CASE: echo $[ ===== Line 1 of '' echo $[ ^ Unexpected end of input ===== CASE: (( 1 + 2 / ===== Line 1 of '' (( 1 + 2 / ^ Unexpected end of input ===== CASE: (( 1 + 2 )/ ===== Line 1 of '' (( 1 + 2 )/ ^ Expected second ) to end arith statement, got '/' ===== CASE: (( 1 ===== Line 1 of '' (( 1 ^ Expected first ) to end arith statement, got '' ===== CASE: (( ===== Line 1 of '' (( ^ Unexpected end of input ===== CASE: a[x+]=1 ===== Line 1 of '' a[x+]=1 ^ Unexpected end of input ===== CASE: a[]=1 ===== Line 1 of '' a[]=1 ^~ Unexpected end of input ===== CASE: $(( 1 + + )) ===== Line 1 of '' $(( 1 + + )) ^ Token can't be used in prefix position ===== CASE: $(( 1 2 )) ===== Line 1 of '' $(( 1 2 )) ^ Expected first ) to end arith sub, got ' ' ===== CASE: $(( - ; )) ===== Line 1 of '' $(( - ; )) ^ Token can't be used in prefix position ===== CASE: $(( ` )) ===== Line 1 of '' $(( ` )) ^ Invalid word while parsing command ===== CASE: $(( $ )) ===== Line 1 of '' $(( $ )) ^ Unexpected token in arithmetic context ===== CASE: $(( ${var} = fd )) ===== Line 1 of '' $(( ${var} = fd )) ^ Can't assign to None ===== CASE: [[ a b ]] ===== Line 1 of '' [[ a b ]] ^ Expected ]] ===== CASE: [[ a "a"$(echo hi)"b" ]] ===== Line 1 of '' [[ a "a"$(echo hi)"b" ]] ^ Expected ]] ===== CASE: [[ a == ]] ===== Line 1 of '' [[ a == ]] ^ Expected ]] ===== CASE: [[ $var =~ * ]] ===== Line 1 of '' [[ $var =~ * ]] ^ Invalid regex '*' ===== CASE: [[ $var =~ \\ ]] ===== Line 1 of '' [[ $var =~ \\ ]] ^~ Invalid regex '\\' ===== CASE: [[ ( 1 == 2 - ]] ===== Line 1 of '' [[ ( 1 == 2 - ]] ^ Expected ), got (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:- span_id:10))]) ===== CASE: [[ == ]] ===== Line 1 of '' [[ == ]] ^~ Unexpected token in boolean expression ===== CASE: [[ ) ]] ===== Line 1 of '' [[ ) ]] ^ Unexpected token in boolean expression ===== CASE: [[ ( ]] ===== Line 1 of '' [[ ( ]] ^~ Unexpected token in boolean expression ===== CASE: [[ ;;; ]] ===== Line 1 of '' [[ ;;; ]] ^~ Unexpected token in boolean expression ===== CASE: [[ ===== Line 1 of '' [[ ^ Unexpected token in boolean expression ===== CASE: [ x -a y f ] ===== Error parsing ['x', '-a', 'y', 'f'] osh error: test: Unexpected trailing word in test expression: (StringWord id:Word_Compound s:f) ===== CASE: test x -a y f ===== Error parsing ['x', '-a', 'y', 'f'] osh error: test: Unexpected trailing word in test expression: (StringWord id:Word_Compound s:f) ===== CASE: [ x ===== osh error: [: missing closing ] ===== CASE: [ x x ] ===== Error parsing ['x', 'x'] osh error: test: Expected unary operator, got 'x' (2 args) ===== CASE: [ x x x ] ===== Error parsing ['x', 'x', 'x'] osh error: test: Syntax error: binary operator expected, got 'x' (3 args) ---------------------- ===== CASE: test/parse-errors/01-bad-func.sh ===== Line 14 of 'test/parse-errors/01-bad-func.sh' foo (ls) ^~ Expected word type Right_FuncDef, got Word_Compound ===== CASE: test/parse-errors/02-bad-func.sh ===== Line 3 of 'test/parse-errors/02-bad-func.sh' foo() ^ Unexpected word while parsing compound command ===== CASE: test/parse-errors/05-unterminated-single.sh ===== A B Line 5 of 'test/parse-errors/05-unterminated-single.sh' echo 'C ^ Unexpected EOF in single-quoted string that began here ===== CASE: test/parse-errors/06-unterminated-double-long.sh ===== A B Line 9 of 'test/parse-errors/06-unterminated-double-long.sh' echo 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 " ^ Unexpected EOF reading double-quoted string that began here ===== CASE: test/parse-errors/06-unterminated-double.sh ===== A B Line 6 of 'test/parse-errors/06-unterminated-double.sh' echo "0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 ^ Unexpected EOF reading double-quoted string that began here ===== CASE: test/parse-errors/07-unterminated-here-doc-2.sh ===== Line 2 of 'test/parse-errors/07-unterminated-here-doc-2.sh' cat << "$@" ^ Invalid here doc delimiter ===== CASE: test/parse-errors/07-unterminated-here-doc.sh ===== Line 5 of 'test/parse-errors/07-unterminated-here-doc.sh' cat <