@konomanoasa/tree-sitter-gitattributes 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "konomanoasa-tree-sitter-gitattributes"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  edition = "2024"
5
5
  description = "Tree-sitter grammar for gitattributes."
6
6
  readme = "README.md"
@@ -27,10 +27,10 @@ name = "bindings"
27
27
  path = "test/bindings.test.rs"
28
28
 
29
29
  [dependencies]
30
- tree-sitter-language = "0.1.8"
30
+ tree-sitter-language = "=0.1.9"
31
31
 
32
32
  [dev-dependencies]
33
- tree-sitter = "0.27.1"
33
+ tree-sitter = "=0.27.1"
34
34
 
35
35
  [build-dependencies]
36
- cc = "1.4"
36
+ cc = "=1.10.0"
package/README.md CHANGED
@@ -15,8 +15,6 @@ npm install @konomanoasa/tree-sitter-gitattributes
15
15
 
16
16
  ## Development
17
17
 
18
- Development uses Node.js 24.21.0 or later.
19
-
20
18
  ```sh
21
19
  npm install
22
20
  npm run build
@@ -30,7 +28,7 @@ npm test
30
28
 
31
29
  ## Used By
32
30
 
33
- [gitfile-ts-mode](https://github.com/konomanoasa/gitfile-ts-mode): Emacs major mode.
31
+ [gitfile-ts-mode](https://github.com/konomanoasa/gitfile-ts-mode)
34
32
 
35
33
  ## License
36
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konomanoasa/tree-sitter-gitattributes",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "Tree-sitter grammar for gitattributes.",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "scripts": {
23
23
  "build": "npm run tree-sitter -- build-all",
24
- "check": "biome check . && tsc --noEmit",
24
+ "check": "biome check . && tsc",
25
25
  "check:queries": "npm run tree-sitter -- check-queries",
26
26
  "format": "biome format --write .",
27
27
  "generate": "npm run tree-sitter -- generate-all",
@@ -35,7 +35,7 @@
35
35
  "tree-sitter": "node scripts/tree-sitter.js"
36
36
  },
37
37
  "devDependencies": {
38
- "@biomejs/biome": "2.5.15",
38
+ "@biomejs/biome": "2.6.2",
39
39
  "@types/node": "26.6.5",
40
40
  "tree-sitter-cli": "0.27.1",
41
41
  "typescript": "7.0.2"
package/src/parser.c CHANGED
@@ -5601,7 +5601,7 @@ TS_PUBLIC const TSLanguage *tree_sitter_gitattributes(void) {
5601
5601
  .metadata = {
5602
5602
  .major_version = 0,
5603
5603
  .minor_version = 4,
5604
- .patch_version = 1,
5604
+ .patch_version = 2,
5605
5605
  },
5606
5606
  };
5607
5607
  return &language;
package/src/scanner.c CHANGED
@@ -156,6 +156,11 @@ static bool consume(
156
156
  return emit(lexer, valid, token);
157
157
  }
158
158
 
159
+ static bool
160
+ take(Scanner *s, TSLexer *lexer, const bool *valid, enum Token token) {
161
+ return consume(s, lexer, valid, token, s->position + 1);
162
+ }
163
+
159
164
  static bool text_run(
160
165
  Scanner *s,
161
166
  TSLexer *lexer,
@@ -199,7 +204,6 @@ static int32_t simple_escape(int32_t c) {
199
204
  }
200
205
  }
201
206
 
202
- // Backslash already consumed.
203
207
  static void quoted_escape(Cursor *r) {
204
208
  const int32_t c = r->lexer->lookahead;
205
209
  r->kind = QUOTED_ESCAPE;
@@ -691,25 +695,23 @@ static bool scan(Scanner *s, TSLexer *lexer, const bool *valid) {
691
695
  (valid[UNSET_MARKER] || valid[UNSPECIFIED_MARKER]) &&
692
696
  s->position < s->name_start
693
697
  )
694
- return consume(
698
+ return take(
695
699
  s,
696
700
  lexer,
697
701
  valid,
698
- lexer->lookahead == '-' ? UNSET_MARKER : UNSPECIFIED_MARKER,
699
- s->position + 1
702
+ lexer->lookahead == '-' ? UNSET_MARKER : UNSPECIFIED_MARKER
700
703
  );
701
704
  if (valid[NAME_TEXT]) return name_piece(s, lexer, valid);
702
705
  if (valid[VALUE_TEXT])
703
706
  return text_run(s, lexer, valid, VALUE_TEXT, s->token_end);
704
707
  if (valid[ASSIGNMENT_OPERATOR] && lexer->lookahead == '=')
705
- return consume(s, lexer, valid, ASSIGNMENT_OPERATOR, s->position + 1);
708
+ return take(s, lexer, valid, ASSIGNMENT_OPERATOR);
706
709
  if (
707
710
  (valid[QUOTE_CLOSE] || valid[MISSING_QUOTE_CLOSE]) &&
708
711
  s->quoted &&
709
712
  s->position == s->content_end
710
713
  ) {
711
- if (s->content_end < s->line_end)
712
- return consume(s, lexer, valid, QUOTE_CLOSE, s->position + 1);
714
+ if (s->content_end < s->line_end) return take(s, lexer, valid, QUOTE_CLOSE);
713
715
  return emit(
714
716
  lexer,
715
717
  valid,
@@ -721,12 +723,11 @@ static bool scan(Scanner *s, TSLexer *lexer, const bool *valid) {
721
723
  if (s->position >= s->line_end)
722
724
  return lexer->eof(lexer) && emit(lexer, valid, END_OF_FILE);
723
725
  if (s->kind == COMMENT_START) {
724
- if (s->position == s->leading)
725
- return consume(s, lexer, valid, COMMENT_MARKER, s->position + 1);
726
+ if (s->position == s->leading) return take(s, lexer, valid, COMMENT_MARKER);
726
727
  return text_run(s, lexer, valid, COMMENT_TEXT, s->line_end);
727
728
  }
728
729
  if (valid[QUOTE_OPEN] && s->quoted && s->position == s->leading)
729
- return consume(s, lexer, valid, QUOTE_OPEN, s->position + 1);
730
+ return take(s, lexer, valid, QUOTE_OPEN);
730
731
  if (valid[MACRO_MARKER])
731
732
  return consume(s, lexer, valid, MACRO_MARKER, s->name_start);
732
733
  if (valid[SEPARATOR] || valid[LAYOUT]) {
package/tree-sitter.json CHANGED
@@ -12,7 +12,7 @@
12
12
  }
13
13
  ],
14
14
  "metadata": {
15
- "version": "0.4.1",
15
+ "version": "0.4.2",
16
16
  "license": "MIT",
17
17
  "description": "Tree-sitter grammar for gitattributes.",
18
18
  "links": {