remoo69 / Compiler-Sheesh

Compiler for the self-developed language Sheesh#.
MIT License
2 stars 1 forks source link

semantic issue with kung #46

Closed jldav1d closed 1 week ago

jldav1d commented 2 weeks ago

Produces an error with kung statement.

Code:

sheesh(){
    whole x = 10#
    kung(x == 10){
        whole x = 10#
    }
}

Error Message in terminal:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python312\Lib\tkinter\__init__.py", line 1948, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\David\Downloads\sheesh#\Compiler-Sheesh\Sheesh# Compiler.py", line 143, in run_parser
    errors, sem_err=parse.parse()
                  ^^^^^^^^^^^^^
  File "C:\Users\David\Downloads\sheesh#\Compiler-Sheesh\source\SyntaxAnalyzer\Parser.py", line 119, in parse
    self.semantic.analyze()
  File "C:\Users\David\Downloads\sheesh#\Compiler-Sheesh\source\SemanticAnalyzer\SemanticAnalyzer.py", line 119, in analyze
    self.routines[self.current_node.root]()
  File "C:\Users\David\Downloads\sheesh#\Compiler-Sheesh\source\SemanticAnalyzer\SemanticAnalyzer.py", line 253, in control_flow_statement
    if self.current_node.children[2].type=="Identifier" and self.current_node.children[0].value=="choose":
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AST' object has no attribute 'type'
remoo69 commented 1 week ago

image fixed