===== 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: break >out ===== break >out ^~~~~ [ -c flag ]:1: Control flow shouldn't have redirects ===== 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 $x in 1 2 3; do echo $i; done ===== for $x in 1 2 3; do echo $i; done ^~ [ -c flag ]:1: Loop variable name should be a constant ===== 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 ===== CASE: for x in 1 2 3; & ===== for x in 1 2 3; & ^ [ -c flag ]:1: Expected word type , got ===== CASE: for foo BAD ===== for foo BAD ^~~ [ -c flag ]:1: Unexpected word after for loop variable ===== 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: [ ( x ] ===== [ ( x ] ^ [ -c flag ]:1: Expected word type , got ===== CASE: PYTHONPATH=. FOO=(1 2) python ===== PYTHONPATH=. FOO=(1 2) python ^~~~ [ -c flag ]:1: Environment bindings can't contain array literals ===== CASE: echo foo FOO=(1 2) ===== echo foo FOO=(1 2) ^~~~ [ -c flag ]:1: Commands 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 ===== line 2 echo $( echo ^ [ -c flag ]:3: Unexpected EOF while parsing command ===== CASE: echo line 2 echo ` echo ===== line 2 echo ` echo ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo line 2 echo ` echo \` ===== line 2 echo ` echo \` ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: echo line 2 echo ` echo \`unclosed ` ===== line 2 echo `unclosed ^ [ backticks at ... ]:1: 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: FOO=1 BAR=2 > out ===== FOO=1 BAR=2 > out ^~~~ [ -c flag ]:1: Global assignment shouldn't have redirects ===== CASE: > out FOO=1 BAR=2 ===== > out FOO=1 BAR=2 ^~~~ [ -c flag ]:1: Global assignment shouldn't have redirects ===== CASE: local BAR=2 > out ===== local BAR=2 > out ^~~~~ [ -c flag ]:1: Assignments shouldn't have redirects ===== CASE: cat <, got ===== CASE: echo ${ ===== echo ${ ^ [ -c flag ]:1: Unexpected token '' ===== CASE: ${foo:} ===== ${foo:} ^ [ -c flag ]:1: Token can't be used in prefix position ===== CASE: echo ${a[@Z ===== echo ${a[@Z ^ [ -c flag ]:1: Expected ] after subscript, got 'Z' ===== CASE: echo ${x.} ===== echo ${x.} ^ [ -c flag ]:1: Expected } after var sub, got '.' ===== CASE: echo ${!x.} ===== echo ${!x.} ^ [ -c flag ]:1: Expected } after var sub, got '.' ===== CASE: echo ${a:1;} ===== echo ${a:1;} ^ [ -c flag ]:1: Unexpected token in slice: ';' ===== CASE: echo ${a:1:2;} ===== echo ${a:1:2;} ^ [ -c flag ]:1: Unexpected token after slice: ';' ===== CASE: echo ${#a. ===== echo ${#a. ^ [ -c flag ]:1: Expected } after length expression, got '.' ===== CASE: for (( i = 0; i < 10; i++ ; ===== for (( i = 0; i < 10; i++ ; ^ [ -c flag ]:1: Expected ) to end for loop expression, got '' ===== CASE: for (( i = 0; i < 10; i++ / ===== for (( i = 0; i < 10; i++ / ^ [ -c flag ]:1: Unexpected end of input ===== CASE: echo @(extglob|foo ===== echo @(extglob|foo ^~ [ -c flag ]:1: Unexpected EOF reading extended glob that began here ===== CASE: ${undef:- ===== ${undef:- ^ [ -c flag ]:1: Unexpected token (after VTest): '' ===== CASE: ${undef:-$ ===== ${undef:-$ ^ [ -c flag ]:1: Unexpected token (after VTest): '' ===== CASE: ${undef:-$F ===== ${undef:-$F ^ [ -c flag ]:1: Unexpected token (after VTest): '' ===== CASE: ${x@ ===== ${x@ ^ [ -c flag ]:1: Expected } after var sub, got '@' ===== CASE: ${x@Q ===== ${x@Q ^ [ -c flag ]:1: Expected } after var sub, got '' ===== CASE: ${x% ===== ${x% ^ [ -c flag ]:1: Unexpected token (after VOp1): '' ===== CASE: ${x/ ===== ${x/ ^ [ -c flag ]:1: Pattern in ${x/pat/replace} must not be empty ===== CASE: ${x/a/ ===== ${x/a/ ^ [ -c flag ]:1: Expected } after replacement string, got (token id:Eof_Real val:'' span_id:5) ===== CASE: ${x/a/b ===== ${x/a/b ^ [ -c flag ]:1: Expected } after replacement string, got (token id:Eof_Real val:'' span_id:6) ===== CASE: ${x: ===== ${x: ^ [ -c flag ]:1: Unexpected end of input ===== CASE: a=(1 & 2) ===== a=(1 & 2) ^ [ -c flag ]:1: Unexpected token in array literal: '&' ===== CASE: a= (1 2) ===== a= (1 2) ^ [ -c flag ]:1: Expected ( after =, got ' ' ===== CASE: a=(1 2 ===== a=(1 2 ^ [ -c flag ]:1: Unexpected token in array literal: '' ===== CASE: a=(1 ${2@} ) ===== a=(1 ${2@} ) ^ [ -c flag ]:1: Expected } after var sub, got '@' ===== CASE: echo ${x/} ===== echo ${x/} ^ [ -c flag ]:1: Pattern in ${x/pat/replace} must not be empty ===== CASE: echo ${x//} ===== echo ${x//} ^ [ -c flag ]:1: Expected } after pat sub, got '' ===== CASE: echo ${x///foo} ===== echo ${x///foo} ^~~ [ -c flag ]:1: Expected } after pat sub, got 'foo' ===== CASE: "unterminated double ===== "unterminated double ^ [ -c flag ]:1: Unexpected EOF reading double-quoted string that began here ===== CASE: 'unterminated single ===== 'unterminated single ^ [ -c flag ]:1: Unexpected EOF in single-quoted string that began here ===== CASE: "unterminated double multiline line 1 line 2 ===== "unterminated double multiline ^ [ -c flag ]:2: Unexpected EOF reading double-quoted string that began here ===== CASE: 'unterminated single multiline line 1 line 2 ===== 'unterminated single multiline ^ [ -c flag ]:2: Unexpected EOF in single-quoted string that began here ===== CASE: echo $(( 1 + 2 ; ===== echo $(( 1 + 2 ; ^ [ -c flag ]:1: Expected first ) to end arith sub, got ';' ===== CASE: echo $(( 1 + 2 ); ===== echo $(( 1 + 2 ); ^ [ -c flag ]:1: Expected second ) to end arith sub, got ';' ===== CASE: echo $(( ===== echo $(( ^ [ -c flag ]:1: Unexpected end of input ===== CASE: echo $(( 1 ===== echo $(( 1 ^ [ -c flag ]:1: Expected first ) to end arith sub, got '' ===== CASE: echo $[ 1 + 2 ; ===== echo $[ 1 + 2 ; ^ [ -c flag ]:1: Expected ], got ';' ===== CASE: echo $[ 1 + 2 / ===== echo $[ 1 + 2 / ^ [ -c flag ]:1: Unexpected end of input ===== CASE: echo $[ 1 + 2 / 3 ===== echo $[ 1 + 2 / 3 ^ [ -c flag ]:1: Expected ], got '' ===== CASE: echo $[ ===== echo $[ ^ [ -c flag ]:1: Unexpected end of input ===== CASE: (( 1 + 2 / ===== (( 1 + 2 / ^ [ -c flag ]:1: Unexpected end of input ===== CASE: (( 1 + 2 )/ ===== (( 1 + 2 )/ ^ [ -c flag ]:1: Expected second ) to end arith statement, got '/' ===== CASE: (( 1 ===== (( 1 ^ [ -c flag ]:1: Expected first ) to end arith statement, got '' ===== CASE: (( ===== (( ^ [ -c flag ]:1: Unexpected end of input ===== CASE: a[x+]=1 ===== a[x+]=1 ^ [ array LValue in -c flag ]:1: Unexpected end of input ===== CASE: a[]=1 ===== a[]=1 ^ [ array LValue in -c flag ]:1: Unexpected end of input ===== CASE: a[*]=1 ===== a[*]=1 ^ [ array LValue in -c flag ]:1: Token can't be used in prefix position ===== CASE: (( a + { )) ===== (( a + { )) ^ [ -c flag ]:1: Unexpected token in arithmetic context ===== CASE: (( a + } )) ===== (( a + } )) ^ [ -c flag ]:1: Token can't be used in prefix position ===== CASE: $(( 1 + + )) ===== $(( 1 + + )) ^ [ -c flag ]:1: Token can't be used in prefix position ===== CASE: $(( 1 2 )) ===== $(( 1 2 )) ^ [ -c flag ]:1: Expected first ) to end arith sub, got ' ' ===== CASE: $(( - ; )) ===== $(( - ; )) ^ [ -c flag ]:1: Token can't be used in prefix position ===== CASE: $(( ` )) ===== $(( ` )) ^ [ -c flag ]:1: Unexpected EOF while looking for closing backtick ===== CASE: $(( $ )) ===== $(( $ )) ^ [ -c flag ]:1: Unexpected token in arithmetic context ===== CASE: $(( ${var} = fd )) ===== $(( ${var} = fd )) ^ [ -c flag ]:1: Can't assign to None ===== CASE: [[ a b ]] ===== [[ a b ]] ^ [ -c flag ]:1: Expected ]] ===== CASE: [[ a "a"$(echo hi)"b" ]] ===== [[ a "a"$(echo hi)"b" ]] ^ [ -c flag ]:1: Expected ]] ===== CASE: [[ a == ]] ===== [[ a == ]] ^ [ -c flag ]:1: Expected ]] ===== CASE: [[ $var =~ * ]] ===== [[ $var =~ * ]] ^ [ -c flag ]:1: fatal: Invalid regex '*' ===== CASE: [[ $var =~ \\ ]] ===== [[ $var =~ \\ ]] ^~ [ -c flag ]:1: fatal: Invalid regex '\\' ===== CASE: [[ ( 1 == 2 - ]] ===== [[ ( 1 == 2 - ]] ^ [ -c flag ]:1: Expected ), got (word.CompoundWord parts:[(word_part.LiteralPart token:(token id:Lit_Chars val:- span_id:10))]) ===== CASE: [[ == ]] ===== [[ == ]] ^~ [ -c flag ]:1: Unexpected token in boolean expression ===== CASE: [[ ) ]] ===== [[ ) ]] ^ [ -c flag ]:1: Unexpected token in boolean expression ===== CASE: [[ ( ]] ===== [[ ( ]] ^~ [ -c flag ]:1: Unexpected token in boolean expression ===== CASE: [[ ;;; ]] ===== [[ ;;; ]] ^~ [ -c flag ]:1: Unexpected token in boolean expression ===== CASE: [[ ===== [[ ^ [ -c flag ]:1: Unexpected token in boolean expression ===== CASE: [ x -a y f ] ===== [ x -a y f ] ^ [ -c flag ]:1: (test) Unexpected trailing word 'f' ===== CASE: test x -a y f ===== test x -a y f ^ [ -c flag ]:1: (test) Unexpected trailing word 'f' ===== CASE: [ x ===== [ x ^ [ -c flag ]:1: missing closing ] ===== CASE: [ x x ] ===== [ x x ] ^ [ -c flag ]:1: (test) Expected unary operator, got 'x' (2 args) ===== CASE: [ x x "a b" ] ===== [ x x "a b" ] ^ [ -c flag ]:1: (test) Expected binary operator, got 'x' (3 args) ===== CASE: [ -t xxx ] ===== [ -t xxx ] ^~~ [ -c flag ]:1: (test) Invalid file descriptor 'xxx' ===== CASE: [ \( x -a -y -a z ] ===== [??? no location ???] (test) Expected ), got EOF ===== CASE: printf % ===== % ^ (source.ArgvWord word_spid:2):1: Expected a printf format character ===== CASE: printf [%Z] ===== [%Z] ^ (source.ArgvWord word_spid:2):1: Invalid printf format character ===== CASE: printf -v "-invalid-" %s foo ===== printf -v "-invalid-" %s foo ^~~~~~ [ -c flag ]:1: 'printf' got invalid variable name '-invalid-' ===== CASE: shift 1 2 ===== shift 1 2 ^~~~~ [ -c flag ]:1: 'shift' got too many arguments ===== CASE: shift zzz ===== shift zzz ^~~~~ [ -c flag ]:1: 'shift' Invalid shift argument 'zzz' ===== CASE: pushd x y ===== pushd x y ^~~~~ [ -c flag ]:1: 'pushd' got too many arguments ===== CASE: pwd -x ===== pwd -x ^~ [ -c flag ]:1: 'pwd' doesn't accept flag '-x' ===== CASE: repr foo a-x ===== repr foo a-x ^~~ [ -c flag ]:1: 'repr' got invalid variable name 'a-x' 'foo' is not defined ===== CASE: wait zzz ===== wait zzz ^~~ [ -c flag ]:1: 'wait' expected PID or jobspec, got 'zzz' ===== CASE: wait %jobspec-not-supported ===== wait %jobspec-not-supported ^ [ -c flag ]:1: 'wait' doesn't support bash-style jobspecs (got '%jobspec-not-supported') ===== CASE: unset invalid-var-name ===== unset invalid-var-name ^~~~~~~~~~~~~~~~ [ -c flag ]:1: 'unset' got invalid variable name 'invalid-var-name' ===== CASE: getopts hc: invalid-var-name ===== getopts hc: invalid-var-name ^~~~~~~~~~~~~~~~ [ -c flag ]:1: 'getopts' got invalid variable name 'invalid-var-name' ===== CASE: read -x ===== read -x ^~ [ -c flag ]:1: 'read' doesn't accept flag '-x' ===== CASE: read -n ===== read -n ^~ [ -c flag ]:1: 'read' expected argument to '-n' ===== CASE: read -n x ===== read -n x ^ [ -c flag ]:1: 'read' expected integer after '-n', got 'x' ===== CASE: set -o errexit +o oops ===== set -o errexit +o oops ^~~~ [ -c flag ]:1: 'set' got invalid option 'oops' osh usage error: got invalid argument 'x' to '-ast-format', expected one of: text, abbrev-text, html, abbrev-html, oheap, none osh usage error: got invalid option 'oops' ===== CASE: echo {1..3..-1} ===== echo {1..3..-1} ^~~~~~~~ [ -c flag ]:1: Invalid step -1 for ascending integer range ===== CASE: echo {1..3..0} ===== echo {1..3..0} ^~~~~~~ [ -c flag ]:1: Invalid step 0 for ascending integer range ===== CASE: echo {3..1..1} ===== echo {3..1..1} ^~~~~~~ [ -c flag ]:1: Invalid step 1 for descending integer range ===== CASE: echo {3..1..0} ===== echo {3..1..0} ^~~~~~~ [ -c flag ]:1: Invalid step 0 for descending integer range ===== CASE: echo {a..Z} ===== echo {a..Z} ^~~~ [ -c flag ]:1: Mismatched cases in character range ===== CASE: echo {a..z..0} ===== echo {a..z..0} ^~~~~~~ [ -c flag ]:1: Invalid step 0 for ascending character range ===== CASE: echo {a..z..-1} ===== echo {a..z..-1} ^~~~~~~~ [ -c flag ]:1: Invalid step -1 for ascending character range ===== CASE: echo {z..a..1} ===== echo {z..a..1} ^~~~~~~ [ -c flag ]:1: Invalid step 1 for descending character range ---------------------- ===== CASE: test/parse-errors/01-bad-func.sh ===== foo (ls) ^~ test/parse-errors/01-bad-func.sh:14: Expected word type , got ===== 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 <