From f58a4a4bc55b9b43dfa7c4106257422764f97776 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Wed, 25 Oct 2023 12:01:17 +0300 Subject: [PATCH] Use standard capture names --- .gitignore | 1 + package.json | 4 ++-- queries/highlights.scm | 15 ++++++--------- test/highlight/test.gitattributes | 14 +++++++------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 4ffedfd..f4be042 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Cargo.lock build/ target/ *.wasm +*.o diff --git a/package.json b/package.json index af94f26..d6d08e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tree-sitter-gitattributes", - "version": "0.1.3", + "version": "0.1.4", "license": "MIT", "description": "gitattributes grammar for tree-sitter", "repository": "ObserverOfTime/tree-sitter-gitattributes", @@ -22,7 +22,7 @@ }, "main": "bindings/node", "dependencies": { - "nan": "^2.17.0" + "nan": "^2.18.0" }, "devDependencies": { "tree-sitter-cli": "^0.20.8" diff --git a/queries/highlights.scm b/queries/highlights.scm index 1a8221b..2d78f06 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -1,28 +1,28 @@ (dir_sep) @punctuation.delimiter (quoted_pattern - ("\"" @punctuation.special)) + "\"" @punctuation.special) (range_notation) @string.special (range_notation [ "[" "]" ] @punctuation.bracket) -(wildcard) @character.special +(wildcard) @string.regexp (range_negation) @operator (character_class) @constant -(class_range ("-" @operator)) +(class_range "-" @operator) [ (ansi_c_escape) (escaped_char) -] @string.escape +] @escape (attribute - (attr_name) @parameter) + (attr_name) @variable.parameter) (attribute (builtin_attr) @variable.builtin) @@ -37,7 +37,7 @@ (string_value) @string -(macro_tag) @preproc +(macro_tag) @keyword (macro_def macro_name: (_) @property) @@ -48,7 +48,4 @@ (trailing_slash) ] @error -(ERROR) @error - (comment) @comment -(comment) @spell diff --git a/test/highlight/test.gitattributes b/test/highlight/test.gitattributes index 1d398db..94498db 100644 --- a/test/highlight/test.gitattributes +++ b/test/highlight/test.gitattributes @@ -1,5 +1,5 @@ [attr]nodiff -diff -merge -# <- preproc +# <- keyword # ^^^^^^ property # ^ operator # ^^^^ variable.builtin @@ -8,8 +8,8 @@ vendor/** linguist-vendored=true # ^ punctuation.delimiter -# ^^ character.special -# ^^^^^^^^^^^^^^^^^ parameter +# ^^ string.regexp +# ^^^^^^^^^^^^^^^^^ variable.parameter # ^ operator # ^^^^ boolean @@ -22,13 +22,13 @@ vendor/** linguist-vendored=true # ^^^^^^^^^ constant # ^ punctuation.bracket # ^ operator -# ^^^^^^^^^^ parameter +# ^^^^^^^^^^ variable.parameter "_\u4E00\t\56txt" encoding=UTF-16 # <- punctuation.special -# ^^^^^^ string.escape -# ^^ string.escape -# ^^^ string.escape +# ^^^^^^ escape +# ^^ escape +# ^^^ escape # ^ punctuation.special # ^^^^^^^^ variable.builtin # ^ operator