Skip to content

Commit

Permalink
Add more supported languages
Browse files Browse the repository at this point in the history
  • Loading branch information
w4 committed Sep 29, 2024
1 parent c5fd07b commit 112a6d6
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 15 deletions.
132 changes: 132 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ tower-layer = "0.3"
tower-service = "0.3"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tree-sitter-bash = "0.23"
tree-sitter-c = "0.23"
tree-sitter-cpp = "0.23"
tree-sitter-c-sharp = "0.23"
tree-sitter-elixir = "0.3"
tree-sitter-go = "0.23"
tree-sitter-php = "0.23"
tree-sitter-json = "0.23"
tree-sitter-ocaml = "0.23"
tree-sitter-python = "0.23"
tree-sitter-regex = "0.23"
tree-sitter-ruby = "0.23"
tree-sitter-css = "0.23"
tree-sitter-fortran = "0.1"
tree-sitter-haskell = "0.23"
Expand Down
197 changes: 197 additions & 0 deletions grammar/fortran/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
(identifier) @variable
(string_literal) @string
(number_literal) @number
(boolean_literal) @boolean
(comment) @comment

[
(intrinsic_type)
"allocatable"
"attributes"
"device"
"dimension"
"endtype"
"global"
"grid_global"
"host"
"import"
"in"
"inout"
"intent"
"optional"
"out"
"pointer"
"type"
"value"
] @type

[
"contains"
"private"
"public"
] @include

[
(none)
"implicit"
] @attribute

[
"endfunction"
"endprogram"
"endsubroutine"
"function"
"procedure"
"subroutine"
] @keyword.function

[
(default)
(procedure_qualifier)
"abstract"
"bind"
"call"
"class"
"continue"
"cycle"
"endenum"
"endinterface"
"endmodule"
"endprocedure"
"endprogram"
"endsubmodule"
"enum"
"enumerator"
"equivalence"
"exit"
"extends"
"format"
"goto"
"include"
"interface"
"intrinsic"
"non_intrinsic"
"module"
"namelist"
"only"
"parameter"
"print"
"procedure"
"program"
"read"
"stop"
"submodule"
"use"
"write"
] @keyword

"return" @keyword.return

[
"else"
"elseif"
"elsewhere"
"endif"
"endwhere"
"if"
"then"
"where"
] @conditional

[
"do"
"enddo"
"forall"
"while"
] @repeat

[
"*"
"+"
"-"
"/"
"="
"<"
">"
"<="
">="
"=="
"/="
] @operator

[
"\\.and\\."
"\\.or\\."
"\\.lt\\."
"\\.gt\\."
"\\.ge\\."
"\\.le\\."
"\\.eq\\."
"\\.eqv\\."
"\\.neqv\\."
] @keyword.operator

;; Brackets
[
"("
")"
"["
"]"
"<<<"
">>>"
] @punctuation.bracket

;; Delimiter
[
"::"
","
"%"
] @punctuation.delimiter

(parameters
(identifier) @parameter)

(program_statement
(name) @namespace)

(module_statement
(name) @namespace)

(submodule_statement
(module_name) (name) @namespace)

(function_statement
(name) @function)

(subroutine_statement
(name) @function)

(module_procedure_statement
(name) @function)

(end_program_statement
(name) @namespace)

(end_module_statement
(name) @namespace)

(end_submodule_statement
(name) @namespace)

(end_function_statement
(name) @function)

(end_subroutine_statement
(name) @function)

(end_module_procedure_statement
(name) @function)

(subroutine_call
(identifier) @function)

(keyword_argument
name: (identifier) @keyword)

(derived_type_member_expression
(type_member) @property)
Loading

0 comments on commit 112a6d6

Please sign in to comment.