Expr embeds Typer and ast implements it

This commit is contained in:
Celestino Amoroso 2024-07-13 17:11:39 +02:00
parent 176969c956
commit 7459057df9
2 changed files with 5 additions and 0 deletions

4
ast.go
View File

@ -19,6 +19,10 @@ func NewAst() *ast {
return &ast{} return &ast{}
} }
func (expr *ast) TypeName() string {
return "Expression"
}
func (expr *ast) ToForest() { func (expr *ast) ToForest() {
if expr.root != nil { if expr.root != nil {
if expr.forest == nil { if expr.forest == nil {

View File

@ -6,6 +6,7 @@ package expr
// ----Expression interface // ----Expression interface
type Expr interface { type Expr interface {
Typer
Eval(ctx ExprContext) (result any, err error) Eval(ctx ExprContext) (result any, err error)
String() string String() string
} }