Skip to content

Commit

Permalink
Refactor types table (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv authored Jun 3, 2024
1 parent efa006a commit a31b1fe
Show file tree
Hide file tree
Showing 27 changed files with 544 additions and 454 deletions.
4 changes: 2 additions & 2 deletions ast/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ type BuiltinNode struct {
Map Node // Used by optimizer to fold filter() and map() builtins.
}

// ClosureNode represents a predicate.
// PredicateNode represents a predicate.
// Example:
//
// filter(foo, .bar == 1)
//
// The predicate is ".bar == 1".
type ClosureNode struct {
type PredicateNode struct {
base
Node Node // Node of the predicate body.
}
Expand Down
2 changes: 1 addition & 1 deletion ast/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (n *BuiltinNode) String() string {
return fmt.Sprintf("%s(%s)", n.Name, strings.Join(arguments, ", "))
}

func (n *ClosureNode) String() string {
func (n *PredicateNode) String() string {
return n.Node.String()
}

Expand Down
2 changes: 1 addition & 1 deletion ast/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Walk(node *Node, v Visitor) {
for i := range n.Arguments {
Walk(&n.Arguments[i], v)
}
case *ClosureNode:
case *PredicateNode:
Walk(&n.Node, v)
case *PointerNode:
case *VariableDeclaratorNode:
Expand Down
Loading

0 comments on commit a31b1fe

Please sign in to comment.