diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-07-30 22:09:28 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:29 -0400 |
commit | 1a78659dfab54d808fbc568d6b7ff5e4012695c0 (patch) | |
tree | fc31b41a744d75520907f6518e133c2bcbb85ddb /lisc/parse.c | |
parent | 390045cae16053d6bd1ff3bd914038ab9df89a62 (diff) | |
download | roux-1a78659dfab54d808fbc568d6b7ff5e4012695c0.tar.gz |
cosmetics
Diffstat (limited to 'lisc/parse.c')
-rw-r--r-- | lisc/parse.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisc/parse.c b/lisc/parse.c index 6c6765d..4bb30fb 100644 --- a/lisc/parse.c +++ b/lisc/parse.c @@ -264,19 +264,18 @@ varref(char *v) if (sym[t].type == STmp) if (strcmp(v, sym[t].name) == 0) return SYM(t); - if (t >= NSym) + if (ntmp++ >= NSym) err("too many symbols"); sym[t].type = STmp; strcpy(sym[t].name, v); - ntmp++; return SYM(t); } static Ref parseref() { - int i; Const c; + int i; switch (next()) { case TVar: @@ -294,10 +293,9 @@ parseref() && cst[i].val == c.val && strcmp(cst[i].label, c.label) == 0) return CONST(i); - if (i >= NCst) + if (ncst++ >= NCst) err("too many constants"); cst[i] = c; - ncst++; return CONST(i); default: return R; |