-
Notifications
You must be signed in to change notification settings - Fork 9
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
document attributes #11
Comments
Hello, So there are Constructions or Rules defined as
Example: FunctionDecl := FunKeyword Name Parameters
FunKeyword := 'function'
Name := [A-Z][a-z]*
Parameters := Parameter+
Parameter := Name ' ' {fragment=true} is the same as FunctionDecl := FunKeyword Name Parameters
FunKeyword := 'function'
Name := [A-Z][a-z]*
Parameters := (Name ' ')+
I hope I made myself clear, thanks for your interest in this library :) |
Thank you very much for your explanations! I'm not yet sure how to understand the Also, are there any other incompatibilities between attributes? I'm having trouble adding Statement ::= Expression ';' {ws=implicit,simplifyWhenOneChildren=true}
Expression ::= ... |
This example parses a JSON file with error recovery and pinning:
This one is the same but without error recovery:
You can test those examples online here: https://menduz.com/ebnf-highlighter/ The
It is possible, If you want to take a look to a real world grammar built with this package you can refer to Lys Grammar |
I think I understand what
{ws=implicit}
and{ws=explicit}
does, but what do the following attributes mean?pin
recoverUntil
fragment
simplifyWhenOneChildren
I'd be happy to open a PR to document these somewhere as soon as I understand what they do.
The text was updated successfully, but these errors were encountered: