Skip to content

Commit fd0eb8c

Browse files
committed
feat: add comment node that contains plain comments content
1 parent 6b7d1fc commit fd0eb8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

grammar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1533,10 +1533,10 @@ module.exports = grammar({
15331533
// - or just content for the comment
15341534
choice(
15351535
// A tricky edge case where what looks like a doc comment is not
1536-
seq(token.immediate(prec(2, /\/\//)), /.*/),
1536+
seq(token.immediate(prec(3, /\/\//)), field('comment', alias(/.*/, $.comment))),
15371537
// A regular doc comment
15381538
seq($._line_doc_comment_marker, field('doc', alias($._line_doc_content, $.doc_comment))),
1539-
token.immediate(prec(1, /.*/)),
1539+
field('comment', alias(token.immediate(prec(1, /.*/)), $.comment)),
15401540
),
15411541
),
15421542

@@ -1560,7 +1560,7 @@ module.exports = grammar({
15601560
optional(field('doc', alias($._block_comment_content, $.doc_comment))),
15611561
),
15621562
// Non-doc block comments
1563-
$._block_comment_content,
1563+
field('comment', alias($._block_comment_content, $.comment)),
15641564
),
15651565
),
15661566
'*/',

0 commit comments

Comments
 (0)