mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 01:10:02 -04:00
feat: add matlab
This commit is contained in:
parent
f0617c31f4
commit
316200f77d
6 changed files with 136 additions and 0 deletions
16
queries/matlab/folds.scm
Normal file
16
queries/matlab/folds.scm
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[
|
||||
(function_definition)
|
||||
|
||||
(if_statement)
|
||||
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
|
||||
(switch_statement)
|
||||
(case_statement)
|
||||
|
||||
(otherwise_statement)
|
||||
|
||||
(try_statement)
|
||||
(catch_statement)
|
||||
] @fold
|
||||
107
queries/matlab/highlights.scm
Normal file
107
queries/matlab/highlights.scm
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
; Functions
|
||||
|
||||
(function_definition
|
||||
function_name: (identifier) @function
|
||||
(end) @keyword.function)
|
||||
|
||||
(parameter_list (identifier) @parameter)
|
||||
|
||||
; Keywords
|
||||
|
||||
((identifier) @keyword
|
||||
(#eq? @keyword "end"))
|
||||
|
||||
(function_keyword) @keyword.function
|
||||
|
||||
[
|
||||
"return"
|
||||
] @keyword.return
|
||||
|
||||
; Conditionals
|
||||
|
||||
[
|
||||
"if"
|
||||
"elseif"
|
||||
"else"
|
||||
"switch"
|
||||
"case"
|
||||
"otherwise"
|
||||
] @conditional
|
||||
|
||||
(if_statement (end) @conditional)
|
||||
(switch_statement (end) @conditional)
|
||||
|
||||
; Repeats
|
||||
|
||||
[
|
||||
"for"
|
||||
"while"
|
||||
"break"
|
||||
"continue"
|
||||
] @repeat
|
||||
|
||||
(for_statement (end) @repeat)
|
||||
(while_statement (end) @repeat)
|
||||
|
||||
; Exceptions
|
||||
|
||||
[
|
||||
"try"
|
||||
"catch"
|
||||
] @exception
|
||||
|
||||
(try_statement (end) @exception)
|
||||
|
||||
; Punctuation
|
||||
|
||||
[
|
||||
","
|
||||
";"
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[ "{" "}" ] @punctuation.bracket
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
|
||||
[ "(" ")" ] @punctuation.bracket
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
">"
|
||||
"<"
|
||||
"=="
|
||||
"<="
|
||||
">="
|
||||
"=<"
|
||||
"=>"
|
||||
"~="
|
||||
"*"
|
||||
".*"
|
||||
"/"
|
||||
"\\"
|
||||
"./"
|
||||
"^"
|
||||
".^"
|
||||
"+"
|
||||
"="
|
||||
"&&"
|
||||
"||"
|
||||
] @operator
|
||||
|
||||
; Literals
|
||||
|
||||
(number) @number
|
||||
|
||||
(string) @string
|
||||
|
||||
[ "true" "false" ] @boolean
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
1
queries/matlab/injections.scm
Normal file
1
queries/matlab/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(comment) @comment
|
||||
Loading…
Add table
Add a link
Reference in a new issue