diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-11-10 21:19:18 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-11-10 21:19:18 +0200 |
commit | 108224b4845d7ac622cdc3dcbe47b463e4253a4b (patch) | |
tree | 7dd5a7746be9b5f7b62621d2037c7e7763926437 /awkgram.y | |
parent | c879fbf013b5314c27fa236c987ea56a521420e6 (diff) | |
download | one-true-awk-108224b4845d7ac622cdc3dcbe47b463e4253a4b.tar.gz |
Convert variables to bool and enum.
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -32,8 +32,8 @@ int yywrap(void) { return(1); } Node *beginloc = 0; Node *endloc = 0; -int infunc = 0; /* = 1 if in arglist or body of func */ -int inloop = 0; /* = 1 if in while, for, do */ +bool infunc = false; /* = true if in arglist or body of func */ +int inloop = 0; /* >= 1 if in while, for, do; can't be bool, since loops can next */ char *curfname = 0; /* current function name */ Node *arglist = 0; /* list of args for current function */ %} @@ -182,8 +182,8 @@ pa_stat: { beginloc = linkum(beginloc, $3); $$ = 0; } | XEND lbrace stmtlist '}' { endloc = linkum(endloc, $3); $$ = 0; } - | FUNC funcname '(' varlist rparen {infunc++;} lbrace stmtlist '}' - { infunc--; curfname=0; defn((Cell *)$2, $4, $8); $$ = 0; } + | FUNC funcname '(' varlist rparen {infunc = true;} lbrace stmtlist '}' + { infunc = false; curfname=0; defn((Cell *)$2, $4, $8); $$ = 0; } ; pa_stats: |