commit cf054161ae5834bac8debe3ec835c1911ba661ca
parent 80786c7ae2499d7e86920dfe6e959d7c5e3dc8ec
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 29 Nov 2022 20:10:07 -0500
comp/c: fix parsing bug with a postfix op following () expr
Diffstat:
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/ar/puff.c b/fs/ar/puff.c
@@ -249,9 +249,7 @@ static int construct(huffman *h, short *length, int n)
for (len = 0; len <= MAXBITS; len++)
h->count[len] = 0;
for (symbol = 0; symbol < n; symbol++)
- // TODO: I get a tokenization error with:
- // (h->count[length[symbol]])++;
- h->count[length[symbol]]++; /* assumes lengths are within bounds */
+ (h->count[length[symbol]])++; /* assumes lengths are within bounds */
if (h->count[0] == n) /* no codes! */
return 0; /* complete, but decode() will fail */
diff --git a/fs/comp/c/pgen.fs b/fs/comp/c/pgen.fs
@@ -249,7 +249,7 @@ alias noop parseFactor ( tok -- ) \ forward declaration
nextt dup parseType if ( tok type )
\ TODO: actually process the typecast
nip parseDeclarator drop nextt ')' expectChar nextt parseExpression
- else ( tok ) parseExpression nextt ')' expectChar then
+ else ( tok ) parseExpression nextt ')' expectChar parsePostfixOp then
endof
'"' of isChar?^ ( )
vmjmp[, here ( jaddr saddr )