aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lexer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lexer.py b/lexer.py
index c4f52d3..eaeccec 100644
--- a/lexer.py
+++ b/lexer.py
@@ -10,6 +10,7 @@ types = {
":int": TokenType.INT_TYPE,
":float": TokenType.FLOAT_TYPE,
":string": TokenType.STRING_TYPE,
+ ":list": TokenType.LIST_TYPE,
":any": TokenType.ANY_TYPE }
keywords = {
@@ -129,7 +130,8 @@ def get_string(data, line):
counter += 1
if counter >= len(data):
raise Exception("couldn't parse string")
- return Token(TokenType.STRING, string, string, line), counter + 1, offset
+ string = string.encode().decode("unicode_escape")
+ return Token(TokenType.STRING, str(string), str(string), line), counter + 1, offset
def get_bool(data, line):
if len(data) >= 4 and data[:4] == "true":