-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tree-sitter queries to latest
- Loading branch information
Showing
61 changed files
with
4,416 additions
and
1,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,105 @@ | ||
(class_declaration | ||
body: (class_body) @class.inner) @class.outer | ||
body: (class_body) @class.inner) @class.outer | ||
|
||
(method_declaration) @function.outer | ||
|
||
(method_declaration | ||
body: (block . "{" . (_) @function.inner._start @function.inner._end (_)? @function.inner._end . "}" | ||
)) | ||
body: (block | ||
. | ||
"{" | ||
. | ||
(_) @function.inner._start @function.inner._end | ||
(_)? @function.inner._end | ||
. | ||
"}" | ||
)) | ||
|
||
(constructor_declaration) @function.outer | ||
|
||
(constructor_declaration | ||
body: (constructor_body . "{" . (_) @function.inner._start @function.inner._end (_)? @function.inner._end . "}" | ||
)) | ||
body: (constructor_body | ||
. | ||
"{" | ||
. | ||
(_) @function.inner._start @function.inner._end | ||
(_)? @function.inner._end | ||
. | ||
"}" | ||
)) | ||
|
||
(for_statement | ||
body: (_)? @loop.inner) @loop.outer | ||
body: (_)? @loop.inner) @loop.outer | ||
|
||
(enhanced_for_statement | ||
body: (_)? @loop.inner) @loop.outer | ||
body: (_)? @loop.inner) @loop.outer | ||
|
||
(while_statement | ||
body: (_)? @loop.inner) @loop.outer | ||
body: (_)? @loop.inner) @loop.outer | ||
|
||
(do_statement | ||
body: (_)? @loop.inner) @loop.outer | ||
body: (_)? @loop.inner) @loop.outer | ||
|
||
(if_statement | ||
condition: (_ (parenthesized_expression) @conditional.inner) @conditional.outer) | ||
condition: (_ | ||
(parenthesized_expression) @conditional.inner) @conditional.outer) | ||
|
||
(if_statement | ||
consequence: (_)? @conditional.inner | ||
alternative: (_)? @conditional.inner | ||
) @conditional.outer | ||
consequence: (_)? @conditional.inner | ||
alternative: (_)? @conditional.inner) @conditional.outer | ||
|
||
(switch_expression | ||
body: (_)? @conditional.inner) @conditional.outer | ||
body: (_)? @conditional.inner) @conditional.outer | ||
|
||
;; blocks | ||
; blocks | ||
(block) @block.outer | ||
|
||
|
||
(method_invocation) @call.outer | ||
(method_invocation | ||
arguments: (argument_list . "(" . (_) @call.inner._start (_)? @call.inner._end . ")" | ||
)) | ||
|
||
;; parameters | ||
(method_invocation | ||
arguments: (argument_list | ||
. | ||
"(" | ||
. | ||
(_) @call.inner._start | ||
(_)? @call.inner._end | ||
. | ||
")" | ||
)) | ||
|
||
; parameters | ||
(formal_parameters | ||
"," @parameter.outer._start . | ||
(formal_parameter) @parameter.inner @parameter.outer._end | ||
) | ||
"," @parameter.outer._start | ||
. | ||
(formal_parameter) @parameter.inner @parameter.outer._end | ||
) | ||
|
||
(formal_parameters | ||
. (formal_parameter) @parameter.inner @parameter.outer._start | ||
. ","? @parameter.outer._end | ||
) | ||
. | ||
(formal_parameter) @parameter.inner @parameter.outer._start | ||
. | ||
","? @parameter.outer._end | ||
) | ||
|
||
(argument_list | ||
"," @parameter.outer._start . | ||
(_) @parameter.inner @parameter.outer._end | ||
) | ||
"," @parameter.outer._start | ||
. | ||
(_) @parameter.inner @parameter.outer._end | ||
) | ||
|
||
(argument_list | ||
. (_) @parameter.inner @parameter.outer._start | ||
. ","? @parameter.outer._end | ||
) | ||
. | ||
(_) @parameter.inner @parameter.outer._start | ||
. | ||
","? @parameter.outer._end | ||
) | ||
|
||
[ | ||
(line_comment) | ||
(block_comment) | ||
(line_comment) | ||
(block_comment) | ||
] @comment.outer | ||
|
||
;; assignment | ||
; assignment | ||
(variable_declarator | ||
name: (identifier) @assignment.lhs | ||
value: (_) @assignment.rhs) @assignment.inner @assignment.outer | ||
name: (identifier) @assignment.lhs | ||
value: (_) @assignment.rhs) @assignment.inner @assignment.outer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
; inherits: html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,42 @@ | ||
(function_definition) @function.outer | ||
|
||
(function_definition | ||
body: (compound_statement . "{" . (_) @function.inner._start @function.inner._end (_)? @function.inner._end . "}" | ||
)) | ||
body: (compound_statement | ||
. | ||
"{" | ||
. | ||
(_) @function.inner._start @function.inner._end | ||
(_)? @function.inner._end | ||
. | ||
"}" | ||
)) | ||
|
||
(case_statement) @conditional.outer | ||
|
||
(if_statement | ||
(_) @conditional.inner ) @conditional.outer | ||
(_) @conditional.inner) @conditional.outer | ||
|
||
(for_statement | ||
(_) @loop.inner ) @loop.outer | ||
(_) @loop.inner) @loop.outer | ||
|
||
(while_statement | ||
(_) @loop.inner ) @loop.outer | ||
(_) @loop.inner) @loop.outer | ||
|
||
(comment) @comment.outer | ||
|
||
(regex) @regex.inner | ||
|
||
((word) @number.inner | ||
(#match? @number.inner "^[0-9]+$")) | ||
(#match? @number.inner "^[0-9]+$")) | ||
|
||
(variable_assignment) @assignment.outer | ||
(variable_assignment name: (_) @assignment.inner @assignment.lhs) | ||
(variable_assignment value: (_) @assignment.inner @assignment.rhs) | ||
|
||
(variable_assignment | ||
name: (_) @assignment.inner @assignment.lhs) | ||
|
||
(variable_assignment | ||
value: (_) @assignment.inner @assignment.rhs) | ||
|
||
(command | ||
argument: (word) @parameter.inner) | ||
|
Oops, something went wrong.