diff options
Diffstat (limited to 'lexer.py')
| -rw-r--r-- | lexer.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -31,7 +31,7 @@ def lex_string(inp): elif c == DOUBLE_QUOTE: #return token, inp[idx + 1:] - return NebLiteral(NebType.STRING, token), inp[idx + 1:] + return NebString(token), inp[idx + 1:] else: token += c @@ -52,7 +52,7 @@ def lex_bool(inp): raise Exception("invalid boolean") #return token, inp[len(str(token)):] - return NebLiteral(NebType.BOOL, token), inp[len(str(token)):] + return NebBool(token), inp[len(str(token)):] def lex_number(inp): @@ -61,10 +61,10 @@ def lex_number(inp): if c in (" ", CLOSE_PAREN): if "." in token: #return float(token), inp[idx:] - return NebLiteral(NebType.FLOAT, float(token)), inp[idx:] + return NebFloat(float(token)), inp[idx:] else: #return int(token), inp[idx:] - return NebLiteral(NebType.INT, int(token)), inp[idx:] + return NebInt(int(token)), inp[idx:] if c in list(DIGITS): # or c in ("-", "."): token += c @@ -88,10 +88,10 @@ def lex_number(inp): if "." in token: #return float(token), "" - return NebLiteral(NebType.FLOAT, float(token)), "" + return NebFloat(float(token)), "" else: #return int(token), "" - return NebLiteral(NebType.INT, int(token)), "" + return NebInt(int(token)), "" def lex_symbol(inp): token = "" |
