summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamaingw <31617584+samaingw@users.noreply.github.com>2019-10-18 10:32:30 +0200
committerStefan Behnel <stefan_ml@behnel.de>2019-10-18 10:32:30 +0200
commit5a8c984403ce73ac29f9e8b7c78ee5f0f4c608a3 (patch)
treeecbb121cf1bc3cc626332d21d7544623e36df695
parent740ba90ea8d7f420be803c0c3541d94b399f37cc (diff)
downloadcython-5a8c984403ce73ac29f9e8b7c78ee5f0f4c608a3.tar.gz
Allow docstrings in c++ classes (GH-3183)
-rw-r--r--Cython/Compiler/Parsing.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py
index d540a001d..15eccc235 100644
--- a/Cython/Compiler/Parsing.py
+++ b/Cython/Compiler/Parsing.py
@@ -3782,6 +3782,10 @@ def p_cpp_class_definition(s, pos, ctx):
s.next()
s.expect('NEWLINE')
s.expect_indent()
+ # Allow a cppclass to have docstrings. It will be discarded as comment.
+ # The goal of this is consistency: we can make docstrings inside cppclass methods,
+ # so why not on the cppclass itself ?
+ p_doc_string(s)
attributes = []
body_ctx = Ctx(visibility = ctx.visibility, level='cpp_class', nogil=nogil or ctx.nogil)
body_ctx.templates = template_names