8000 Proposal for nesting query predicate operator by pokey · Pull Request #1 · fidgetingbits/cursorless · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Proposal for nesting query predicate operator #1

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

Closed
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
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)
)
Comment on lines +258 to +263
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the innermost function call, which is why we use the not-type here


;; 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
Comment on lines 265 to +267
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then each step goes from an apply_expression to its immediate apply_expression parent


;; 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)
)
Comment on lines +283 to 286
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fidgetingbits this isn't entirely related, but note that we can simply define iteration scope for arg like this, and then "first arg" etc should just work


;;
Expand Down
0