✨
This commit is contained in:
@ -33,6 +33,10 @@ class Parser():
|
||||
return [tokens[0]] + tokens[2]
|
||||
|
||||
## statement ##
|
||||
@self.pg.production('statement : KEYWORD_SKIP')
|
||||
def statement_skip(tokens):
|
||||
return ast_nodes.StatementSkip()
|
||||
|
||||
@self.pg.production('statement : KEYWORD_SET expression SYMBOL_SET ID')
|
||||
def statement_set(tokens):
|
||||
return ast_nodes.StatementSet(tokens[1], tokens[3].value)
|
||||
@ -70,6 +74,10 @@ class Parser():
|
||||
def command_if(tokens):
|
||||
return ast_nodes.CommandIf(tokens[0], tokens[2])
|
||||
|
||||
@self.pg.production('command : statement KEYWORD_ELSE statement KEYWORD_IF expression')
|
||||
def command_ifelse(tokens):
|
||||
return ast_nodes.CommandIfElse(tokens[0],tokens[2],tokens[4])
|
||||
|
||||
@self.pg.production('command : statement KEYWORD_BECAUSE expression')
|
||||
def command_because(tokens):
|
||||
return ast_nodes.CommandBecause(tokens[0], tokens[2])
|
||||
|
Reference in New Issue
Block a user