I was trying to use a whitespace insensitive mode to comment regexes (which is especially needed since some rules don't compose properly, so long literal regexes are required)
VAR='(?x)
some # regex
with # comments
'
But then on compilation when Sbnf automatically lookahead regex (?=(?x)some #regex...) for some of its rules, it doesn't preserve newlines, so the regex becomes invalid due to # comments, and the syntax becomes invalid as well
Seems I misunderstood this issue. The newlines are being preserved, but because we're writing the regex as a string into yaml the comment becomes part of the yaml string and thus breaks.
I was trying to use a whitespace insensitive mode to comment regexes (which is especially needed since some rules don't compose properly, so long literal regexes are required)
But then on compilation when Sbnf automatically lookahead regex
(?=(?x)some #regex...)
for some of its rules, it doesn't preserve newlines, so the regex becomes invalid due to#
comments, and the syntax becomes invalid as wellOr removing the comments is also fine