aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index d71627e..6a96154 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -378,12 +378,19 @@ isfunc(lexemes_t toks)
if (toks.kinds[toksidx + 1] == LEXRPAR)
return true;
- for (size_t i = toksidx + 1;; i++) {
+ for (size_t i = toksidx + 1, nst = 1;; i++) {
switch (toks.kinds[i]) {
+ case LEXLPAR:
+ nst++;
+ break;
case LEXRPAR:
- return false;
+ if (--nst == 0)
+ return false;
+ break;
case LEXCOLON:
return true;
+ case LEXEOF:
+ return false;
}
}
}