summaryrefslogtreecommitdiffstats
path: root/eshtrans
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-02-22 13:49:09 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-02-22 13:50:09 (EST)
commitc8148e05608d02ebc603773ad1a8e2a7f55f33ff (patch)
treedb87b01b36f21e63064bd0e00278e7b54d51f7b2 /eshtrans
parent03d22c23782f10abbb71fc9f039f80cebd5fea29 (diff)
downloadeggshell-c8148e05608d02ebc603773ad1a8e2a7f55f33ff.zip
eggshell-c8148e05608d02ebc603773ad1a8e2a7f55f33ff.tar.gz
eggshell-c8148e05608d02ebc603773ad1a8e2a7f55f33ff.tar.bz2
eshtrans/frontend: Inject function start/end tokens
Diffstat (limited to 'eshtrans')
-rw-r--r--eshtrans/frontend/parser.esh10
1 files changed, 8 insertions, 2 deletions
diff --git a/eshtrans/frontend/parser.esh b/eshtrans/frontend/parser.esh
index a29bc5c..eb82666 100644
--- a/eshtrans/frontend/parser.esh
+++ b/eshtrans/frontend/parser.esh
@@ -364,8 +364,14 @@ until_clause()
function_body()
{
ptrace_begn function_body
- if compound_command; then
- redirect_list
+ if accept T_LBRACE; then
+ inject T_FN_START
+ if ! compound_list; then
+ ptrace_fail function_body
+ return 1
+ fi
+ inject T_FN_END
+ expect T_RBRACE
ptrace_pass function_body
return 0
fi