Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor types table #667

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading