diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-20 00:06:57 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-20 00:06:57 (EST) |
commit | 6a78c02494504eafb437c605bdc6f9d160b3d35d (patch) | |
tree | c5348e22d45f6c103901e6e308b8513ab947acc1 /parsing/lexer.sh | |
parent | 6944e19e75467d92140174e979898f35659f9dc6 (diff) | |
download | eggshell-6a78c02494504eafb437c605bdc6f9d160b3d35d.zip eggshell-6a78c02494504eafb437c605bdc6f9d160b3d35d.tar.gz eggshell-6a78c02494504eafb437c605bdc6f9d160b3d35d.tar.bz2 |
Check only first word of simple commands for reseserved words
Diffstat (limited to 'parsing/lexer.sh')
-rw-r--r-- | parsing/lexer.sh | 6 |
1 files changed, 4 insertions, 2 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. |