Skip to content

Commit

Permalink
feat: expose namespace on FuncCall node (fixes #145)
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Sep 7, 2023
1 parent 4d4e397 commit ea77e7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/nodeTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export interface EverythingNode extends BaseNode {
export interface FuncCallNode extends BaseNode {
type: 'FuncCall'
func: GroqFunction
namespace: string
name: string
args: ExprNode[]
}
Expand Down
1 change: 1 addition & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ const EXPR_BUILDER: MarkVisitor<ExprNode> = {
return {
type: 'FuncCall',
func,
namespace,
name,
args,
}
Expand Down
3 changes: 3 additions & 0 deletions tap-snapshots/test/parse.test.ts.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Object {
],
"func": AsyncFunction path(args, scope, execute),
"name": "path",
"namespace": "global",
"type": "FuncCall",
},
"type": "OpCall",
Expand Down Expand Up @@ -103,11 +104,13 @@ Object {
],
"func": AsyncFunction (args, scope, execute),
"name": "unique",
"namespace": "array",
"type": "FuncCall",
},
],
"func": AsyncFunction count(args, scope, execute),
"name": "count",
"namespace": "global",
"type": "FuncCall",
}
`
Expand Down

0 comments on commit ea77e7e

Please sign in to comment.