ir: Honor documentation_length in Cython.

This commit is contained in:
Emilio Cobos Álvarez
2021-11-02 11:31:30 +01:00
parent 0e3f9bd9cb
commit a1694cd57c
2 changed files with 6 additions and 13 deletions
+6 -6
View File
@@ -43,9 +43,14 @@ impl Source for Documentation {
return;
}
let end = match config.documentation_length {
DocumentationLength::Short => 1,
DocumentationLength::Full => self.doc_comment.len(),
};
// Cython uses Python-style comments, so `documentation_style` is not relevant.
if config.language == Language::Cython {
for line in &self.doc_comment {
for line in &self.doc_comment[..end] {
write!(out, "#{}", line);
out.new_line();
}
@@ -76,11 +81,6 @@ impl Source for Documentation {
_ => (),
}
let end = match config.documentation_length {
DocumentationLength::Short => 1,
DocumentationLength::Full => self.doc_comment.len(),
};
for line in &self.doc_comment[..end] {
match style {
DocumentationStyle::C => out.write(""),
-7
View File
@@ -7,14 +7,7 @@ cdef extern from *:
cdef extern from *:
# The root of all evil.
#
# But at least it contains some more documentation as someone would expect
# from a simple test case like this. Though, this shouldn't appear in the
# output.
void root();
# A little above the root, and a lot more visible, with a run-on sentence
# to test going over the first line.
#
# Still not here, though.
void trunk();