bpo-29463: Add docstring field to some AST nodes. (#46)

* bpo-29463: Add docstring field to some AST nodes.

ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring
field for now.  It was first statement of there body.

* fix document.  thanks travis!

* doc fixes
This commit is contained in:
INADA Naoki 2017-02-23 00:31:59 +09:00 committed by Victor Stinner
parent 1bc156430b
commit cb41b2766d
15 changed files with 3153 additions and 3048 deletions

View file

@ -6,7 +6,7 @@
module Python
{
mod = Module(stmt* body)
mod = Module(stmt* body, string? docstring)
| Interactive(stmt* body)
| Expression(expr body)
@ -14,15 +14,18 @@ module Python
| Suite(stmt* body)
stmt = FunctionDef(identifier name, arguments args,
stmt* body, expr* decorator_list, expr? returns)
stmt* body, expr* decorator_list, expr? returns,
string? docstring)
| AsyncFunctionDef(identifier name, arguments args,
stmt* body, expr* decorator_list, expr? returns)
stmt* body, expr* decorator_list, expr? returns,
string? docstring)
| ClassDef(identifier name,
expr* bases,
keyword* keywords,
stmt* body,
expr* decorator_list)
expr* decorator_list,
string? docstring)
| Return(expr? value)
| Delete(expr* targets)