summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-02-23 00:31:59 +0900
committerVictor Stinner <victor.stinner@gmail.com>2017-02-22 16:31:59 +0100
commitcb41b2766de646435743b6af7dd152751b54e73f (patch)
tree4033a04617524787defe4699c45327783fe44d8d /Parser
parent1bc156430bad8177b5beecf57979628c1d071230 (diff)
downloadcpython-git-cb41b2766de646435743b6af7dd152751b54e73f.tar.gz
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
Diffstat (limited to 'Parser')
-rw-r--r--Parser/Python.asdl11
1 files changed, 7 insertions, 4 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index f470ad13b6..526cffbce0 100644
--- a/Parser/Python.asdl
+++ b/Parser/Python.asdl
@@ -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)