summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parsing/lexer.sh6
-rw-r--r--parsing/parse.sh2
2 files changed, 5 insertions, 3 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh
index 52aedea..e1d3aab 100644
--- a/parsing/lexer.sh
+++ b/parsing/lexer.sh
@@ -522,8 +522,10 @@ accept()
done
tok="T_FNAME${US}${tok#T_WORD${US}}"
;;
- T_WORD)
- if ! [ "x${tok%%${US}*}" = "x${t}" ]; then
+ T_CMDNAME)
+ # The first word of a simple command is to be checked
+ # for reserved words.
+ if ! [ "x${tok%%${US}*}" = 'xT_WORD' ]; then
return 1
fi
# Verify that the word doesn't match any reserved words.
diff --git a/parsing/parse.sh b/parsing/parse.sh
index 542f5ea..56a1d39 100644
--- a/parsing/parse.sh
+++ b/parsing/parse.sh
@@ -280,7 +280,7 @@ cmd_name()
{
dbg 'cmd_name()'
# TODO: Assignment
- if accept T_WORD; then
+ if accept T_CMDNAME; then
return 0
fi
return 1