mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 13:00:08 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
11
runtime/queries/matlab/folds.scm
Normal file
11
runtime/queries/matlab/folds.scm
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[(if_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(switch_statement)
|
||||
(try_statement)
|
||||
(function_definition)
|
||||
(class_definition)
|
||||
(enumeration)
|
||||
(events)
|
||||
(methods)
|
||||
(properties)] @fold
|
||||
154
runtime/queries/matlab/highlights.scm
Normal file
154
runtime/queries/matlab/highlights.scm
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
; Includes
|
||||
|
||||
((command_name) @include
|
||||
(#eq? @include "import"))
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"arguments"
|
||||
"classdef"
|
||||
"end"
|
||||
"enumeration"
|
||||
"events"
|
||||
"global"
|
||||
"methods"
|
||||
"persistent"
|
||||
"properties"
|
||||
] @keyword
|
||||
|
||||
; Conditionals
|
||||
|
||||
(if_statement [ "if" "end" ] @conditional)
|
||||
(elseif_clause "elseif" @conditional)
|
||||
(else_clause "else" @conditional)
|
||||
(switch_statement [ "switch" "end" ] @conditional)
|
||||
(case_clause "case" @conditional)
|
||||
(otherwise_clause "otherwise" @conditional)
|
||||
(break_statement) @conditional
|
||||
|
||||
; Repeats
|
||||
|
||||
(for_statement [ "for" "parfor" "end" ] @repeat)
|
||||
(while_statement [ "while" "end" ] @repeat)
|
||||
(continue_statement) @repeat
|
||||
|
||||
; Exceptions
|
||||
|
||||
(try_statement [ "try" "end" ] @exception)
|
||||
(catch_clause "catch" @exception)
|
||||
|
||||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Constants
|
||||
|
||||
(events (identifier) @constant)
|
||||
(attribute (identifier) @constant)
|
||||
|
||||
"~" @constant.builtin
|
||||
|
||||
; Fields/Properties
|
||||
|
||||
(field_expression field: (identifier) @field)
|
||||
|
||||
(superclass "." (identifier) @property)
|
||||
|
||||
(property_name "." (identifier) @property)
|
||||
|
||||
(property name: (identifier) @property)
|
||||
|
||||
; Types
|
||||
|
||||
(class_definition name: (identifier) @type)
|
||||
|
||||
(attributes (identifier) @constant)
|
||||
|
||||
(enum . (identifier) @type)
|
||||
|
||||
((identifier) @type
|
||||
(#lua-match? @type "^_*[A-Z][a-zA-Z0-9_]+$"))
|
||||
|
||||
; Functions
|
||||
|
||||
(function_definition
|
||||
"function" @keyword.function
|
||||
name: (identifier) @function
|
||||
[ "end" "endfunction" ]? @keyword.function)
|
||||
|
||||
(function_signature name: (identifier) @function)
|
||||
|
||||
(function_call
|
||||
name: (identifier) @function.call)
|
||||
|
||||
(handle_operator (identifier) @function)
|
||||
|
||||
(validation_functions (identifier) @function)
|
||||
|
||||
(command (command_name) @function.call)
|
||||
(command_argument) @parameter
|
||||
|
||||
(return_statement) @keyword.return
|
||||
|
||||
; Parameters
|
||||
|
||||
(function_arguments (identifier) @parameter)
|
||||
|
||||
; Punctuation
|
||||
|
||||
[ ";" "," "." ] @punctuation.delimiter
|
||||
|
||||
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"+"
|
||||
".+"
|
||||
"-"
|
||||
".*"
|
||||
"*"
|
||||
".*"
|
||||
"/"
|
||||
"./"
|
||||
"\\"
|
||||
".\\"
|
||||
"^"
|
||||
".^"
|
||||
"'"
|
||||
".'"
|
||||
"|"
|
||||
"&"
|
||||
"?"
|
||||
"@"
|
||||
"<"
|
||||
"<="
|
||||
">"
|
||||
">="
|
||||
"=="
|
||||
"~="
|
||||
"="
|
||||
"&&"
|
||||
"||"
|
||||
":"
|
||||
] @operator
|
||||
|
||||
; Literals
|
||||
|
||||
(string) @string
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
(formatting_sequence) @string.special
|
||||
|
||||
(number) @number
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
; Comments
|
||||
|
||||
[ (comment) (line_continuation) ] @comment @spell
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
35
runtime/queries/matlab/indents.scm
Normal file
35
runtime/queries/matlab/indents.scm
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"end" @indent.end @indent.branch
|
||||
|
||||
[
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(switch_statement)
|
||||
(try_statement)
|
||||
(function_definition)
|
||||
(class_definition)
|
||||
(enumeration)
|
||||
(events)
|
||||
(methods)
|
||||
(properties)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
"elseif"
|
||||
"else"
|
||||
"case"
|
||||
"otherwise"
|
||||
"catch"
|
||||
] @indent.branch
|
||||
|
||||
((matrix (row) @indent.align)
|
||||
(#set! indent.open_delimiter "[")
|
||||
(#set! indent.close_delimiter "]"))
|
||||
((cell (row) @indent.align)
|
||||
(#set! indent.open_delimiter "{")
|
||||
(#set! indent.close_delimiter "}"))
|
||||
((parenthesis) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
(comment) @indent.auto
|
||||
2
runtime/queries/matlab/injections.scm
Normal file
2
runtime/queries/matlab/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
20
runtime/queries/matlab/locals.scm
Normal file
20
runtime/queries/matlab/locals.scm
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
; References
|
||||
|
||||
(identifier) @reference
|
||||
|
||||
; Definitions
|
||||
|
||||
(function_definition
|
||||
name: (identifier) @definition.function
|
||||
(function_arguments
|
||||
(identifier)* @definition.parameter
|
||||
("," (identifier) @definition.parameter)*)?) @scope
|
||||
|
||||
(assignment left: (identifier) @definition.var)
|
||||
(multioutput_variable (identifier) @definition.var)
|
||||
|
||||
(iterator . (identifier) @definition.var)
|
||||
(lambda (arguments (identifier) @definition.parameter))
|
||||
(global_operator (identifier) @definition.var)
|
||||
(persistent_operator (identifier) @definition.var)
|
||||
(catch_clause (identifier) @definition)
|
||||
Loading…
Add table
Add a link
Reference in a new issue