bugfix in lexer
This commit is contained in:
@@ -27,6 +27,7 @@ class Repo:
|
||||
'public'
|
||||
]
|
||||
self.types = [
|
||||
'any',
|
||||
'number',
|
||||
'string',
|
||||
'bool',
|
||||
@@ -35,7 +36,15 @@ class Repo:
|
||||
'emptyType',
|
||||
'void'
|
||||
]
|
||||
self.expr_chars = ['+', '-', '*', '/', '=']
|
||||
self.var_types = [
|
||||
'any',
|
||||
'number',
|
||||
'string',
|
||||
'bool',
|
||||
'list',
|
||||
'dict'
|
||||
]
|
||||
self.expr_chars = ['+', '-', '*', '/', '=', '^']
|
||||
self.bool_expr_chars = ['<', '>', '!', '!=', '==', '>=', '<=']
|
||||
self.bool_values = ['true', 'false']
|
||||
self.format_chars = ['{', '}', '(', ')', ';', ':', ',']
|
||||
@@ -45,10 +54,10 @@ class Repo:
|
||||
|
||||
def output_tokens(self, toks: list) -> None:
|
||||
if self.debug and len(toks) > 0:
|
||||
# outp_toks = []
|
||||
outp_toks = []
|
||||
for tok in toks:
|
||||
# outp_toks.append({tok.value: tok.type})
|
||||
print({tok.value: tok.type})
|
||||
outp_toks.append({tok.value: tok.type})
|
||||
# print({tok.value: tok.type})
|
||||
|
||||
# print(outp_toks)
|
||||
print('\n')
|
||||
print(outp_toks)
|
||||
# print('\n')
|
||||
|
Reference in New Issue
Block a user