From ed9a0c8f0f3c1eed3582d722935cd1df1d055afd Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 3 Jul 2022 18:11:55 +0200 Subject: Compile If Stmts --- pkg/lang/ast/expr.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pkg/lang/ast/expr.go') 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 -- cgit 1.4.1