aboutsummaryrefslogtreecommitdiff
path: root/awkgram.y
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-11-10 21:19:18 +0200
committerArnold D. Robbins <arnold@skeeve.com>2019-11-10 21:19:18 +0200
commit108224b4845d7ac622cdc3dcbe47b463e4253a4b (patch)
tree7dd5a7746be9b5f7b62621d2037c7e7763926437 /awkgram.y
parentc879fbf013b5314c27fa236c987ea56a521420e6 (diff)
downloadone-true-awk-108224b4845d7ac622cdc3dcbe47b463e4253a4b.tar.gz
Convert variables to bool and enum.
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/awkgram.y b/awkgram.y
index c5356d7..894f9b5 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -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: