Merge pull request #70 from theHamsta/regex

Add tree-sitter-regex
This commit is contained in:
Thomas Vigouroux 2020-06-14 14:34:55 +02:00 committed by GitHub
commit 90ec2d5250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 0 deletions

View file

@ -180,6 +180,7 @@ List of currently supported languages:
- [ ] yaml
- [ ] nix
- [ ] markdown
- [x] regex (maintained by @theHamsta)
## Troubleshooting
Before doing anything run `:checkhealth nvim_treesitter`. This will help you find where the bug might come from.

View file

@ -203,6 +203,13 @@ parsers.nix = {
}
}
parsers.regex = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-regex",
files = { "src/parser.c" }
}
}
-- @enable can be true or false
-- @disable is a list of languages, only relevant if enable is true
-- @keymaps list of user mappings for a given module if relevant

View file

@ -0,0 +1,29 @@
;; Forked from tree-sitter-regex
;; The MIT License (MIT) Copyright (c) 2014 Max Brunsfeld
[
"("
")"
"(?"
"(?:"
"(?<"
">"
"["
"]"
"{"
"}"
] @punctuation.bracket
(group_name) @property
[
(identity_escape)
(control_letter_escape)
(character_class_escape)
(control_escape)
(start_assertion)
(end_assertion)
(boundary_assertion)
(non_boundary_assertion)
] @escape
[ "*" "+" "|" "=" "<=" "!" "<!" ] @operator