mirror of
https://github.com/Alvin-Zilverstand/femcode.git
synced 2026-03-06 13:23:39 +01:00
feat: Implement for loops, break, and continue statements
This commit is contained in:
@@ -81,6 +81,18 @@ class BreakStatement(AST):
|
||||
class ContinueStatement(AST):
|
||||
pass
|
||||
|
||||
class ForStatement(AST):
|
||||
def __init__(self, var_name, iterable, body):
|
||||
self.var_name = var_name
|
||||
self.iterable = iterable
|
||||
self.body = body
|
||||
|
||||
class BreakStatement(AST):
|
||||
pass
|
||||
|
||||
class ContinueStatement(AST):
|
||||
pass
|
||||
|
||||
class FunctionDefinition(AST):
|
||||
def __init__(self, name, parameters, body):
|
||||
self.name = name
|
||||
@@ -452,4 +464,4 @@ class Parser:
|
||||
self.consume('DOT') # Assuming DOT token for property access
|
||||
property_name_token = self.get_current_token()
|
||||
self.consume('ID')
|
||||
return PropertyAccess(target_node, property_name_token.value)
|
||||
return PropertyAccess(target_node, property_name_token.value)
|
||||
|
||||
Reference in New Issue
Block a user