mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
13
runtime/queries/circom/folds.scm
Normal file
13
runtime/queries/circom/folds.scm
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[
|
||||
(template_body)
|
||||
(block_statement)
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(function_body)
|
||||
(call_expression)
|
||||
(array_expression)
|
||||
(tuple_expression)
|
||||
(comment)
|
||||
(include_directive)+
|
||||
] @fold
|
||||
137
runtime/queries/circom/highlights.scm
Normal file
137
runtime/queries/circom/highlights.scm
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
; identifiers
|
||||
; -----------
|
||||
(identifier) @variable
|
||||
|
||||
; Pragma
|
||||
; -----------
|
||||
[
|
||||
"pragma"
|
||||
"circom"
|
||||
] @keyword.directive
|
||||
|
||||
(circom_version) @string.special
|
||||
|
||||
; Include
|
||||
; -----------
|
||||
[
|
||||
"public"
|
||||
"signal"
|
||||
"var"
|
||||
"include"
|
||||
] @keyword.import
|
||||
|
||||
; Literals
|
||||
; --------
|
||||
(string) @string
|
||||
|
||||
(int_literal) @number
|
||||
|
||||
; Definitions
|
||||
; -----------
|
||||
(function_definition
|
||||
name: (identifier) @function)
|
||||
|
||||
(template_definition
|
||||
name: (identifier) @function)
|
||||
|
||||
; Use constructor coloring for special functions
|
||||
"main" @constructor
|
||||
|
||||
; Invocations
|
||||
(call_expression
|
||||
.
|
||||
(identifier) @function.call)
|
||||
|
||||
; Function parameters
|
||||
(parameter
|
||||
name: (identifier) @variable.parameter)
|
||||
|
||||
; Members
|
||||
(member_expression
|
||||
property: (property_identifier) @property)
|
||||
|
||||
; Tokens
|
||||
; -------
|
||||
; Keywords
|
||||
[
|
||||
"input"
|
||||
"output"
|
||||
"public"
|
||||
"component"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"for"
|
||||
"while"
|
||||
] @keyword.repeat
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
] @keyword.conditional
|
||||
|
||||
"return" @keyword.return
|
||||
|
||||
[
|
||||
"function"
|
||||
"template"
|
||||
] @keyword.function
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Operators
|
||||
[
|
||||
"&&"
|
||||
"||"
|
||||
">>"
|
||||
"<<"
|
||||
"&"
|
||||
"^"
|
||||
"|"
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"**"
|
||||
"<"
|
||||
"<="
|
||||
"="
|
||||
"=="
|
||||
"!="
|
||||
"+="
|
||||
"-="
|
||||
">="
|
||||
">"
|
||||
"!"
|
||||
"~"
|
||||
"-"
|
||||
"+"
|
||||
"++"
|
||||
"--"
|
||||
"<=="
|
||||
"==>"
|
||||
"<--"
|
||||
"-->"
|
||||
"==="
|
||||
] @operator
|
||||
|
||||
; Comments
|
||||
(comment) @comment @spell
|
||||
|
||||
((comment) @comment.documentation
|
||||
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
||||
2
runtime/queries/circom/injections.scm
Normal file
2
runtime/queries/circom/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
12
runtime/queries/circom/locals.scm
Normal file
12
runtime/queries/circom/locals.scm
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(function_definition) @local.scope
|
||||
|
||||
(template_definition) @local.scope
|
||||
|
||||
(main_component_definition) @local.scope
|
||||
|
||||
(block_statement) @local.scope
|
||||
|
||||
(parameter
|
||||
name: (identifier) @local.definition) @local.definition
|
||||
|
||||
(identifier) @local.reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue