From 9820c8ca7d24500f14d30332bd4f083c0abbc579 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Sat, 17 Apr 2021 20:42:17 +0200 Subject: Add Fortran queries from @oponkork --- README.md | 3 +- queries/fortran/folds.scm | 11 +++++ queries/fortran/highlights.scm | 92 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 queries/fortran/folds.scm create mode 100644 queries/fortran/highlights.scm diff --git a/README.md b/README.md index e387bbe90..4e45fead6 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/queries/fortran/folds.scm b/queries/fortran/folds.scm new file mode 100644 index 000000000..a2edc64d3 --- /dev/null +++ b/queries/fortran/folds.scm @@ -0,0 +1,11 @@ +;; by @oponkork +[ + (if_statement) + (where_statement) + (enum_statement) + (do_loop_statement) + (derived_type_definition) + (function) + (subroutine) + (interface) +] @fold diff --git a/queries/fortran/highlights.scm b/queries/fortran/highlights.scm new file mode 100644 index 000000000..e31981efa --- /dev/null +++ b/queries/fortran/highlights.scm @@ -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 -- cgit v1.2.3-70-g09d2