about summary refs log tree commit diff
path: root/pkg/lang/ast/expr.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-04-21 03:18:46 +0200
committerMel <einebeere@gmail.com>2022-04-21 03:18:46 +0200
commit5267c0e8653b431cfd2c06212cdba4f22225bd02 (patch)
tree9ec6205f01629918407edb97a531248e1bb6c762 /pkg/lang/ast/expr.go
parent20bc0c2243888900d2f04328e57ad2d7ca0a2403 (diff)
downloadjinx-5267c0e8653b431cfd2c06212cdba4f22225bd02.tar.zst
jinx-5267c0e8653b431cfd2c06212cdba4f22225bd02.zip
Do not force generics for Expr and Stmt
Diffstat (limited to 'pkg/lang/ast/expr.go')
-rw-r--r--pkg/lang/ast/expr.go22
1 files changed, 12 insertions, 10 deletions
diff --git a/pkg/lang/ast/expr.go b/pkg/lang/ast/expr.go
index a4d6f56..ab6578a 100644
--- a/pkg/lang/ast/expr.go
+++ b/pkg/lang/ast/expr.go
@@ -22,35 +22,37 @@ const (
 	ExprKindThis
 )
 
-type Expr[T any] struct {
+type Expr ExprT[any]
+
+type ExprT[T any] struct {
 	At    token.Loc
 	Kind  ExprKind
 	Value T
 }
 
 type ExprBinary struct {
-	Left  Expr[any]
+	Left  Expr
 	Op    BinOp
-	Right Expr[any]
+	Right Expr
 }
 
 type ExprUnary struct {
 	Op    UnOp
-	Value Expr[any]
+	Value Expr
 }
 
 type ExprCall struct {
-	Callee Expr[any]
-	Args   []Expr[any]
+	Callee Expr
+	Args   []Expr
 }
 
 type ExprSubscription struct {
-	Obj Expr[any]
-	Key Expr[any]
+	Obj Expr
+	Key Expr
 }
 
 type ExprGroup struct {
-	Value Expr[any]
+	Value Expr
 }
 
 type ExprFnLit struct {
@@ -59,7 +61,7 @@ type ExprFnLit struct {
 }
 
 type ExprArrayLit struct {
-	Values []Expr[any]
+	Values []Expr
 }
 
 type ExprIdent struct {