From e070620bf7c66b4bdfeaa8e6bf96ca98fa9a1024 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 5 Aug 2023 20:56:31 -0400 Subject: Fix weird augments like 'len' and 'is' --- tnslc/tokenizer.tnsl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tnslc/tokenizer.tnsl b/tnslc/tokenizer.tnsl index 882dcef..3220313 100644 --- a/tnslc/tokenizer.tnsl +++ b/tnslc/tokenizer.tnsl @@ -113,7 +113,7 @@ struct Token { ;/ ;/ - return is_reserved(tok.data{0}) && in_csv(~CSV_AUGMENTS, tok.data) + return in_csv(~CSV_AUGMENTS, tok.data) ;/ # True if the token is a valid number (integer or float) @@ -176,7 +176,14 @@ struct Token { tok`.pop() bool a = is_whitespace(c) && type_after !== TOKEN_TYPE.LITERAL - bool b = is_reserved(c) && type_after == TOKEN_TYPE.DEFWORD + + bool b = false + /; if (is_reserved(c) == true) + b = type_after == TOKEN_TYPE.DEFWORD + ;; else if (tok`._len() > 0) + b = is_reserved(tok`.data{0}) + ;/ + bool c = type_before == TOKEN_TYPE.LITERAL && type_after == TOKEN_TYPE.DEFWORD return a || b || c -- cgit v1.2.3