summaryrefslogtreecommitdiffstats
path: root/eshtrans/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'eshtrans/frontend')
-rw-r--r--eshtrans/frontend/lexer.esh8
-rw-r--r--eshtrans/frontend/parser.esh1
2 files changed, 6 insertions, 3 deletions
diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh
index 92c806c..8f83a1a 100644
--- a/eshtrans/frontend/lexer.esh
+++ b/eshtrans/frontend/lexer.esh
@@ -915,7 +915,7 @@ accept()
case "${t}" in
T_IF|T_THEN|T_ELSE|T_ELIF|T_FI|\
T_DO|T_DONE|T_CASE|T_ESAC|T_WHILE|T_UNTIL|\
- T_FOR|T_LBRACE|T_RBRACE|T_BANG|T_IN)
+ T_FOR|T_LBRACE|T_RBRACE|T_BANG|T_IN|T_STATIC|T_RETURN)
dbg "looking for reserved word $t, have '$tok'"
if ! [ "x${tok%%${US}*}" = "x${t}" ]; then
# Reserved words are recognized as literal
@@ -968,7 +968,8 @@ accept()
# reserved words.
for rw in T_IF T_THEN T_ELSE T_ELIF T_FI T_DO T_DONE \
T_CASE T_ESAC T_WHILE T_UNTIL T_FOR \
- T_LBRACE T_RBRACE T_BANG T_IN; do
+ T_LBRACE T_RBRACE T_BANG T_IN \
+ T_STATIC T_RETURN; do
if [ "x${tok#T_WORD${US}}" = \
"x$(toktext "${rw}")" ]; then
tok="${rw}"
@@ -986,7 +987,8 @@ accept()
# Verify that the word doesn't match any reserved words.
for rw in T_IF T_THEN T_ELSE T_ELIF T_FI T_DO T_DONE \
T_CASE T_ESAC T_WHILE T_UNTIL T_FOR \
- T_LBRACE T_RBRACE T_BANG T_IN; do
+ T_LBRACE T_RBRACE T_BANG T_IN \
+ T_STATIC T_RETURN; do
if [ "x${tok#T_WORD${US}}" = \
"x$(toktext "${rw}")" ]; then
tok="${rw}"
diff --git a/eshtrans/frontend/parser.esh b/eshtrans/frontend/parser.esh
index 449c5ba..a29bc5c 100644
--- a/eshtrans/frontend/parser.esh
+++ b/eshtrans/frontend/parser.esh
@@ -398,6 +398,7 @@ do_group()
simple_command()
{
ptrace_begn simple_command
+ accept T_STATIC
if cmd_prefix; then
if cmd_word; then
cmd_suffix