feat(fortran): Improve highlighting

This commit is contained in:
oponkork 2021-05-21 07:49:14 +05:30 committed by Thomas Vigouroux
parent 9742f188ff
commit 6b6bf4db3f

View file

@ -1,5 +1,3 @@
;; by @oponkork with extensions by @theHamsta
(identifier) @variable (identifier) @variable
(string_literal) @string (string_literal) @string
(number_literal) @number (number_literal) @number
@ -8,7 +6,6 @@
[ [
(intrinsic_type) (intrinsic_type)
; (primitive_type_qualifier)
"dimension" "dimension"
"intent" "intent"
"in" "in"
@ -21,11 +18,10 @@
"device" "device"
"host" "host"
"grid_global" "grid_global"
"pointer"
] @type ] @type
[ [
"module"
"endmodule"
"contains" "contains"
"public" "public"
"private" "private"
@ -45,8 +41,11 @@
] @keyword.function ] @keyword.function
[ [
"module"
"endmodule"
"bind" "bind"
"call" "call"
"class"
"continue" "continue"
"cycle" "cycle"
"enumerator" "enumerator"
@ -56,14 +55,20 @@
"goto" "goto"
"include" "include"
"interface" "interface"
"endinterface"
"only"
"parameter" "parameter"
"procedure"
"print" "print"
"program" "program"
"endprogram"
"read" "read"
"return" "return"
"stop" "stop"
"use" "use"
"write" "write"
"enum"
"endenum"
(default) (default)
(procedure_qualifier) (procedure_qualifier)
] @keyword ] @keyword
@ -74,6 +79,8 @@
"else" "else"
"elseif" "elseif"
"endif" "endif"
"where"
"endwhere"
] @conditional ] @conditional
[ [
@ -121,16 +128,41 @@
[ [
"::" "::"
"," ","
] @punctuation.bracket "%"
] @punctuation.delimiter
(parameters (parameters
(identifier) @parameter) (identifier) @parameter)
(program_statement
(name) @namespace)
(module_statement
(name) @namespace)
(function_statement
(name) @function)
(subroutine_statement (subroutine_statement
(name) @function) (name) @function)
(end_program_statement
(name) @namespace)
(end_module_statement
(name) @namespace)
(end_function_statement
(name) @function)
(end_subroutine_statement
(name) @function)
(subroutine_call (subroutine_call
(name) @function) (name) @function)
(module_statement (keyword_argument
(name) @namespace) name: (identifier) @keyword)
(derived_type_member_expression
(type_member) @property)