Open
Description
Currently regex matches characters until latest appearance of """
. Which leads to such bugs:
Adding ?
to regex should fix that, but I don't how to test patched grammar. Here is the patch if someone wants to test it and submit MR:
diff --git a/grammar.js b/grammar.js
index c503e69..51ea8c9 100644
--- a/grammar.js
+++ b/grammar.js
@@ -279,7 +279,7 @@ module.exports = grammar({
seq('$(', $._expression, ')'),
seq('$', $.identifier)
),
- verbatim_string: $=> /"""(.|\n)*"""/,
+ verbatim_string: $=> /""".*?"""/s,
literal: $ => choice(
$.boolean,
Also replaced (.|\n)
with s
regex option, which makes .
to match newlines. It performs slightly faster according to regex101.com and is more idiomatic IMO.
Metadata
Metadata
Assignees
Labels
No labels