moved highlights in folder struct
This commit is contained in:
192
queries/mc/highlights.scm
Normal file
192
queries/mc/highlights.scm
Normal file
@@ -0,0 +1,192 @@
|
||||
; Keywords
|
||||
"function" @keyword
|
||||
"if" @keyword.conditional
|
||||
"else" @keyword.conditional
|
||||
"while" @keyword.repeat
|
||||
"for" @keyword.repeat
|
||||
"return" @keyword.return
|
||||
"break" @keyword
|
||||
"continue" @keyword
|
||||
"print" @keyword
|
||||
"const" @keyword
|
||||
"mut" @keyword
|
||||
|
||||
; Type keywords
|
||||
"void" @type.builtin
|
||||
"bool" @type.builtin
|
||||
"char" @type.builtin
|
||||
"string" @type.builtin
|
||||
"int" @type.builtin
|
||||
"uint" @type.builtin
|
||||
"I8" @type.builtin
|
||||
"int8_t" @type.builtin
|
||||
"I16" @type.builtin
|
||||
"int16_t" @type.builtin
|
||||
"I32" @type.builtin
|
||||
"int32_t" @type.builtin
|
||||
"I64" @type.builtin
|
||||
"int64_t" @type.builtin
|
||||
"U8" @type.builtin
|
||||
"uint8_t" @type.builtin
|
||||
"U16" @type.builtin
|
||||
"uint16_t" @type.builtin
|
||||
"U32" @type.builtin
|
||||
"uint32_t" @type.builtin
|
||||
"U64" @type.builtin
|
||||
"uint64_t" @type.builtin
|
||||
|
||||
; Predefined constants
|
||||
"NULL" @constant.builtin
|
||||
"true" @boolean
|
||||
"false" @boolean
|
||||
|
||||
; Identifiers
|
||||
(identifier) @variable
|
||||
|
||||
; Function names
|
||||
(function_definition
|
||||
name: (identifier) @function)
|
||||
|
||||
; Type specifiers
|
||||
(type_specifier) @type
|
||||
(int_type) @type.builtin
|
||||
(uint_type) @type.builtin
|
||||
(array_specifier) @type
|
||||
|
||||
; Type qualifiers
|
||||
(type_qualifier) @type.qualifier
|
||||
|
||||
; Parameters
|
||||
(parameter_declaration
|
||||
name: (identifier) @parameter)
|
||||
|
||||
; Literals
|
||||
(integer_literal) @number
|
||||
(signed_integer_literal) @number
|
||||
(unsigned_integer_literal) @number
|
||||
(string_literal) @string
|
||||
(char_literal) @string.special
|
||||
|
||||
; Operators
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"="
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"/="
|
||||
"=="
|
||||
"!="
|
||||
"<"
|
||||
">"
|
||||
"&&"
|
||||
"||"
|
||||
"!"
|
||||
"++"
|
||||
"--"
|
||||
] @operator
|
||||
|
||||
(leq_operator) @operator
|
||||
(geq_operator) @operator
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
","
|
||||
";"
|
||||
"->"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Comments
|
||||
(comment) @comment
|
||||
|
||||
; Function calls
|
||||
(postfix_expression
|
||||
(base_expression (identifier) @function.call)
|
||||
"(" (argument_expression_list)? ")")
|
||||
|
||||
; Array access
|
||||
(postfix_expression
|
||||
(base_expression (identifier) @variable)
|
||||
"[" (expression) @variable "]")
|
||||
|
||||
; Variable declarations
|
||||
(declaration
|
||||
declarator: (init_declarator
|
||||
name: (identifier) @variable))
|
||||
|
||||
; Variable assignments
|
||||
(assignment_expression
|
||||
(unary_expression
|
||||
(postfix_expression
|
||||
(base_expression (identifier) @variable)))
|
||||
_ @operator)
|
||||
|
||||
; Return statements
|
||||
(jump_statement
|
||||
"return" @keyword.return
|
||||
(expression)? @variable)
|
||||
|
||||
; Print statements
|
||||
(print_statement
|
||||
"print" @keyword
|
||||
(expression) @variable)
|
||||
|
||||
; If statements
|
||||
(selection_statement
|
||||
"if" @keyword.conditional
|
||||
(expression) @variable
|
||||
(statement_block) @block
|
||||
(statement_block)? @block)
|
||||
|
||||
; While loops
|
||||
(iteration_statement
|
||||
"while" @keyword.repeat
|
||||
(expression) @variable
|
||||
(secondary_block) @block)
|
||||
|
||||
; For loops
|
||||
(iteration_statement
|
||||
"for" @keyword.repeat
|
||||
(_)? @variable
|
||||
(expression)? @variable
|
||||
(expression)? @variable
|
||||
(secondary_block) @block)
|
||||
|
||||
; Function signatures
|
||||
(function_signature
|
||||
(parameter_list)? @parameter
|
||||
(return_list)? @type)
|
||||
|
||||
; Cast expressions
|
||||
(cast_expression
|
||||
(type_specifier_qualifier) @type
|
||||
(cast_expression) @variable)
|
||||
|
||||
; Binary expressions
|
||||
[
|
||||
(additive_expression)
|
||||
(multiplicative_expression)
|
||||
(relational_expression)
|
||||
(equality_expression)
|
||||
(logical_expression)
|
||||
] @operator
|
||||
|
||||
; Unary expressions
|
||||
(unary_expression
|
||||
[
|
||||
"++"
|
||||
"--"
|
||||
"+"
|
||||
"-"
|
||||
"!"
|
||||
] @operator
|
||||
(unary_expression) @variable)
|
||||
Reference in New Issue
Block a user