Support arbitrary koral nodes in AST
diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go
index aac7016..1bc8bb4 100644
--- a/pkg/ast/ast.go
+++ b/pkg/ast/ast.go
@@ -1,5 +1,9 @@
package ast
+import (
+ "encoding/json"
+)
+
// NodeType represents the type of a node in the AST
type NodeType string
@@ -71,3 +75,15 @@
type Replacement struct {
Root Node
}
+
+// CatchallNode represents any node type not explicitly handled
+type CatchallNode struct {
+ NodeType string // The original @type value
+ RawContent json.RawMessage // The original JSON content
+ Wrap Node // Optional wrapped node
+ Operands []Node // Optional operands
+}
+
+func (c *CatchallNode) Type() NodeType {
+ return NodeType(c.NodeType)
+}