commit 1fc64d1171d719ce9d54ebeef6283cd7c1993925
parent bfc8d54bb3b19973746bfcdd7cc0ba10ed280422
Author: citbl <citbl@citbl.org>
Date: Sat, 23 May 2026 19:47:23 +1000
fixup
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/mtcl/main.lua b/mtcl/main.lua
@@ -70,7 +70,8 @@ TK = {
R_PAREN = "r paren",
DBL_QUOTE = "dbl quote",
SGL_QUOTE = "sgl quote",
- LIT_NUMBER = "num lit",
+ LIT_FLOAT = "float lit",
+ LIT_INT = "int lit",
}
Token = { kind = TK.IDK }
@@ -99,7 +100,12 @@ function lex(src)
tokens[#tokens + 1] = { kind = TK.IDENT, lexeme = word }
elseif is_digit(c:byte()) then
number, i, is_float = read_number(i, src)
- kind = if is_float then TK.LIT_FLOAT else TK.LIT_INT end
+ local kind = TK.IDK
+ if is_float then
+ kind = TK.LIT_FLOAT
+ else
+ kind = TK.LIT_INT
+ end
tokens[#tokens + 1] = { kind = kind, lexeme = number }
elseif c == ":" then
if next() == ":" then