Update Fortran highlighting

pull/13802/head
bclmary 2025-06-19 21:51:12 +02:00 committed by GitHub
parent 449c09e758
commit 742a7eecbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 159 additions and 134 deletions

View File

@ -1,93 +1,112 @@
(identifier) @variable
(string_literal) @string
(number_literal) @number
(boolean_literal) @boolean
(comment) @comment
[ [
(intrinsic_type) (intrinsic_type)
"dimension" "allocatable"
"intent"
"in"
"out"
"inout"
"type"
"endtype"
"attributes" "attributes"
"global"
"device" "device"
"host" "dimension"
"endtype"
"global"
"grid_global" "grid_global"
"host"
"import"
"in"
"inout"
"intent"
"optional"
"out"
"pointer" "pointer"
] @keyword.storage.modifier "type"
"value"
] @type
[ [
"contains" "contains"
"public"
"private" "private"
] @keyword.directive "public"
] @include
[ [
"implicit" (none)
(none) "implicit"
] @attribute ] @attribute
[ [
"function"
"endfunction" "endfunction"
"endprogram" "endprogram"
"subroutine"
"endsubroutine" "endsubroutine"
] @keyword.storage "function"
"procedure"
"subroutine"
] @keyword.function
[ [
"module" (default)
"endmodule" (procedure_qualifier)
"abstract"
"bind" "bind"
"call" "call"
"class" "class"
"continue" "continue"
"cycle" "cycle"
"endenum"
"endinterface"
"endmodule"
"endprocedure"
"endprogram"
"endsubmodule"
"enum"
"enumerator" "enumerator"
"equivalence" "equivalence"
"exit" "exit"
"extends"
"format" "format"
"goto" "goto"
"include" "include"
"interface" "interface"
"endinterface" "intrinsic"
"non_intrinsic"
"module"
"namelist"
"only" "only"
"parameter" "parameter"
"procedure"
"print" "print"
"procedure"
"program" "program"
"endprogram"
"read" "read"
"return"
"result"
"stop" "stop"
"submodule"
"use" "use"
"write" "write"
"enum" ] @keyword
"endenum"
(default) "return" @keyword.return
(procedure_qualifier)
] @keyword
[ [
"if"
"then"
"else" "else"
"elseif" "elseif"
"elsewhere"
"endif" "endif"
"where"
"endwhere" "endwhere"
] @keyword.control.conditional "if"
"then"
"where"
] @conditional
[ [
"do" "do"
"enddo" "enddo"
"while"
"forall" "forall"
] @keyword.control.repeat "while"
] @repeat
[ [
"*" "*"
"**"
"+" "+"
"-" "-"
"/" "/"
@ -98,7 +117,7 @@
">=" ">="
"==" "=="
"/=" "/="
] @operator ] @operator
[ [
"\\.and\\." "\\.and\\."
@ -110,27 +129,27 @@
"\\.eq\\." "\\.eq\\."
"\\.eqv\\." "\\.eqv\\."
"\\.neqv\\." "\\.neqv\\."
] @keyword.operator ] @keyword.operator
(identifier) @variable ;; Brackets
[
;; Brackets
[
"(" "("
")" ")"
"[" "["
"]" "]"
"<<<"
">>>"
] @punctuation.bracket ] @punctuation.bracket
;; Delimiter ;; Delimiter
[ [
"::" "::"
"," ","
"%" "%"
] @punctuation.delimiter ] @punctuation.delimiter
(parameters (parameters
(identifier) @variable.parameter) (identifier) @parameter)
(program_statement (program_statement
(name) @namespace) (name) @namespace)
@ -138,35 +157,41 @@
(module_statement (module_statement
(name) @namespace) (name) @namespace)
(submodule_statement
(module_name) (name) @namespace)
(function_statement (function_statement
(name) @function) (name) @function)
(subroutine_statement (subroutine_statement
(name) @function) (name) @function)
(module_procedure_statement
(name) @function)
(end_program_statement (end_program_statement
(name) @namespace) (name) @namespace)
(end_module_statement (end_module_statement
(name) @namespace) (name) @namespace)
(end_submodule_statement
(name) @namespace)
(end_function_statement (end_function_statement
(name) @function) (name) @function)
(end_subroutine_statement (end_subroutine_statement
(name) @function) (name) @function)
(subroutine_call (end_module_procedure_statement
(name) @function) (name) @function)
(subroutine_call
(identifier) @function)
(keyword_argument (keyword_argument
name: (identifier) @keyword) name: (identifier) @keyword)
(derived_type_member_expression (derived_type_member_expression
(type_member) @variable.other.member) (type_member) @property)
(string_literal) @string
(number_literal) @constant.numeric
(boolean_literal) @constant.builtin.boolean
(comment) @comment