From a8b1fadd149126e9c8d3081a56d206812211f1e6 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Wed, 30 Jun 2021 19:33:55 +0000 Subject: Add builtins for typetests --- parser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'parser.c') 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; -- cgit v1.2.3