Implemented if statements

This commit is contained in:
Eduard Urbach 2024-07-07 12:30:57 +02:00
parent c139dced9e
commit 962a362578
Signed by: eduard
GPG key ID: 49226B848C78F6C8
16 changed files with 280 additions and 14 deletions

View file

@ -37,6 +37,15 @@ func (node *Define) String() string {
return fmt.Sprintf("(= %s %s)", node.Name.Text(), node.Value)
}
type If struct {
Condition *expression.Expression
Body AST
}
func (node *If) String() string {
return fmt.Sprintf("(if %s %s)", node.Condition, node.Body)
}
type Loop struct {
Body AST
}