Skip to content

Commit

Permalink
Merge pull request #5 from yuhaos/master
Browse files Browse the repository at this point in the history
Update the triple string support
  • Loading branch information
gmlarumbe authored Sep 28, 2024
2 parents e3c0d49 + b17c180 commit a092d48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4240,14 +4240,16 @@ const rules = {
'"""',
repeat(choice(
$._triple_quoted_string_item,
token(prec(1, seq('"', /[^"]/))),
token(prec(1, seq('""', /[^"]/))),
$._string_escape_seq
)),
'"""'
),

_quoted_string_item: $ => token.immediate(prec(1, /[^\\"\n]+/)), // any_ASCII_character except \ or newline or "

_triple_quoted_string_item: $ => token.immediate(prec(1, /[^\\]+/)), // any_ASCII_character except \
_triple_quoted_string_item: $ => token.immediate(prec(1, /[^\\"]+/)), // any_ASCII_character except \

_string_escape_seq: $ => token(prec(1, seq(
'\\',
Expand Down

0 comments on commit a092d48

Please sign in to comment.