Skip to content

Commit

Permalink
Upgrade tree-sitter-crate to get support for .not-match? predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
ubolonton committed Aug 1, 2020
1 parent 4e65ab5 commit 2d822cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `#`.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 3 additions & 3 deletions doc/emacs-tree-sitter.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2d822cc

Please sign in to comment.