Make hidden scanned tokens visible as regular literals (#10)

This commit is contained in:
Jonatan Kłosko 2021-10-14 20:10:10 +02:00 committed by GitHub
parent dda17b01c2
commit 5d3f7edbc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -271,7 +271,10 @@ module.exports = grammar({
), ),
quoted_atom: ($) => quoted_atom: ($) =>
seq($._quoted_atom_start, choice($._quoted_i_double, $._quoted_i_single)), seq(
alias($._quoted_atom_start, ":"),
choice($._quoted_i_double, $._quoted_i_single)
),
// Defines $._quoted_content_i_{name} and $._quoted_content_{name} rules, // Defines $._quoted_content_i_{name} and $._quoted_content_{name} rules,
// content with and without interpolation respectively // content with and without interpolation respectively
@ -468,7 +471,12 @@ module.exports = grammar({
binaryOp($, prec.left, PREC.COMP_OPS, choice(...COMP_OPS)), binaryOp($, prec.left, PREC.COMP_OPS, choice(...COMP_OPS)),
binaryOp($, prec.left, PREC.REL_OPS, choice(...REL_OPS)), binaryOp($, prec.left, PREC.REL_OPS, choice(...REL_OPS)),
binaryOp($, prec.left, PREC.ARROW_OPS, choice(...ARROW_OPS)), binaryOp($, prec.left, PREC.ARROW_OPS, choice(...ARROW_OPS)),
binaryOp($, prec.left, PREC.IN_OPS, choice("in", $._not_in)), binaryOp(
$,
prec.left,
PREC.IN_OPS,
choice("in", alias($._not_in, "not in"))
),
binaryOp($, prec.left, PREC.XOR_OP, "^^^"), binaryOp($, prec.left, PREC.XOR_OP, "^^^"),
binaryOp($, prec.right, PREC.TERNARY_OP, "//"), binaryOp($, prec.right, PREC.TERNARY_OP, "//"),
binaryOp($, prec.right, PREC.CONCAT_OPS, choice(...CONCAT_OPS)), binaryOp($, prec.right, PREC.CONCAT_OPS, choice(...CONCAT_OPS)),
@ -513,7 +521,7 @@ module.exports = grammar({
...REL_OPS, ...REL_OPS,
...ARROW_OPS, ...ARROW_OPS,
"in", "in",
$._not_in, alias($._not_in, "not in"),
"^^", "^^",
...CONCAT_OPS, ...CONCAT_OPS,
...MULT_OPS, ...MULT_OPS,