Permalink
Browse files

Fixes Issue 9789 - Use new alias syntax for ddoc output.

  • Loading branch information...
1 parent 65b882c commit d111a38b49286f1f0596f1970f19182d6421d352 @AndrejMitrovic AndrejMitrovic committed Mar 23, 2013
View
@@ -937,7 +937,7 @@ void AliasDeclaration::toDocBuffer(OutBuffer *buf, Scope *sc)
buf->writestring("deprecated ");
emitProtection(buf, protection);
- buf->writestring("alias ");
+ buf->printf("alias %s = ", toChars());
if (Dsymbol *s = aliassym) // ident alias
{
@@ -959,8 +959,6 @@ void AliasDeclaration::toDocBuffer(OutBuffer *buf, Scope *sc)
}
}
- buf->writestring(" ");
- buf->writestring(toChars());
buf->writestring(";\n");
}
}
@@ -0,0 +1,11 @@
+// PERMUTE_ARGS:
+// REQUIRED_ARGS: -D -w -o- -c -Ddtest_results/compilable -o-
+// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh 9789
+
+module ddoc9789;
+
+///
+struct S {}
+
+///
+alias A = S;
@@ -6,7 +6,7 @@
This module is for ABC
<br><br>
-<dl><dt><big><a name="myint"></a>alias int <u>myint</u>;
+<dl><dt><big><a name="myint"></a>alias <u>myint</u> = int;
</big></dt>
<dd><br><br>
</dd>
@@ -27,7 +27,7 @@
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="IndexOf"></a>alias staticIndexOf(T, TList...) <u>IndexOf</u>;
+<dt><big><a name="IndexOf"></a>alias <u>IndexOf</u> = staticIndexOf(T, TList...);
</big></dt>
<dd><br><br>
</dd>
@@ -4,69 +4,69 @@
</head><body>
<h1>ddoc5446</h1>
<br><br>
-<dl><dt><big><a name="This_Foo"></a>alias ddoc5446a.A_Foo <u>This_Foo</u>;
+<dl><dt><big><a name="This_Foo"></a>alias <u>This_Foo</u> = ddoc5446a.A_Foo;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="This_Foo_Alias"></a>alias ddoc5446a.A_Foo <u>This_Foo_Alias</u>;
+<dt><big><a name="This_Foo_Alias"></a>alias <u>This_Foo_Alias</u> = ddoc5446a.A_Foo;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="This_Int"></a>alias int <u>This_Int</u>;
+<dt><big><a name="This_Int"></a>alias <u>This_Int</u> = int;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="This_Enum"></a>alias ddoc5446a.A_Enum <u>This_Enum</u>;
+<dt><big><a name="This_Enum"></a>alias <u>This_Enum</u> = ddoc5446a.A_Enum;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="A_Enum_New"></a>deprecated alias ddoc5446b.<u>A_Enum_New</u> <u>A_Enum_New</u>;
+<dt><big><a name="A_Enum_New"></a>deprecated alias <u>A_Enum_New</u> = ddoc5446b.<u>A_Enum_New</u>;
</big></dt>
<dd><br><br>
</dd>
<dt><big><a name="Bar"></a>struct <u>Bar</u>;
</big></dt>
<dd><br><br>
-<dl><dt><big><a name="Bar.Bar_A_Foo"></a>alias ddoc5446a.A_Foo <u>Bar_A_Foo</u>;
+<dl><dt><big><a name="Bar.Bar_A_Foo"></a>alias <u>Bar_A_Foo</u> = ddoc5446a.A_Foo;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Bar_A_Foo_Alias"></a>alias ddoc5446a.A_Foo <u>Bar_A_Foo_Alias</u>;
+<dt><big><a name="Bar.Bar_A_Foo_Alias"></a>alias <u>Bar_A_Foo_Alias</u> = ddoc5446a.A_Foo;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Bar_A_Int"></a>alias int <u>Bar_A_Int</u>;
+<dt><big><a name="Bar.Bar_A_Int"></a>alias <u>Bar_A_Int</u> = int;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Bar_This_Foo"></a>alias ddoc5446a.A_Foo <u>Bar_This_Foo</u>;
+<dt><big><a name="Bar.Bar_This_Foo"></a>alias <u>Bar_This_Foo</u> = ddoc5446a.A_Foo;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Bar_This_Foo_Alias"></a>alias ddoc5446a.A_Foo <u>Bar_This_Foo_Alias</u>;
+<dt><big><a name="Bar.Bar_This_Foo_Alias"></a>alias <u>Bar_This_Foo_Alias</u> = ddoc5446a.A_Foo;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Bar_This_Int"></a>alias int <u>Bar_This_Int</u>;
+<dt><big><a name="Bar.Bar_This_Int"></a>alias <u>Bar_This_Int</u> = int;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Nested_Alias"></a>alias Nested <u>Nested_Alias</u>;
+<dt><big><a name="Bar.Nested_Alias"></a>alias <u>Nested_Alias</u> = Nested;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Fake_Nested"></a>alias .Nested <u>Fake_Nested</u>;
+<dt><big><a name="Bar.Fake_Nested"></a>alias <u>Fake_Nested</u> = .Nested;
</big></dt>
<dd><br><br>
</dd>
<dt><big><a name="Bar.Nested"></a>struct <u>Nested</u>;
</big></dt>
<dd><br><br>
-<dl><dt><big><a name="Bar.Nested.Bar_Nested_Bar_Alias"></a>alias Bar <u>Bar_Nested_Bar_Alias</u>;
+<dl><dt><big><a name="Bar.Nested.Bar_Nested_Bar_Alias"></a>alias <u>Bar_Nested_Bar_Alias</u> = Bar;
</big></dt>
<dd><br><br>
</dd>
-<dt><big><a name="Bar.Nested.Bar_Alias"></a>alias .Bar <u>Bar_Alias</u>;
+<dt><big><a name="Bar.Nested.Bar_Alias"></a>alias <u>Bar_Alias</u> = .Bar;
</big></dt>
<dd><br><br>
</dd>
@@ -79,7 +79,7 @@
<dd>Some doc<br><br>
</dd>
-<dt><big><a name="bar"></a>alias foo <u>bar</u>;
+<dt><big><a name="bar"></a>alias <u>bar</u> = foo;
</big></dt>
<dd>More doc<br><br>
@@ -0,0 +1,18 @@
+<html><head>
+ <META http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>ddoc9789</title>
+ </head><body>
+ <h1>ddoc9789</h1>
+<br><br>
+<dl><dt><big><a name="S"></a>struct <u>S</u>;
+</big></dt>
+<dd><br><br>
+</dd>
+<dt><big><a name="A"></a>alias <u>A</u> = S;
+</big></dt>
+<dd><br><br>
+</dd>
+</dl>
+
+ <hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. </small>
+ </body></html>

0 comments on commit d111a38

Please sign in to comment.