summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-06-30 19:33:55 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-06-30 19:33:55 +0000
commita8b1fadd149126e9c8d3081a56d206812211f1e6 (patch)
tree0e841a4c080daa9e6a6697df6630a147bbef3db6 /parser.c
parentbaea4aa939861fd4efbc71b96f93ba890f01ac40 (diff)
Add builtins for typetests
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index e1a7de8..577c338 100644
--- a/parser.c
+++ b/parser.c
@@ -186,8 +186,12 @@ term(void)
result = fullterm(ParenRightTok, nil, nil);
match(ParenRightTok);
break;
+ case StringTok:
+ result = mkstring(lookahead.text);
+ match(StringTok);
+ break;
default:
- print("Cant parse term of token type %d\n", lookahead.tag);
+ print("Can't parse term of token type %d\n", lookahead.tag);
syntaxerror("term");
result = nil;
}
@@ -513,6 +517,7 @@ nexttoken(void)
numD += (peek - L'0') / (10 * place);
peek = Bgetrune(parsein);
}
+ Bungetrune(parsein);
/* Should also lex 123.45E10 */
lookahead.tag = FloatTok;
lookahead.dval = negative ? -numD : numD;