Add Fortran queries from @oponkork

This commit is contained in:
Stephan Seitz 2021-04-17 20:42:17 +02:00 committed by Thomas Vigouroux
parent 3b8d23ca30
commit 9820c8ca7d
3 changed files with 105 additions and 1 deletions

View file

@ -147,7 +147,8 @@ We are looking for maintainers to add more parsers and to write query files for
- [ ] [elm](https://github.com/elm-tooling/tree-sitter-elm)
- [x] [erlang](https://github.com/AbstractMachinesLab/tree-sitter-erlang) (maintained by @ostera)
- [x] [fennel](https://github.com/travonted/tree-sitter-fennel) (maintained by @TravonteD)
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @Shatur95)
- [ ] [fortran](https://github.com/stadelmanma/tree-sitter-fortran)
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by not @tjdevries)
- [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @alexlafroscia)
- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268)
- [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley)

11
queries/fortran/folds.scm Normal file
View file

@ -0,0 +1,11 @@
;; by @oponkork
[
(if_statement)
(where_statement)
(enum_statement)
(do_loop_statement)
(derived_type_definition)
(function)
(subroutine)
(interface)
] @fold

View file

@ -0,0 +1,92 @@
;; by @oponkork
(identifier) @variable
(string_literal) @string
(number_literal) @number
(boolean_literal) @boolean
(comment) @comment
[
(intrinsic_type)
; (primitive_type_qualifier)
"dimension"
"intent"
"in"
"out"
"inout"
"type"
"endtype"
"attributes"
"global"
"device"
"host"
"grid_global"
] @type
[
"bind"
"call"
"contains"
"continue"
"cycle"
"endfunction"
"endmodule"
"endprogram"
"endsubroutine"
"enumerator"
"equivalence"
"exit"
"format"
"function"
"goto"
"include"
"interface"
"module"
"parameter"
"print"
"program"
"read"
"return"
"stop"
"subroutine"
"use"
"write"
"implicit"
(none)
(default)
(procedure_qualifier)
(private_statement)
(public_statement)
] @keyword
[
"if"
"then"
"else"
"elseif"
"endif"
] @conditional
[
"do"
"enddo"
"while"
"forall"
] @repeat
[
"<"
">"
"<="
">="
"=="
"/="
] @keyword.operator
; ;; Brackets
; [
; "("
; ")"
; "["
; "]"
; ] @punctuation.bracket