Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: Don't accept code block results without delim #1149

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Jun 21, 2024

This fixes #1137 by implementing @panglesd's suggestion.

The syntax for code blocks with a result section is now:

{delim@lang[ code ]delim[ result ]}

Note: The terminating ]} do not contain the delimiter.

Code blocks with a result section without delimiter are surprising:

    {[ code ][ result ]}

The middle token '][' is too short, which make the parsing surprising.
These code blocks are also not intended to be used without delimiter and
language tag.

The syntax for code blocks with a result section is now:

    {delim@lang[ code ]delim[ result ]}

Note: The terminating ]} do not contain the delimiter.
Copy link
Collaborator

@panglesd panglesd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

src/parser/lexer.mll Outdated Show resolved Hide resolved
Co-authored-by: panglesd <peada@free.fr>
@panglesd panglesd merged commit 179b274 into ocaml:master Jul 5, 2024
12 of 13 checks passed
@panglesd panglesd mentioned this pull request Jul 5, 2024
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.

Bad parsing or ][ in block code
2 participants