Skip to content

Commit 3c655d6

Browse files
committed
Improve external scanner & fix token conflicts
1 parent 4ade785 commit 3c655d6

15 files changed

+820042
-821535
lines changed

grammar.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ module.exports = grammar({
121121
$._automatic_semicolon,
122122
$._import_list_delimiter,
123123
$.safe_nav,
124+
$._class,
124125
],
125126

126127
extras: $ => [
@@ -215,7 +216,7 @@ module.exports = grammar({
215216
class_declaration: $ => prec.right(
216217
seq(
217218
optional($.modifiers),
218-
"class",
219+
prec(1, $._class),
219220
field("identifier", alias($.simple_identifier, $.type_identifier)),
220221
optional($.type_parameters),
221222
optional($.primary_constructor),
@@ -242,7 +243,7 @@ module.exports = grammar({
242243
seq(
243244
optional($.modifiers),
244245
"enum",
245-
"class",
246+
$._class,
246247
field("identifier", alias($.simple_identifier, $.type_identifier)),
247248
optional($.type_parameters),
248249
optional($.primary_constructor),
@@ -1032,12 +1033,13 @@ module.exports = grammar({
10321033

10331034
_type_modifier: $ => choice($.annotation, "suspend"),
10341035

1035-
class_modifier: $ => choice(
1036+
class_modifier: $ => token(prec(1, choice(
10361037
"sealed",
10371038
"annotation",
10381039
"data",
1039-
"inner"
1040-
),
1040+
"inner",
1041+
"value"
1042+
))),
10411043

10421044
member_modifier: $ => choice(
10431045
"override",
@@ -1090,10 +1092,10 @@ module.exports = grammar({
10901092

10911093
reification_modifier: $ => "reified",
10921094

1093-
platform_modifier: $ => choice(
1095+
platform_modifier: $ => token(prec(1, choice(
10941096
"expect",
10951097
"actual"
1096-
),
1098+
))),
10971099

10981100
// ==========
10991101
// Annotations

0 commit comments

Comments
 (0)