aboutsummaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2018-03-29 23:08:34 -0400
committerClyne Sullivan <tullivan99@gmail.com>2018-03-29 23:08:34 -0400
commit8a25cb84e7c51749dd6d43d58e4952ef311eed45 (patch)
treeef056fd99489bacb27db826cc0d6d732eb8b0ebc /parser.c
parent3b33fa0aeb5262335cd708b167caad8f41b8a5dd (diff)
expose inew_number
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index 14031dc..103b80d 100644
--- a/parser.c
+++ b/parser.c
@@ -402,7 +402,7 @@ variable **iparse(instance *it, const char *s)
for (int c = 0; c >= 0; end++) {
if (s[end] == '(')
c++;
- if (c == 0 && last != end && (s[end] == ',' || s[end] == ')')) {
+ if (c == 0 && last != end && (s[end] == ',' || s[end] == ')' || s[end] == '\0')) {
argcount++;
char *arg = strnclone(s + last, end - last);
uint32_t parenidx = ooffset;
@@ -418,7 +418,7 @@ variable **iparse(instance *it, const char *s)
ops[parenidx] = (variable *)(OP_MAGIC | count);
last = end + 1;
}
- if (s[end] == ')')
+ if (s[end] == ')' || s[end] == '\0')
c--;
}
if (s[end] != '\0')