mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
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:
parent
1bc156430b
commit
cb41b2766d
15 changed files with 3153 additions and 3048 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue