bpo-33702: Add some missing links in production lists and do a little polish (GH-7259)
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 9186210..bb1eea6 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -707,15 +707,14 @@
keyword: from
.. productionlist::
- import_stmt: "import" `module` ["as" `name`] ( "," `module` ["as" `name`] )*
- : | "from" `relative_module` "import" `identifier` ["as" `name`]
- : ( "," `identifier` ["as" `name`] )*
- : | "from" `relative_module` "import" "(" `identifier` ["as" `name`]
- : ( "," `identifier` ["as" `name`] )* [","] ")"
+ import_stmt: "import" `module` ["as" `identifier`] ("," `module` ["as" `identifier`])*
+ : | "from" `relative_module` "import" `identifier` ["as" `identifier`]
+ : ("," `identifier` ["as" `identifier`])*
+ : | "from" `relative_module` "import" "(" `identifier` ["as" `identifier`]
+ : ("," `identifier` ["as" `identifier`])* [","] ")"
: | "from" `module` "import" "*"
module: (`identifier` ".")* `identifier`
relative_module: "."* `module` | "."+
- name: `identifier`
The basic import statement (no :keyword:`from` clause) is executed in two
steps:
@@ -837,12 +836,11 @@
standard.
.. productionlist:: *
- future_statement: "from" "__future__" "import" feature ["as" name]
- : ("," feature ["as" name])*
- : | "from" "__future__" "import" "(" feature ["as" name]
- : ("," feature ["as" name])* [","] ")"
- feature: identifier
- name: identifier
+ future_stmt: "from" "__future__" "import" `feature` ["as" `identifier`]
+ : ("," `feature` ["as" `identifier`])*
+ : | "from" "__future__" "import" "(" `feature` ["as" `identifier`]
+ : ("," `feature` ["as" `identifier`])* [","] ")"
+ feature: `identifier`
A future statement must appear near the top of the module. The only lines that
can appear before a future statement are: