diff options
Diffstat (limited to 'eshtrans/frontend/lexer.esh')
-rw-r--r-- | eshtrans/frontend/lexer.esh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh index ec80ac3..069f36b 100644 --- a/eshtrans/frontend/lexer.esh +++ b/eshtrans/frontend/lexer.esh @@ -938,7 +938,7 @@ accept() return 1 fi # Validate name. - case "${tok%%${US}*}" in + case "${tok#*${US}}" in [A-Za-z_][0-9A-Za-z_]*) ;; *) @@ -953,7 +953,7 @@ accept() return 1 fi # Validate name. - case "${tok%%${US}*}" in + case "${tok#*${US}}" in [A-Za-z_][0-9A-Za-z_]*) ;; *) @@ -989,6 +989,20 @@ accept() return 1 fi done + tok="T_CMDNAME${US}${tok#T_WORD${US}}" + ;; + T_IO_NUMBER) + # I/O numbers are recognized as literal T_WORDs. + if ! [ "x${tok%%${US}*}" = 'xT_WORD' ]; then + return 1 + fi + # Validate number. + case "${tok#*${US}}" in + *[!0-9]*) + return 1 + ;; + esac + tok="T_IO_NUMBER${US}${tok#T_WORD${US}}" ;; *) if ! [ "x${tok%%${US}*}" = "x${t}" ]; then |