summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
authorglenda <glenda@cirno>2022-09-18 12:02:10 +0000
committerglenda <glenda@cirno>2022-09-18 12:02:10 +0000
commit6430127cc4503e2e7e40f86ccc68594ced055274 (patch)
treec59362f84ac28e051a31ea48495e6d002e019e20 /lexer.c
parent0719e6cf67a4644282f97431024f6a350b45ff46 (diff)
File IO (very simple)
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lexer.c b/lexer.c
index 9971ecd..45f5f5f 100644
--- a/lexer.c
+++ b/lexer.c
@@ -194,7 +194,7 @@ get_digits:
*p = 0;
ungetrune(input);
stmt->toks[stmt->ntoks] = allocdatum(ArrayTag, 0);
- stmt->toks[stmt->ntoks]->array = floating ? mkscalarfloat(atof(buf)) : mkscalarint(atoll(buf));
+ stmt->toks[stmt->ntoks]->array = floating ? mkscalarfloat(atof(buf)) : mkscalarint(strtoull(buf, nil, 0));
}else if(runestrchr(L"⍺⍵⍶⍹", peek)){
Rune name[2] = {peek, 0};
stmt->toks[stmt->ntoks] = allocdatum(NameTag, 0);
@@ -216,7 +216,7 @@ get_digits:
Rune *p = buf;
*p++ = peek;
peek = getrune(input);
- while(isalpharune(peek)){
+ while(isalpharune(peek) || isdigitrune(peek)){
*p++ = toupperrune(peek);
peek = getrune(input);
}