summaryrefslogtreecommitdiffstats
path: root/eshtrans/frontend
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-02-22 12:50:48 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-02-22 12:50:48 (EST)
commite95515664a943d8968c492f242a7d4b0729ea4b5 (patch)
tree0f2621be0da8f66f344c8ac79824bacc8c315704 /eshtrans/frontend
parentc40e6e23966b9fd51ffa700903667cb552a52923 (diff)
downloadeggshell-e95515664a943d8968c492f242a7d4b0729ea4b5.zip
eggshell-e95515664a943d8968c492f242a7d4b0729ea4b5.tar.gz
eggshell-e95515664a943d8968c492f242a7d4b0729ea4b5.tar.bz2
eshtrans/backend: Generate translation unit ID
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