diff options
| author | Georg Brandl <georg@python.org> | 2014-01-12 20:29:37 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2014-01-12 20:29:37 +0100 |
| commit | fd5bb6f359e609886a5e554fabb72aa14a91361a (patch) | |
| tree | 78580f5bf16683752ea976bcc36e7f502ef889a2 /sphinx/pycode | |
| parent | 1c77a305a14b26add4d3a94e56f4bab8f053458a (diff) | |
| download | sphinx-fd5bb6f359e609886a5e554fabb72aa14a91361a.tar.gz | |
Fix new grammar files to have correct starting symbol at the top.
Diffstat (limited to 'sphinx/pycode')
| -rw-r--r-- | sphinx/pycode/Grammar-py2.txt | 6 | ||||
| -rw-r--r-- | sphinx/pycode/Grammar-py3.txt | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sphinx/pycode/Grammar-py2.txt b/sphinx/pycode/Grammar-py2.txt index 54d6fa97..98bd1f22 100644 --- a/sphinx/pycode/Grammar-py2.txt +++ b/sphinx/pycode/Grammar-py2.txt @@ -1,12 +1,15 @@ # Grammar for Python 2.x +# IMPORTANT: when copying over a new Grammar file, make sure file_input +# is the first nonterminal in the file! + # Start symbols for the grammar: # single_input is a single interactive statement; # file_input is a module or sequence of commands read from an input file; # eval_input is the input for the eval() and input() functions. # NB: compound_stmt in single_input is followed by extra NEWLINE! -single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: (NEWLINE | stmt)* ENDMARKER +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE eval_input: testlist NEWLINE* ENDMARKER decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE @@ -94,7 +97,6 @@ atom: ('(' [yield_expr|testlist_comp] ')' | '[' [listmaker] ']' | '{' [dictorsetmaker] '}' | '`' testlist1 '`' | -# '>>' test | NAME | NUMBER | STRING+) listmaker: test ( list_for | (',' test)* [','] ) testlist_comp: test ( comp_for | (',' test)* [','] ) diff --git a/sphinx/pycode/Grammar-py3.txt b/sphinx/pycode/Grammar-py3.txt index 92922acc..083b5f91 100644 --- a/sphinx/pycode/Grammar-py3.txt +++ b/sphinx/pycode/Grammar-py3.txt @@ -1,12 +1,15 @@ # Grammar for Python 3.x (with at least x <= 4) +# IMPORTANT: when copying over a new Grammar file, make sure file_input +# is the first nonterminal in the file! + # Start symbols for the grammar: # single_input is a single interactive statement; # file_input is a module or sequence of commands read from an input file; # eval_input is the input for the eval() functions. # NB: compound_stmt in single_input is followed by extra NEWLINE! -single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: (NEWLINE | stmt)* ENDMARKER +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE eval_input: testlist NEWLINE* ENDMARKER decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE |
