Skip to content

Fix multi-line-string-body grammar#552

Open
brandonchinn178 wants to merge 3 commits intokdl-org:mainfrom
brandonchinn178:patch-1
Open

Fix multi-line-string-body grammar#552
brandonchinn178 wants to merge 3 commits intokdl-org:mainfrom
brandonchinn178:patch-1

Conversation

@brandonchinn178
Copy link
Contributor

@brandonchinn178 brandonchinn178 commented Jan 28, 2026

multi-line-raw-string-body is already non-greedy:

multi-line-raw-string-body :=
    (unicode - disallowed-literal-code-points)*?

The grammar seems incorrect if it's greedy, since it'll always consume the newline following it:

quoted-string :=
    '"' single-line-string-body '"' |
    '"""' newline
    (multi-line-string-body newline)?
    (unicode-space | ws-escape)* '"""'

Furthermore, the grammar currently always requires string-character after " or "", which doesn't allow this value:

"""
""
"""

@brandonchinn178 brandonchinn178 changed the title Make multi-line-string-body non-greedy Fix multi-line-string-body grammar Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments