summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lexer.c b/lexer.c
index 5318924..76cffc8 100644
--- a/lexer.c
+++ b/lexer.c
@@ -85,10 +85,14 @@ lexline(Rune *line)
stmt->toks[stmt->ntoks].operator.dyadic = 1;
stmt->toks[stmt->ntoks].operator.code = p-primdyadopnames;
offset++;
- }else if(isdigitrune(line[offset])){
+ }else if(isdigitrune(line[offset]) || (line[offset] == L'¯' && isdigitrune(line[offset+1]))){
char buf[64];
char *p = buf;
int floating = 0;
+ if(line[offset] == L'¯'){
+ *p++ = '-';
+ offset++;
+ }
get_digits:
while(isdigitrune(line[offset]))
p += runetochar(p, &line[offset++]);