Add ternary expressions

This commit is contained in:
2023-10-30 08:37:59 -07:00
parent 9d44c8d02c
commit c1a2e56f4f
5 changed files with 352 additions and 186 deletions

View File

@@ -199,3 +199,14 @@ func (l Logical) Pos() Position {
func (l Logical) Op() string {
return l.Value
}
type Ternary struct {
Condition Node
IfTrue Node
Else Node
Position Position
}
func (t Ternary) Pos() Position {
return t.Position
}