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

Remove "block roles" #249

Open
david-christiansen opened this issue Dec 14, 2024 · 0 comments
Open

Remove "block roles" #249

david-christiansen opened this issue Dec 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@david-christiansen
Copy link
Collaborator

The syntax presently has the ability to apply a metaprogram to a single block, like:

{metaprog args}
This is a paragraph

The block is optional. The only thing this has been used for is for standalone commands, like {include SECTION}, but it makes the error messages worse due to lookahead.

A better solution would be to remove block roles, and just have standalone commands with the current syntax for include. Then, the parser can parse a "role-header-like". If the rest of the line is blank, then it's a standalone command, otherwise, it's a paragraph that starts with a role inline. This solution requires no lookahead and will give good error messages.

At the same time, this opens the door for better error messages for e.g. missing metaprograms, because we can hook these commands up to identifiers in the elaboration monad, rather than the current solution where they map to block syntax kinds and have to do a bunch of parsing.

This would fix #70, but also many other little issues.

@david-christiansen david-christiansen added the enhancement New feature or request label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant