Skip to content

Commit 697399f

Browse files
authored
Merge pull request #183 from MartinNowak/fix180
fix #180 - return parameter not supported
2 parents 6887e1c + 1fe6f2c commit 697399f

File tree

11 files changed

+551
-3
lines changed

11 files changed

+551
-3
lines changed

source/ddox/api.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ T[] getDocGroups(T)(Declaration[] decls)
227227
///
228228
string getAttributeString(S : string)(S[] attributes, AttributeStringKind kind)
229229
{
230-
enum backAttributes = ["const", "immutable", "shared", "nothrow", "@safe", "@trusted", "@system", "pure", "@property", "@nogc"];
230+
enum backAttributes = ["const", "immutable", "shared", "nothrow", "@safe", "@trusted", "@system", "pure", "@property", "@nogc", "return", "scope"];
231231
auto ret = appender!string();
232232
foreach (a; attributes) {
233233
bool back = backAttributes.canFind(a);

source/ddox/parsers/jsonparser.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,10 @@ private struct Parser
422422
"__gshared", "scope", "static", "synchronize"];
423423

424424
static immutable parameter_attribute_keywords = ["auto", "const", "final", "immutable", "in", "inout",
425-
"lazy", "out", "ref", "scope", "shared"];
425+
"lazy", "out", "ref", "return", "scope", "shared"];
426426

427-
static immutable member_function_attribute_keywords = ["const", "immutable", "inout", "shared", "pure", "nothrow"];
427+
static immutable member_function_attribute_keywords = ["const", "immutable", "inout", "ref", "return",
428+
"scope", "shared", "pure", "nothrow"];
428429

429430

430431
if( tokens.length > 0 && tokens[0] == "extern" ){

tests/issue180_return/docs/index.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>API documentation</title>
6+
<link rel="stylesheet" type="text/css" href="./styles/ddox.css"/>
7+
<link rel="stylesheet" href="./prettify/prettify.css" type="text/css"/>
8+
<script type="text/javascript" src="./scripts/jquery.js">/**/</script><script type="text/javascript" src="./scripts/ddox.js">/**/</script>
9+
</head>
10+
<body onload="setupDdox();">
11+
<nav id="main-nav">
12+
<noscript>
13+
<p style="color: red">The search functionality needs JavaScript enabled</p>
14+
</noscript>
15+
<div id="symbolSearchPane" style="display: none">
16+
<form action="#" method="GET">
17+
<input id="symbolSearch" type="text" name="q" placeholder="Search for symbols" autocomplete="off" onchange="performSymbolSearch(40);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/>
18+
</form>
19+
<ul id="symbolSearchResults" class="symbolList" style="display: none"></ul><script type="application/javascript" src="./symbols.js"></script><script type="application/javascript">var symbolSearchRootDir = "./";
20+
$('#symbolSearchPane').show();</script>
21+
</div>
22+
<ul class="tree-view">
23+
<li>
24+
<div class="module ">
25+
<a href="./test.html">test</a>
26+
</div>
27+
</li>
28+
</ul>
29+
</nav>
30+
<div id="main-contents">
31+
<h1>API documentation</h1>
32+
<table>
33+
<col class="caption"/>
34+
<tr>
35+
<th>Module</th><th>Description</th>
36+
</tr>
37+
<tr>
38+
<td>
39+
<a href="./test.html">test</a>
40+
</td>
41+
<td>
42+
43+
</td>
44+
</tr>
45+
</table>
46+
<footer>
47+
<p class="faint">Generated using the DDOX documentation generator</p>
48+
</footer>
49+
</div>
50+
</body>
51+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url><loc>http://127.0.0.1/index.html</loc></url>
4+
<url><loc>http://127.0.0.1/test.html</loc></url>
5+
<url><loc>http://127.0.0.1/test/foo.html</loc></url>
6+
<url><loc>http://127.0.0.1/test/foo.html</loc></url>
7+
<url><loc>http://127.0.0.1/test/foo.html</loc></url>
8+
<url><loc>http://127.0.0.1/test/S.html</loc></url>
9+
<url><loc>http://127.0.0.1/test/S.foo.html</loc></url>
10+
<url><loc>http://127.0.0.1/test/S.foo.html</loc></url>
11+
<url><loc>http://127.0.0.1/test/S.foo.html</loc></url>
12+
<url><loc>http://127.0.0.1/test/S.p.html</loc></url>
13+
</urlset>

tests/issue180_return/docs/symbols.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// symbol index generated by DDOX - do not edit
2+
var symbols = [
3+
{name: 'test', kind: "module", path: './test.html', attributes: []},
4+
{name: 'test.foo', kind: "functiondeclaration", path: './test/foo.html', attributes: ["ref", "safe"]},
5+
{name: 'test.S', kind: "structdeclaration", path: './test/S.html', attributes: []},
6+
{name: 'test.S.foo', kind: "functiondeclaration", path: './test/S.foo.html', attributes: ["ref", "return", "safe"]},
7+
{name: 'test.S.p', kind: "variabledeclaration", path: './test/S.p.html', attributes: []},
8+
];

tests/issue180_return/docs/test.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Module test</title>
6+
<link rel="stylesheet" type="text/css" href="./styles/ddox.css"/>
7+
<link rel="stylesheet" href="./prettify/prettify.css" type="text/css"/>
8+
<script type="text/javascript" src="./scripts/jquery.js">/**/</script><script type="text/javascript" src="./scripts/ddox.js">/**/</script>
9+
</head>
10+
<body onload="setupDdox();">
11+
<nav id="main-nav">
12+
<noscript>
13+
<p style="color: red">The search functionality needs JavaScript enabled</p>
14+
</noscript>
15+
<div id="symbolSearchPane" style="display: none">
16+
<form action="#" method="GET">
17+
<input id="symbolSearch" type="text" name="q" placeholder="Search for symbols" autocomplete="off" onchange="performSymbolSearch(40);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/>
18+
</form>
19+
<ul id="symbolSearchResults" class="symbolList" style="display: none"></ul><script type="application/javascript" src="./symbols.js"></script><script type="application/javascript">var symbolSearchRootDir = "./";
20+
$('#symbolSearchPane').show();</script>
21+
</div>
22+
<ul class="tree-view">
23+
<li>
24+
<div class="module selected">
25+
<a href="./test.html">test</a>
26+
</div>
27+
</li>
28+
</ul>
29+
</nav>
30+
<div id="main-contents">
31+
<h1>Module test</h1><p></p>
32+
<section></section>
33+
<section>
34+
<h2>Functions</h2>
35+
<table>
36+
<col class="caption"/>
37+
<tr>
38+
<th>Name</th><th>Description</th>
39+
</tr>
40+
<tr>
41+
<td>
42+
<code>
43+
<a id="foo" class="[&quot;public&quot;]" href="./test/foo.html">foo</a><span class="decoration">(a)</span>
44+
</code>
45+
</td>
46+
<td></td>
47+
</tr>
48+
</table>
49+
</section>
50+
<section>
51+
<h2>Structs</h2>
52+
<table>
53+
<col class="caption"/>
54+
<tr>
55+
<th>Name</th><th>Description</th>
56+
</tr>
57+
<tr>
58+
<td>
59+
<code>
60+
<a id="S" class="[&quot;public&quot;]" href="./test/S.html">S</a>
61+
</code>
62+
</td>
63+
<td></td>
64+
</tr>
65+
</table>
66+
</section>
67+
<footer>
68+
<table class="license-info">
69+
<tr>
70+
<th>Authors</th>
71+
<td>
72+
73+
</td>
74+
</tr>
75+
<tr>
76+
<th>Copyright</th>
77+
<td>
78+
79+
</td>
80+
</tr>
81+
<tr>
82+
<th>License</th>
83+
<td>
84+
85+
</td>
86+
</tr>
87+
</table>
88+
<p class="faint">Generated using the DDOX documentation generator</p>
89+
</footer>
90+
</div>
91+
</body>
92+
</html>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Function S.foo</title>
6+
<link rel="stylesheet" type="text/css" href="../styles/ddox.css"/>
7+
<link rel="stylesheet" href="../prettify/prettify.css" type="text/css"/>
8+
<script type="text/javascript" src="../scripts/jquery.js">/**/</script><script type="text/javascript" src="../scripts/ddox.js">/**/</script>
9+
</head>
10+
<body onload="setupDdox();">
11+
<nav id="main-nav">
12+
<noscript>
13+
<p style="color: red">The search functionality needs JavaScript enabled</p>
14+
</noscript>
15+
<div id="symbolSearchPane" style="display: none">
16+
<form action="#" method="GET">
17+
<input id="symbolSearch" type="text" name="q" placeholder="Search for symbols" autocomplete="off" onchange="performSymbolSearch(40);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/>
18+
</form>
19+
<ul id="symbolSearchResults" class="symbolList" style="display: none"></ul><script type="application/javascript" src="../symbols.js"></script><script type="application/javascript">var symbolSearchRootDir = "../";
20+
$('#symbolSearchPane').show();</script>
21+
</div>
22+
<ul class="tree-view">
23+
<li>
24+
<div class="module selected">
25+
<a href="../test.html">test</a>
26+
</div>
27+
</li>
28+
</ul>
29+
</nav>
30+
<div id="main-contents">
31+
<h1>Function S.foo</h1><p></p>
32+
<div class="prototype">
33+
<code class="lang-d">
34+
<div class="single-prototype">
35+
<span class="kwd">ref </span><a href="../test/S.html"><span class="pln">S</span></a> <span class="pln">foo
36+
<span class="pun">()</span><span class="pln"> </span><span class="kwd">return @safe</span><span class="pun">;</span>
37+
<br/>
38+
<br/>
39+
<span class="kwd">ref </span><a href="../test/S.html"><span class="pln">S</span></a> <span class="pln">foo
40+
<span class="pun">()</span><span class="pln"> </span><span class="kwd">return @safe</span><span class="pun">;</span>
41+
<br/>
42+
<br/>
43+
<a href="../test/S.html"><span class="pln">S</span></a> <span class="pln">foo
44+
<span class="pun">()</span><span class="pln"> </span><span class="kwd">return @safe</span><span class="pun">;</span>
45+
</div>
46+
</code>
47+
</div>
48+
49+
50+
<footer>
51+
<table class="license-info">
52+
<tr>
53+
<th>Authors</th>
54+
<td>
55+
56+
</td>
57+
</tr>
58+
<tr>
59+
<th>Copyright</th>
60+
<td>
61+
62+
</td>
63+
</tr>
64+
<tr>
65+
<th>License</th>
66+
<td>
67+
68+
</td>
69+
</tr>
70+
</table>
71+
<p class="faint">Generated using the DDOX documentation generator</p>
72+
</footer>
73+
</div>
74+
</body>
75+
</html>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Struct S</title>
6+
<link rel="stylesheet" type="text/css" href="../styles/ddox.css"/>
7+
<link rel="stylesheet" href="../prettify/prettify.css" type="text/css"/>
8+
<script type="text/javascript" src="../scripts/jquery.js">/**/</script><script type="text/javascript" src="../scripts/ddox.js">/**/</script>
9+
</head>
10+
<body onload="setupDdox();">
11+
<nav id="main-nav">
12+
<noscript>
13+
<p style="color: red">The search functionality needs JavaScript enabled</p>
14+
</noscript>
15+
<div id="symbolSearchPane" style="display: none">
16+
<form action="#" method="GET">
17+
<input id="symbolSearch" type="text" name="q" placeholder="Search for symbols" autocomplete="off" onchange="performSymbolSearch(40);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/>
18+
</form>
19+
<ul id="symbolSearchResults" class="symbolList" style="display: none"></ul><script type="application/javascript" src="../symbols.js"></script><script type="application/javascript">var symbolSearchRootDir = "../";
20+
$('#symbolSearchPane').show();</script>
21+
</div>
22+
<ul class="tree-view">
23+
<li>
24+
<div class="module selected">
25+
<a href="../test.html">test</a>
26+
</div>
27+
</li>
28+
</ul>
29+
</nav>
30+
<div id="main-contents">
31+
<h1>Struct S</h1><p></p>
32+
<div class="prototype">
33+
<code class="lang-d">
34+
<div class="single-prototype">
35+
<span class="kwd">struct</span> <span class="typ">S</span>
36+
<span class="pun">;</span>
37+
</div>
38+
</code>
39+
</div>
40+
41+
<section><h2>Fields</h2>
42+
<table>
43+
<col class="caption"/>
44+
<tr>
45+
<th>Name</th><th>Type</th><th>Description</th>
46+
</tr>
47+
<tr>
48+
<td>
49+
<a href="../test/S.p.html" class="[&quot;public&quot;]"><code>p</code></a>
50+
</td>
51+
<td class="typecol"><code class="prettyprint lang-d"><span class="typ">int</span><span class="pun">*</span></code></td><td></td>
52+
</tr>
53+
</table>
54+
</section>
55+
<section><h2>Methods</h2>
56+
<table>
57+
<col class="caption"/>
58+
<tr>
59+
<th>Name</th><th>Description</th>
60+
</tr>
61+
<tr>
62+
<td>
63+
<a href="../test/S.foo.html" class="[&quot;public&quot;]">
64+
<code>foo</code>
65+
</a>
66+
</td>
67+
<td></td>
68+
</tr>
69+
</table>
70+
</section>
71+
72+
<footer>
73+
<table class="license-info">
74+
<tr>
75+
<th>Authors</th>
76+
<td>
77+
78+
</td>
79+
</tr>
80+
<tr>
81+
<th>Copyright</th>
82+
<td>
83+
84+
</td>
85+
</tr>
86+
<tr>
87+
<th>License</th>
88+
<td>
89+
90+
</td>
91+
</tr>
92+
</table>
93+
<p class="faint">Generated using the DDOX documentation generator</p>
94+
</footer>
95+
</div>
96+
</body>
97+
</html>

0 commit comments

Comments
 (0)