summaryrefslogtreecommitdiff
path: root/sphinx/pycode/Grammar-py3.txt
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-12 20:29:37 +0100
committerGeorg Brandl <georg@python.org>2014-01-12 20:29:37 +0100
commitfd5bb6f359e609886a5e554fabb72aa14a91361a (patch)
tree78580f5bf16683752ea976bcc36e7f502ef889a2 /sphinx/pycode/Grammar-py3.txt
parent1c77a305a14b26add4d3a94e56f4bab8f053458a (diff)
downloadsphinx-fd5bb6f359e609886a5e554fabb72aa14a91361a.tar.gz
Fix new grammar files to have correct starting symbol at the top.
Diffstat (limited to 'sphinx/pycode/Grammar-py3.txt')
-rw-r--r--sphinx/pycode/Grammar-py3.txt5
1 files changed, 4 insertions, 1 deletions
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