summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
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;