27 lines
541 B
Go
27 lines
541 B
Go
package saccharine
|
|
|
|
type Statement interface {
|
|
IsStatement()
|
|
}
|
|
|
|
type LetStatement struct {
|
|
Name string
|
|
Parameters []string
|
|
Body Expression
|
|
}
|
|
|
|
type DeclareStatement struct {
|
|
Value Expression
|
|
}
|
|
|
|
func (LetStatement) IsStatement() {}
|
|
func (DeclareStatement) IsStatement() {}
|
|
|
|
func NewLet(name string, parameters []string, body Expression) *LetStatement {
|
|
return &LetStatement{Name: name, Parameters: parameters, Body: body}
|
|
}
|
|
|
|
func NewDeclare(value Expression) *DeclareStatement {
|
|
return &DeclareStatement{Value: value}
|
|
}
|