Skip to content

Commit

Permalink
Optimized "TranslateToPy" & and "Lexer"
Browse files Browse the repository at this point in the history
  • Loading branch information
SatinWukerORIG authored Jan 30, 2022
1 parent f44ec07 commit 460579b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src-py/pyrickroll.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from PublicVariables import *
from Lexer import Lexer

from Lexer import lexicalize

# Token types
TT_keyword = 'KEYWORDS'
Expand Down Expand Up @@ -62,10 +61,9 @@ class Token: # Return token types
def __init__(self, tokens):
self.t_types = []
self.t_values = []
self.__tokens = tokens
self.last_kw = ''

for tok in self.__tokens:
for tok in tokens:
if tok:
self.__make_token(tok)

Expand Down Expand Up @@ -266,8 +264,7 @@ def run_in_py(src_file_name):
for statement in content: # "statement" is a line of code the in source code
current_line += 1

lexer = Lexer(statement)
token = Token(lexer.tokens)
token = Token(lexicalize(statement))
transpiler.translate(types=token.t_types, values=token.t_values)

return py_code

0 comments on commit 460579b

Please sign in to comment.