@willbooster/tree-sitter-kotlin 1.6.6 → 1.7.1

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/README.md CHANGED
@@ -107,8 +107,6 @@ the download fails or the release has no binary that runs here.
107
107
  (ten times the lines take about ten times the CPU time, under a ceiling), since consumers parse files while they are
108
108
  being edited. It loads the Wasm build through @willbooster/web-tree-sitter, which `bun run build/ci` rebuilds after
109
109
  regenerating the parser;
110
- - a check that comments, strings, escapes, string templates, character literals, and shebang lines containing NUL
111
- characters parse (`test/unit/nulCharacters.test.ts`);
112
110
  - a check that `package.json` and `Cargo.lock` test the same runtime version (`test/unit/runtimeVersion.test.ts`);
113
111
  - checks that the Wasm build parses Kotlin through @willbooster/web-tree-sitter in Chromium
114
112
  (`test/unit/browser.test.ts`) and in Cloudflare Workers with and without Node.js compatibility
package/grammar.js CHANGED
@@ -23,6 +23,7 @@ module.exports = grammar({
23
23
  name: 'kotlin',
24
24
 
25
25
  conflicts: ($) => [
26
+ [$.if_expression, $.parenthesized_expression],
26
27
  [$.class_body, $.enum_class_body],
27
28
 
28
29
  [$.binary_expression, $.call_expression],
@@ -125,6 +126,7 @@ module.exports = grammar({
125
126
  $._keyword_reference,
126
127
  // never scanned: see `_template_name`
127
128
  $._keyword_reference_end,
129
+ 'where',
128
130
  ],
129
131
 
130
132
  inline: ($) => [$._statements, $._identifier, $._control_structure_body],
@@ -773,6 +775,7 @@ module.exports = grammar({
773
775
  when_entry: ($) =>
774
776
  seq(
775
777
  choice(seq(commaSep1(field('condition', $._when_condition)), optional(',')), 'else'),
778
+ optional(seq('if', field('guard', $.expression))),
776
779
  '->',
777
780
  field('body', choice($.block, $.statement)),
778
781
  optional($._semi)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-kotlin",
3
- "version": "1.6.6",
3
+ "version": "1.7.1",
4
4
  "description": "Kotlin grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -41,10 +41,10 @@
41
41
  "devDependencies": {
42
42
  "@tsconfig/bun": "1.0.11",
43
43
  "@types/bun": "1.4.2",
44
- "@vitest/browser-playwright": "5.0.1",
44
+ "@vitest/browser-playwright": "5.0.2",
45
45
  "@willbooster/oxfmt-config": "1.2.2",
46
46
  "@willbooster/oxlint-config": "1.4.8",
47
- "@willbooster/wb": "22.13.1",
47
+ "@willbooster/wb": "22.18.0",
48
48
  "@willbooster/web-tree-sitter": "1.0.16",
49
49
  "conventional-changelog-conventionalcommits": "10.4.0",
50
50
  "lefthook": "2.1.14",
@@ -56,9 +56,9 @@
56
56
  "sort-package-json": "4.0.0",
57
57
  "tree-sitter-cli": "0.27.0",
58
58
  "typescript": "7.0.2",
59
- "vite": "8.3.0",
60
- "vitest": "5.0.1",
61
- "wrangler": "4.136.2"
59
+ "vite": "8.3.1",
60
+ "vitest": "5.0.2",
61
+ "wrangler": "4.141.0"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@willbooster/web-tree-sitter": "^1.0.0"
@@ -2647,6 +2647,16 @@
2647
2647
  "named": true
2648
2648
  }
2649
2649
  ]
2650
+ },
2651
+ "guard": {
2652
+ "multiple": false,
2653
+ "required": false,
2654
+ "types": [
2655
+ {
2656
+ "type": "expression",
2657
+ "named": true
2658
+ }
2659
+ ]
2650
2660
  }
2651
2661
  }
2652
2662
  },
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "metadata": {
16
- "version": "1.6.6",
16
+ "version": "1.7.1",
17
17
  "license": "MIT",
18
18
  "description": "Kotlin grammar for tree-sitter",
19
19
  "authors": [