-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
Description
Right now it is not documented:
Lines 45 to 81 in 5a4d3df
| # Grammar Syntax (see PEP 617 for more information): | |
| # | |
| # rule_name: expression | |
| # Optionally, a type can be included right after the rule name, which | |
| # specifies the return type of the C or Python function corresponding to the | |
| # rule: | |
| # rule_name[return_type]: expression | |
| # If the return type is omitted, then a void * is returned in C and an Any in | |
| # Python. | |
| # e1 e2 | |
| # Match e1, then match e2. | |
| # e1 | e2 | |
| # Match e1 or e2. | |
| # The first alternative can also appear on the line after the rule name for | |
| # formatting purposes. In that case, a | must be used before the first | |
| # alternative, like so: | |
| # rule_name[return_type]: | |
| # | first_alt | |
| # | second_alt | |
| # ( e ) | |
| # Match e (allows also to use other operators in the group like '(e)*') | |
| # [ e ] or e? | |
| # Optionally match e. | |
| # e* | |
| # Match zero or more occurrences of e. | |
| # e+ | |
| # Match one or more occurrences of e. | |
| # s.e+ | |
| # Match one or more occurrences of e, separated by s. The generated parse tree | |
| # does not include the separator. This is otherwise identical to (e (s e)*). | |
| # &e | |
| # Succeed if e can be parsed, without consuming any input. | |
| # !e | |
| # Fail if e can be parsed, without consuming any input. | |
| # ~ | |
| # Commit to the current alternative, even if it fails to parse. | |
| # |
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)