Skip to content

Commit

Permalink
fix error on multiple compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
uzuriel committed May 27, 2024
1 parent 291290a commit c2a2e11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/code_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ def syntax_highlight(self, event = None):
self.text.tag_config(token_tag_name, foreground=EDITOR_THEME['default'])

def run_lexer(self) -> bool:
self.source_code = [v if v else v + '\n' for v in self.text.get('1.0', 'end-1c').split('\n')]

lx = self.lexer(self.source_code)
self.tokens = lx.tokens
self.lx_errors = lx.errors

if(len(self.lx_errors) > 0 and self.program):
self.program = None
self.transpiled_program = None
Expand Down

0 comments on commit c2a2e11

Please sign in to comment.