feat!: drop modules, general refactor and cleanup

This commit is contained in:
Christian Clason 2023-06-12 09:54:30 -06:00
parent 310f0925ec
commit 692b051b09
1247 changed files with 6096 additions and 9074 deletions

View 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

View 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 "^/[*][*][^*].*[*]/$"))

View file

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

View 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