Skip to content

Commit

Permalink
Proposal for nesting query predicate operator
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Feb 2, 2024
1 parent 4c517d7 commit 52ce5b1
Showing 1 changed file with 12 additions and 74 deletions.
86 changes: 12 additions & 74 deletions queries/nix.scm
Original file line number Diff line number Diff line change
Expand Up @@ -255,76 +255,16 @@
;;! ^^^^^^
;;! xxxxxxx
;;! ----------------
(apply_expression
[
(apply_expression
function: (variable_expression
name: (identifier) @functionCallee
)
)
(apply_expression
[
(apply_expression
function: (variable_expression
name: (identifier) @functionCallee
)
)
(apply_expression
[
(apply_expression
function: (variable_expression
name: (identifier) @functionCallee
)
)
(apply_expression
(apply_expression
function: (variable_expression
name: (identifier) @functionCallee
)
)
)
]
)
]
)
]
) @functionCall @_.domain
(
(apply_expression
function: (_) @functionCallee
) @functionCallee.domain @functionCall
(#not-type? @functionCallee apply_expression)
)

;; Similar to above, but sometimes the function calls are in select_expression
(apply_expression
[
(select_expression
expression: (variable_expression
name: (identifier)
)
) @functionCallee
(apply_expression
[
(select_expression
expression: (variable_expression
name: (identifier)
)
) @functionCallee
(apply_expression
[
(select_expression
expression: (variable_expression
name: (identifier)
)
) @functionCallee
(apply_expression
(select_expression
expression: (variable_expression
name: (identifier)
)
) @functionCallee
)
]
)
]
)
]
) @functionCall @_.domain
function: (apply_expression) @functionCallee.domain.input @functionCall.input
) @functionCallee.domain.output @functionCall.output

;; Args:
;;!! mkHost a
Expand All @@ -337,14 +277,12 @@
;;! xxxxxx
;;! --------
(apply_expression
function: (variable_expression
name: (identifier) @functionCallee
)
argument: (_) @argumentOrParameter
) @functionCall @_.domain
)

(apply_expression
argument: (_) @argumentOrParameter
(
(apply_expression) @argumentOrParameter.iteration
(#not-parent-type? @argumentOrParameter.iteration apply_expression)
)

;;
Expand Down

0 comments on commit 52ce5b1

Please sign in to comment.