Skip to content

Commit

Permalink
Allow backslashes to escape newlines anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Mar 3, 2024
1 parent 34d42c7 commit 628dfdd
Show file tree
Hide file tree
Showing 6 changed files with 1,673 additions and 1,430 deletions.
4 changes: 3 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ module.exports = grammar({
$.error_recovery,
],

extras: ($) => [$.comment, /\s/],
// Allow comments, backslash-escaped newlines (with optional trailing whitespace),
// and whitespace anywhere
extras: ($) => [$.comment, /\\(\n|\r\n)\s*/, /\s/],

inline: ($) => [
$._string,
Expand Down
4 changes: 4 additions & 0 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 628dfdd

Please sign in to comment.