diff options
Diffstat (limited to 'pkg/lang/ast')
| -rw-r--r-- | pkg/lang/ast/expr.go | 8 | ||||
| -rw-r--r-- | pkg/lang/ast/stmt.go | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/pkg/lang/ast/expr.go b/pkg/lang/ast/expr.go index f98f9b3..b0ed599 100644 --- a/pkg/lang/ast/expr.go +++ b/pkg/lang/ast/expr.go @@ -1,6 +1,8 @@ package ast -import "jinx/pkg/libs/source" +import ( + "jinx/pkg/libs/source" +) type ExprKind int @@ -24,6 +26,10 @@ const ( type Expr ExprT[any] +func (e Expr) IsEmpty() bool { + return e == Expr{} +} + type ExprT[T any] struct { At source.Loc Kind ExprKind diff --git a/pkg/lang/ast/stmt.go b/pkg/lang/ast/stmt.go index e25dee9..6395f57 100644 --- a/pkg/lang/ast/stmt.go +++ b/pkg/lang/ast/stmt.go @@ -47,10 +47,7 @@ type StmtVarDecl struct { } type StmtIf struct { - Cond Expr - Then BlockNode - Elifs []CondNode - Else BlockNode + Conds []CondNode } type StmtTry struct { |
