Skip to content

Commit

Permalink
Merge branch 'master' into feat/vim
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Sep 10, 2023
2 parents f24fac2 + c9e433e commit 3350f4a
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@
branch = master
update = none
ignore = dirty
[submodule "repos/cmake"]
path = repos/cmake
url = https://github.com/uyha/tree-sitter-cmake
branch = master
update = none
ignore = dirty
[submodule "repos/vim"]
path = repos/vim
url = https://github.com/neovim/tree-sitter-vim
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## Unreleased
- Add `Vim` support

## 0.12.48 - 2023-09-10
- Add `CMake` support

## 0.12.47 - 2023-09-08
- Add `Smithy` grammar

Expand Down
129 changes: 129 additions & 0 deletions queries/cmake/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
[
(quoted_argument)
(bracket_argument)
] @string

(variable_ref) @none
(variable) @variable

[
(bracket_comment)
(line_comment)
] @comment

(normal_command (identifier) @function)

["ENV" "CACHE"] @symbol
["$" "{" "}" "<" ">"] @punctuation.special
["(" ")"] @punctuation.bracket

[
(function)
(endfunction)
(macro)
(endmacro)
] @keyword.function

[
(if)
(elseif)
(else)
(endif)
] @conditional

[
(foreach)
(endforeach)
(while)
(endwhile)
] @repeat

;; (function_command
;; (function)
;; . (argument) @function
;; (argument)* @parameter
;; )

;; (macro_command
;; (macro)
;; . (argument) @function.macro
;; (argument)* @parameter
;; )
;;
;; (normal_command
;; (identifier) @function.builtin
;; . (argument) @variable
;; (#match? @function.builtin "\\c^(set)$")
;; )
;;
;; (normal_command
;; (identifier) @function.builtin
;; (#match? @function.builtin "\\c^(set)$")
;; (
;; (argument) @constant
;; (#any-of? @constant "PARENT_SCOPE")
;; ) .
;; )
;;
;; (normal_command
;; (identifier) @function.builtin
;; (#match? @function.builtin "\\c^(set)$")
;; . (argument)
;; (
;; (argument) @_cache @constant
;; .
;; (argument) @_type @constant
;; (#any-of? @_cache "CACHE")
;; (#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL")
;; )
;; )
;; (normal_command
;; (identifier) @function.builtin
;; (#match? @function.builtin "\\c^(set)$")
;; . (argument)
;; (argument) @_cache
;; (#any-of? @_cache "CACHE")
;; (
;; (argument) @_force @constant
;; (#any-of? @_force "FORCE")
;; ) .
;; )

;; ((argument) @boolean
;; (#match? @boolean "\\c^(1|on|yes|true|y|0|off|no|false|n|ignore|notfound|.*-notfound)$")
;; )
;;
;; (if_command
;; (if)
;; (argument) @keyword.operator
;; (#any-of? @keyword.operator "NOT" "AND" "OR"
;; "COMMAND" "POLICY" "TARGET" "TEST" "DEFINED" "IN_LIST"
;; "EXISTS" "IS_NEWER_THAN" "IS_DIRECTORY" "IS_SYMLINK" "IS_ABSOLUTE"
;; "MATCHES"
;; "LESS" "GREATER" "EQUAL" "LESS_EQUAL" "GREATER_EQUAL"
;; "STRLESS" "STRGREATER" "STREQUAL" "STRLESS_EQUAL" "STRGREATER_EQUAL"
;; "VERSION_LESS" "VERSION_GREATER" "VERSION_EQUAL" "VERSION_LESS_EQUAL" "VERSION_GREATER_EQUAL"
;; )
;; )
;;
;; (normal_command
;; (identifier) @function.builtin
;; . (argument)
;; (argument) @constant
;; (#any-of? @constant "ALL" "COMMAND" "DEPENDS" "BYPRODUCTS" "WORKING_DIRECTORY" "COMMENT"
;; "JOB_POOL" "VERBATIM" "USES_TERMINAL" "COMMAND_EXPAND_LISTS" "SOURCES")
;; (#match? @function.builtin "\\c^(add_custom_target)$")
;; )
;;
;; (normal_command
;; (identifier) @function.builtin
;; (argument) @constant
;; (#any-of? @constant "OUTPUT" "COMMAND" "MAIN_DEPENDENCY" "DEPENDS" "BYPRODUCTS" "IMPLICIT_DEPENDS" "WORKING_DIRECTORY"
;; "COMMENT" "DEPFILE" "JOB_POOL" "VERBATIM" "APPEND" "USES_TERMINAL" "COMMAND_EXPAND_LISTS")
;; (#match? @function.builtin "\\c^(add_custom_command)$")
;; )

(escape_sequence) @string.escape

((source_file . (line_comment) @preproc)
(#match? @preproc "^#!/"))
1 change: 1 addition & 0 deletions repos/cmake
Submodule cmake added at 73ab4b
2 changes: 1 addition & 1 deletion tree-sitter-langs-build.el
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ latest commit."
;; ---------------------------------------------------------------------------
;;; Building language grammars.

(defconst tree-sitter-langs--bundle-version "0.12.47"
(defconst tree-sitter-langs--bundle-version "0.12.48"
"Version of the grammar bundle.
This should be bumped whenever a language submodule is updated, which should be
infrequent (grammar-only changes). It is different from the version of
Expand Down
3 changes: 2 additions & 1 deletion tree-sitter-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Tuấn-Anh Nguyễn <[email protected]>
;; Keywords: languages tools parsers tree-sitter
;; Homepage: https://github.com/emacs-tree-sitter/tree-sitter-langs
;; Version: 0.12.47
;; Version: 0.12.48
;; Package-Requires: ((emacs "25.1") (tree-sitter "0.15.0"))
;; SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -109,6 +109,7 @@ See `tree-sitter-langs-repos'."
(clojure-mode . clojure)
(csharp-mode . c-sharp)
(c++-mode . cpp)
(cmake-mode . cmake)
(d-mode . d)
(dart-mode . dart)
(dockerfile-mode . dockerfile)
Expand Down

0 comments on commit 3350f4a

Please sign in to comment.