17 lines
278 B
Go
17 lines
278 B
Go
package ast
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.akyoto.dev/cli/q/src/build/expression"
|
|
)
|
|
|
|
// If represents an if statement.
|
|
type If struct {
|
|
Condition *expression.Expression
|
|
Body AST
|
|
}
|
|
|
|
func (node *If) String() string {
|
|
return fmt.Sprintf("(if %s %s)", node.Condition, node.Body)
|
|
}
|