diff --git a/CHANGELOG.md b/CHANGELOG.md index 251a2b8a..ade42f0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + Changed the return type of `ts-node-type`. - Renamed `ts-type-named-p` to `ts-lang-node-type-named-p`. - Added optional param `NODE-TYPE` to `tree-sitter-node-at-point`. +- Upgraded `tree-sitter` crate to get support for `.not-match?` predicate. ## [0.9.2] - 2020-07-20 - Upgraded `tree-sitter` crate to add `.` as a valid start of predicates, in addition to `#`. diff --git a/Cargo.lock b/Cargo.lock index 095425bf..4b08e2d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -475,7 +475,7 @@ dependencies = [ [[package]] name = "tree-sitter" version = "0.16.1" -source = "git+https://github.com/tree-sitter/tree-sitter#1b8426bb65461ba8aa4936a469da10c3a113ca72" +source = "git+https://github.com/tree-sitter/tree-sitter#af655547e5817efbdf350935555b4aaf2642c618" dependencies = [ "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/doc/emacs-tree-sitter.org b/doc/emacs-tree-sitter.org index b3dda127..b9f790fe 100644 --- a/doc/emacs-tree-sitter.org +++ b/doc/emacs-tree-sitter.org @@ -274,7 +274,7 @@ A *predicate* form can appear anywhere in a group form. It is a list form whose (.match? @constant "^[A-Z][A-Z_\\d]+")) #+end_src -Currently, the supported predicates for syntax highlighting are ~.match?~, ~.eq?~ and ~.not-eq?~. +Currently, the supported predicates for syntax highlighting are ~.match?~, ~.not-match?~, ~.eq?~ and ~.not-eq?~. *** Alternations An *alternation* form is a vector of patterns. It denotes a pattern that matches a node when any of the alternative patterns matches. @@ -361,8 +361,8 @@ Adding language-specific patterns: #+begin_src emacs-lisp ;; Highlight Python's single-quoted strings as constants. (tree-sitter-hl-add-patterns 'python - ((string) @constant - (.match? @constant "^'"))) + [((string) @constant + (.match? @constant "^'"))]) #+end_src Adding buffer-local patterns: