diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-06-30 19:33:55 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-06-30 19:33:55 +0000 |
commit | a8b1fadd149126e9c8d3081a56d206812211f1e6 (patch) | |
tree | 0e841a4c080daa9e6a6697df6630a147bbef3db6 /parser.c | |
parent | baea4aa939861fd4efbc71b96f93ba890f01ac40 (diff) |
Add builtins for typetests
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; |