Skip to content

Commit

Permalink
fixes #40 Parser error for strings starting with embedded comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Sep 20, 2024
1 parent b871e77 commit 3043143
Show file tree
Hide file tree
Showing 4 changed files with 10,005 additions and 10,001 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1290,12 +1290,12 @@ module.exports = grammar({
token.immediate(/"[cdw]?/),
),

_unescaped_string_content: ($) => token.immediate(/[^"\\]+/),
// _unescaped_string_content: (_) => token.immediate(/[^"\\]+/),

quoted_string: ($) =>
seq(
choice(/"\/\/+/, /"\/\*"/, /"\/\+/, /"/), // ugly workaround for embedded comment
repeat(choice($._unescaped_string_content, $.escape_sequence)),
'"',
repeat(choice(token.immediate(prec(1, /[^"\\]+/)), $.escape_sequence)),
token.immediate(/"[cdw]?/),
),

Expand Down
22 changes: 11 additions & 11 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3043143

Please sign in to comment.