mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix new grammar files to have correct starting symbol at the top.
This commit is contained in:
parent
42a8138c30
commit
4650f5a1b5
@ -1,12 +1,15 @@
|
|||||||
# Grammar for Python 2.x
|
# 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:
|
# Start symbols for the grammar:
|
||||||
# single_input is a single interactive statement;
|
# single_input is a single interactive statement;
|
||||||
# file_input is a module or sequence of commands read from an input file;
|
# 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.
|
# eval_input is the input for the eval() and input() functions.
|
||||||
# NB: compound_stmt in single_input is followed by extra NEWLINE!
|
# NB: compound_stmt in single_input is followed by extra NEWLINE!
|
||||||
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
|
|
||||||
file_input: (NEWLINE | stmt)* ENDMARKER
|
file_input: (NEWLINE | stmt)* ENDMARKER
|
||||||
|
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
|
||||||
eval_input: testlist NEWLINE* ENDMARKER
|
eval_input: testlist NEWLINE* ENDMARKER
|
||||||
|
|
||||||
decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
|
decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
|
||||||
@ -94,7 +97,6 @@ atom: ('(' [yield_expr|testlist_comp] ')' |
|
|||||||
'[' [listmaker] ']' |
|
'[' [listmaker] ']' |
|
||||||
'{' [dictorsetmaker] '}' |
|
'{' [dictorsetmaker] '}' |
|
||||||
'`' testlist1 '`' |
|
'`' testlist1 '`' |
|
||||||
# '>>' test |
|
|
||||||
NAME | NUMBER | STRING+)
|
NAME | NUMBER | STRING+)
|
||||||
listmaker: test ( list_for | (',' test)* [','] )
|
listmaker: test ( list_for | (',' test)* [','] )
|
||||||
testlist_comp: test ( comp_for | (',' test)* [','] )
|
testlist_comp: test ( comp_for | (',' test)* [','] )
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
# Grammar for Python 3.x (with at least x <= 4)
|
# 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:
|
# Start symbols for the grammar:
|
||||||
# single_input is a single interactive statement;
|
# single_input is a single interactive statement;
|
||||||
# file_input is a module or sequence of commands read from an input file;
|
# file_input is a module or sequence of commands read from an input file;
|
||||||
# eval_input is the input for the eval() functions.
|
# eval_input is the input for the eval() functions.
|
||||||
# NB: compound_stmt in single_input is followed by extra NEWLINE!
|
# NB: compound_stmt in single_input is followed by extra NEWLINE!
|
||||||
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
|
|
||||||
file_input: (NEWLINE | stmt)* ENDMARKER
|
file_input: (NEWLINE | stmt)* ENDMARKER
|
||||||
|
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
|
||||||
eval_input: testlist NEWLINE* ENDMARKER
|
eval_input: testlist NEWLINE* ENDMARKER
|
||||||
|
|
||||||
decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
|
decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
|
||||||
|
Loading…
Reference in New Issue
Block a user