Skip to content

Commit 66aabee

Browse files
committed
Switch from -- to # for single-line comments.
The minus sign was causing some weird conflict in the parser. Maybe it got confused with negative numbers.
1 parent 158e8e9 commit 66aabee

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

grammar.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ module.exports = grammar({
497497
"'",
498498
repeat(choice(
499499
/[^'\\\n]/,
500-
'--',
501500
$.escape_sequence
502501
)),
503502
"'"
@@ -506,7 +505,6 @@ module.exports = grammar({
506505
'"',
507506
repeat(choice(
508507
/[^"\\\n]/,
509-
'--',
510508
$.escape_sequence
511509
)),
512510
'"'
@@ -522,7 +520,6 @@ module.exports = grammar({
522520
/[^"\\]/,
523521
'"',
524522
'""',
525-
'--',
526523
$.escape_sequence
527524
)),
528525
'"""'
@@ -533,7 +530,6 @@ module.exports = grammar({
533530
/[^'\\]/,
534531
"'",
535532
"''",
536-
'--',
537533
$.escape_sequence
538534
)),
539535
"'''"
@@ -543,7 +539,7 @@ module.exports = grammar({
543539
number: $ => seq(optional('-'), /\d+/),
544540

545541
comment: $ => token(prec(-1, choice(
546-
seq("--", /.*/),
542+
/#[^\r\n]*/,
547543
seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, "/")
548544
))),
549545

0 commit comments

Comments
 (0)