mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 14:00:00 -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/fortran/folds.scm
Normal file
11
runtime/queries/fortran/folds.scm
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
;; by @oponkork
|
||||
[
|
||||
(if_statement)
|
||||
(where_statement)
|
||||
(enum_statement)
|
||||
(do_loop_statement)
|
||||
(derived_type_definition)
|
||||
(function)
|
||||
(subroutine)
|
||||
(interface)
|
||||
] @fold
|
||||
332
runtime/queries/fortran/highlights.scm
Normal file
332
runtime/queries/fortran/highlights.scm
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
; Preprocs
|
||||
|
||||
(preproc_file_line) @preproc
|
||||
|
||||
; Namespaces
|
||||
|
||||
(program_statement
|
||||
(name) @namespace)
|
||||
|
||||
(end_program_statement
|
||||
(name) @namespace)
|
||||
|
||||
(module_statement
|
||||
(name) @namespace)
|
||||
|
||||
(end_module_statement
|
||||
(name) @namespace)
|
||||
|
||||
(submodule_statement
|
||||
(name) @namespace)
|
||||
|
||||
(end_submodule_statement
|
||||
(name) @namespace)
|
||||
|
||||
; Includes
|
||||
|
||||
[
|
||||
"import"
|
||||
"include"
|
||||
"use"
|
||||
] @include
|
||||
|
||||
(import_statement
|
||||
","
|
||||
["all" "none"] @keyword)
|
||||
|
||||
; Attributes
|
||||
|
||||
[
|
||||
(none)
|
||||
"implicit"
|
||||
"intent"
|
||||
] @attribute
|
||||
|
||||
(implicit_statement
|
||||
"type" @attribute)
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"attributes"
|
||||
"associate"
|
||||
"block"
|
||||
"class"
|
||||
"classis"
|
||||
"contains"
|
||||
"default"
|
||||
"dimension"
|
||||
"endassociate"
|
||||
"endenum"
|
||||
"endinterface"
|
||||
"endmodule"
|
||||
"endselect"
|
||||
"endsubmodule"
|
||||
"endtype"
|
||||
"enum"
|
||||
"enumerator"
|
||||
"equivalence"
|
||||
"extends"
|
||||
"goto"
|
||||
"interface"
|
||||
"intrinsic"
|
||||
"non_intrinsic"
|
||||
"module"
|
||||
"submodule"
|
||||
"namelist"
|
||||
"parameter"
|
||||
"quiet"
|
||||
"rank"
|
||||
"save"
|
||||
"selectcase"
|
||||
"selectrank"
|
||||
"selecttype"
|
||||
"sequence"
|
||||
"stop"
|
||||
"target"
|
||||
"type"
|
||||
"typeis"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(default)
|
||||
] @keyword
|
||||
|
||||
; Types
|
||||
|
||||
[
|
||||
(type_name)
|
||||
] @type
|
||||
|
||||
[
|
||||
(intrinsic_type)
|
||||
] @type.builtin
|
||||
|
||||
; Qualifiers
|
||||
|
||||
[
|
||||
"abstract"
|
||||
"allocatable"
|
||||
"automatic"
|
||||
"constant"
|
||||
"contiguous"
|
||||
"data"
|
||||
"deferred"
|
||||
"device"
|
||||
"external"
|
||||
"family"
|
||||
"final"
|
||||
"generic"
|
||||
"global"
|
||||
"grid_global"
|
||||
"host"
|
||||
"initial"
|
||||
"local"
|
||||
"local_init"
|
||||
"managed"
|
||||
"nopass"
|
||||
"non_overridable"
|
||||
"optional"
|
||||
"pass"
|
||||
"pinned"
|
||||
"pointer"
|
||||
"private"
|
||||
"property"
|
||||
"protected"
|
||||
"public"
|
||||
"shared"
|
||||
"static"
|
||||
"texture"
|
||||
"value"
|
||||
"volatile"
|
||||
(procedure_qualifier)
|
||||
] @type.qualifier
|
||||
|
||||
[
|
||||
"common"
|
||||
"in"
|
||||
"inout"
|
||||
"out"
|
||||
] @storageclass
|
||||
|
||||
; Labels
|
||||
|
||||
[
|
||||
(statement_label)
|
||||
(statement_label_reference)
|
||||
] @label
|
||||
|
||||
[
|
||||
"call"
|
||||
"endfunction"
|
||||
"endprogram"
|
||||
"endprocedure"
|
||||
"endsubroutine"
|
||||
"function"
|
||||
"procedure"
|
||||
"program"
|
||||
"subroutine"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
"result"
|
||||
"return"
|
||||
] @keyword.return
|
||||
|
||||
; Functions
|
||||
|
||||
(function_statement
|
||||
(name) @function)
|
||||
|
||||
(end_function_statement
|
||||
(name) @function)
|
||||
|
||||
(subroutine_statement
|
||||
(name) @function)
|
||||
|
||||
(end_subroutine_statement
|
||||
(name) @function)
|
||||
|
||||
(module_procedure_statement
|
||||
(name) @function)
|
||||
|
||||
(end_module_procedure_statement
|
||||
(name) @function)
|
||||
|
||||
(subroutine_call
|
||||
(identifier) @function.call)
|
||||
|
||||
[
|
||||
"character"
|
||||
"close"
|
||||
"bind"
|
||||
"format"
|
||||
"open"
|
||||
"print"
|
||||
"read"
|
||||
"write"
|
||||
] @function.builtin
|
||||
|
||||
; Exceptions
|
||||
|
||||
[
|
||||
"error"
|
||||
] @exception
|
||||
|
||||
; Conditionals
|
||||
|
||||
[
|
||||
"else"
|
||||
"elseif"
|
||||
"elsewhere"
|
||||
"endif"
|
||||
"endwhere"
|
||||
"if"
|
||||
"then"
|
||||
"where"
|
||||
] @conditional
|
||||
|
||||
; Repeats
|
||||
|
||||
[
|
||||
"do"
|
||||
"concurrent"
|
||||
"enddo"
|
||||
"endforall"
|
||||
"forall"
|
||||
"while"
|
||||
"continue"
|
||||
"cycle"
|
||||
"exit"
|
||||
] @repeat
|
||||
|
||||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Parameters
|
||||
|
||||
(keyword_argument
|
||||
name: (identifier) @parameter)
|
||||
|
||||
(parameters
|
||||
(identifier) @parameter)
|
||||
|
||||
; Properties
|
||||
|
||||
(derived_type_member_expression
|
||||
(type_member) @property)
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"**"
|
||||
"/"
|
||||
"="
|
||||
"<"
|
||||
">"
|
||||
"<="
|
||||
">="
|
||||
"=="
|
||||
"/="
|
||||
"//"
|
||||
(assumed_rank)
|
||||
] @operator
|
||||
|
||||
[
|
||||
"\\.and\\."
|
||||
"\\.or\\."
|
||||
"\\.eqv\\."
|
||||
"\\.neqv\\."
|
||||
"\\.lt\\."
|
||||
"\\.gt\\."
|
||||
"\\.le\\."
|
||||
"\\.ge\\."
|
||||
"\\.eq\\."
|
||||
"\\.ne\\."
|
||||
"\\.not\\."
|
||||
] @keyword.operator
|
||||
|
||||
; Punctuation
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
|
||||
[ "(" ")" ] @punctuation.bracket
|
||||
|
||||
[ "<<<" ">>>" ] @punctuation.bracket
|
||||
|
||||
(array_literal
|
||||
["(/" "/)"] @punctuation.bracket)
|
||||
|
||||
[
|
||||
":"
|
||||
","
|
||||
"/"
|
||||
"%"
|
||||
"::"
|
||||
"=>"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Literals
|
||||
|
||||
(string_literal) @string
|
||||
|
||||
(number_literal) @number
|
||||
|
||||
(boolean_literal) @boolean
|
||||
|
||||
(null_literal) @constant.builtin
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
((comment) @comment.documentation
|
||||
(#lua-match? @comment.documentation "^!>"))
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
27
runtime/queries/fortran/indents.scm
Normal file
27
runtime/queries/fortran/indents.scm
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[
|
||||
(module)
|
||||
(program)
|
||||
(subroutine)
|
||||
(function)
|
||||
; (interface)
|
||||
(if_statement)
|
||||
(do_loop_statement)
|
||||
(where_statement)
|
||||
(derived_type_definition)
|
||||
(enum)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
(end_module_statement)
|
||||
(end_program_statement)
|
||||
(end_subroutine_statement)
|
||||
(end_function_statement)
|
||||
; (end_interface_statement)
|
||||
(end_if_statement)
|
||||
(end_do_loop_statement)
|
||||
(else_clause)
|
||||
(elseif_clause)
|
||||
(end_type_statement)
|
||||
(end_enum_statement)
|
||||
(end_where_statement)
|
||||
] @indent.branch
|
||||
Loading…
Add table
Add a link
Reference in a new issue