summaryrefslogtreecommitdiff
path: root/queries/regex
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-06-01 00:22:59 +0200
committerStephan Seitz <stephan.seitz@fau.de>2020-06-14 13:09:38 +0200
commit45ea0df21a8494c7a8258bbb98ebd510716148e9 (patch)
tree7d6468805fb54b9cfcadb4b2c4e8de0e585d3cf5 /queries/regex
parenta06792450799f7cfe24cebac099cb47d640a2be3 (diff)
Add tree-sitter-regex
This might be interesting for injected highlighting
Diffstat (limited to 'queries/regex')
-rw-r--r--queries/regex/highlights.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/queries/regex/highlights.scm b/queries/regex/highlights.scm
new file mode 100644
index 00000000..48242543
--- /dev/null
+++ b/queries/regex/highlights.scm
@@ -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