diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-21 03:40:43 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-21 03:40:43 (EST) |
commit | 4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369 (patch) | |
tree | 2ab3234588931a6b86b4c5c72185700ee04b6069 /parsing | |
parent | b5691474048bf4dce01e984be73ea91a41a5be07 (diff) | |
download | eggshell-4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369.zip eggshell-4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369.tar.gz eggshell-4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369.tar.bz2 |
accept(): Use toktext()
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/lexer.sh | 6 | ||||
-rw-r--r-- | parsing/parse.sh | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh index 292d2fa..886e7f8 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -800,7 +800,7 @@ accept() # T_WORD data unit must match reserved word # exactly. if ! [ "x${tok#T_WORD${US}}" = \ - "x$(tokname "${t}")" ]; then + "x$(toktext "${t}")" ]; then return 1 fi # If the token matches the reserved word, @@ -842,7 +842,7 @@ accept() T_CASE T_ESAC T_WHILE T_UNTIL T_FOR \ T_LBRACE T_RBRACE T_BANG T_IN; do if [ "x${tok#T_WORD${US}}" = \ - "x$(tokname "${rw}")" ]; then + "x$(toktext "${rw}")" ]; then tok="${rw}" return 1 fi @@ -860,7 +860,7 @@ accept() T_CASE T_ESAC T_WHILE T_UNTIL T_FOR \ T_LBRACE T_RBRACE T_BANG T_IN; do if [ "x${tok#T_WORD${US}}" = \ - "x$(tokname "${rw}")" ]; then + "x$(toktext "${rw}")" ]; then tok="${rw}" return 1 fi diff --git a/parsing/parse.sh b/parsing/parse.sh index 1ea851a..199005a 100644 --- a/parsing/parse.sh +++ b/parsing/parse.sh @@ -670,5 +670,7 @@ try() #try 'foo\" bar' #try 'foo\' #try "foo'" -try 'foo\' 'bar' -try 'v=foo' +#try 'foo\' 'bar' +#try 'v=foo' +try 'if &&' +try 'if true; do' |