improve errors, add warnings, add some compile-time optimizations, fix variables, make sure conditionals and loops get booleans, affirm types, keep variables to a single type
This commit is contained in:
parent
e34b423967
commit
b1b8e61f57
14 changed files with 435 additions and 118 deletions
|
|
@ -439,6 +439,10 @@ func (n ConditionalNode) Type() NodeType {
|
|||
}
|
||||
|
||||
func (n ConditionalNode) String() string {
|
||||
if n.otherwise == nil {
|
||||
return fmt.Sprintf("if %s then %s", n.condition.String(), n.do.String())
|
||||
}
|
||||
|
||||
return fmt.Sprintf("if %s then %s otheriwise %s", n.condition.String(), n.do.String(), n.otherwise.String())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue