summaryrefslogtreecommitdiffstats
path: root/parsing
diff options
context:
space:
mode:
authorP. 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)
commit4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369 (patch)
tree2ab3234588931a6b86b4c5c72185700ee04b6069 /parsing
parentb5691474048bf4dce01e984be73ea91a41a5be07 (diff)
downloadeggshell-4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369.zip
eggshell-4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369.tar.gz
eggshell-4e6bfd6fe0d48ddf49cd61bb8cb31881a1e5e369.tar.bz2
accept(): Use toktext()
Diffstat (limited to 'parsing')
-rw-r--r--parsing/lexer.sh6
-rw-r--r--parsing/parse.sh6
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'