From e95515664a943d8968c492f242a7d4b0729ea4b5 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 22 Feb 2016 12:50:48 -0500 Subject: eshtrans/backend: Generate translation unit ID --- (limited to 'eshtrans/frontend') 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 -- cgit v0.9.1