Skip to content

Commit 5d3f7ed

Browse files
Make hidden scanned tokens visible as regular literals (#10)
1 parent dda17b0 commit 5d3f7ed

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

grammar.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ module.exports = grammar({
271271
),
272272

273273
quoted_atom: ($) =>
274-
seq($._quoted_atom_start, choice($._quoted_i_double, $._quoted_i_single)),
274+
seq(
275+
alias($._quoted_atom_start, ":"),
276+
choice($._quoted_i_double, $._quoted_i_single)
277+
),
275278

276279
// Defines $._quoted_content_i_{name} and $._quoted_content_{name} rules,
277280
// content with and without interpolation respectively
@@ -468,7 +471,12 @@ module.exports = grammar({
468471
binaryOp($, prec.left, PREC.COMP_OPS, choice(...COMP_OPS)),
469472
binaryOp($, prec.left, PREC.REL_OPS, choice(...REL_OPS)),
470473
binaryOp($, prec.left, PREC.ARROW_OPS, choice(...ARROW_OPS)),
471-
binaryOp($, prec.left, PREC.IN_OPS, choice("in", $._not_in)),
474+
binaryOp(
475+
$,
476+
prec.left,
477+
PREC.IN_OPS,
478+
choice("in", alias($._not_in, "not in"))
479+
),
472480
binaryOp($, prec.left, PREC.XOR_OP, "^^^"),
473481
binaryOp($, prec.right, PREC.TERNARY_OP, "//"),
474482
binaryOp($, prec.right, PREC.CONCAT_OPS, choice(...CONCAT_OPS)),
@@ -513,7 +521,7 @@ module.exports = grammar({
513521
...REL_OPS,
514522
...ARROW_OPS,
515523
"in",
516-
$._not_in,
524+
alias($._not_in, "not in"),
517525
"^^",
518526
...CONCAT_OPS,
519527
...MULT_OPS,

0 commit comments

Comments
 (0)