about summary refs log tree commit diff
path: root/pkg/lang/ast/expr.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/ast/expr.go')
-rw-r--r--pkg/lang/ast/expr.go8
1 files changed, 7 insertions, 1 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