dlang / ddox

Advanced D documentation engine
MIT License
63 stars 21 forks source link

ddox chokes on space after leading dot #119

Closed aG0aep6G closed 8 years ago

aG0aep6G commented 8 years ago

test.d:

/**

---
. writeln();

---
*/
module test;

Note the space between the dot and writeln. Without the space, ddox can handle it.

dmd -o- -Df/dev/null -Xftest.json test.d generates test.json:

[
 {
  "name" : "test",
  "kind" : "module",
  "file" : "test.d",
  "comment" : "---\n. writeln();\n---\n",
  "members" : []
 }
]

ddox generate-html test.json . fails with this:

Reading doc file...
Parsing JSON...
Parsing docs...
Finished parsing docs.
Generating module: test
core.exception.AssertError@source/ddox/api.d(68): Missing identifier after dot!
----------------
??:? _d_assert_msg [0xb41471]
source/ddox/api.d:68 immutable(char)[] ddox.api.DocGroupContext.lookupScopeSymbolLink(immutable(char)[]) [0x8be045]
source/ddox/ddoc.d:638 void ddox.ddoc.renderCodeLine!(std.array.Appender!(immutable(char)[]).Appender).renderCodeLine(ref std.array.Appender!(immutable(char)[]).Appender, immutable(char)[], ddox.ddoc.DdocContext).__lambda4(immutable(char)[], scope void delegate()) [0x8defd3]
source/ddox/highlight.d:110 void ddox.highlight.highlightDCodeImpl!(std.array.Appender!(immutable(char)[]).Appender).highlightDCodeImpl(ref std.array.Appender!(immutable(char)[]).Appender, immutable(char)[], scope void delegate(immutable(char)[], scope void delegate()), ref immutable(char)[]) [0x929689]
source/ddox/highlight.d:52 void ddox.highlight.highlightDCode!(std.array.Appender!(immutable(char)[]).Appender).highlightDCode(ref std.array.Appender!(immutable(char)[]).Appender, immutable(char)[], scope void delegate(immutable(char)[], scope void delegate())) [0x9293fe]
source/ddox/ddoc.d:637 void ddox.ddoc.renderCodeLine!(std.array.Appender!(immutable(char)[]).Appender).renderCodeLine(ref std.array.Appender!(immutable(char)[]).Appender, immutable(char)[], ddox.ddoc.DdocContext) [0x8def96]
source/ddox/ddoc.d:464 void ddox.ddoc.parseSection!(std.array.Appender!(immutable(char)[]).Appender).parseSection(ref std.array.Appender!(immutable(char)[]).Appender, immutable(char)[], immutable(char)[][], ddox.ddoc.DdocContext, int, immutable(char)[][immutable(char)[]]) [0x8dc42b]
source/ddox/ddoc.d:310 void ddox.ddoc.DdocComment.renderSectionsR!(std.array.Appender!(immutable(char)[]).Appender).renderSectionsR(ref std.array.Appender!(immutable(char)[]).Appender, ddox.ddoc.DdocContext, scope bool delegate(immutable(char)[]), int) [0x8db928]
source/ddox/ddoc.d:324 immutable(char)[] ddox.ddoc.DdocComment.renderSections(ddox.ddoc.DdocContext, bool delegate(immutable(char)[]), int) [0x8c3214]
source/ddox/htmlgenerator.d:220 immutable(char)[] ddox.htmlgenerator.DocPageInfo.formatDoc(ddox.entities.DocGroup, int, bool delegate(immutable(char)[])) [0x92b4f2]
../../.dub/packages/vibe-d-0.7.27/source/vibe/templ/diet.d:69 void vibe.templ.diet.compileDietFileIndent!("ddox.module.dt", 0, vibe.http.server.HTTPServerRequest ddox.htmlgenerator.generateModulePage(vibe.core.stream.OutputStream, ddox.entities.Package, ddox.entities.Module, ddox.settings.GeneratorSettings, immutable(char)[] delegate(ddox.entities.Entity), vibe.http.server.HTTPServerRequest).req, ddox.htmlgenerator.DocPageInfo ddox.htmlgenerator.generateModulePage(vibe.core.stream.OutputStream, ddox.entities.Package, ddox.entities.Module, ddox.settings.GeneratorSettings, immutable(char)[] delegate(ddox.entities.Entity), vibe.http.server.HTTPServerRequest).info).compileDietFileIndent(vibe.core.stream.OutputStream) [0x93995b]
../../.dub/packages/vibe-d-0.7.27/source/vibe/templ/diet.d:47 void vibe.templ.diet.compileDietFile!("ddox.module.dt", vibe.http.server.HTTPServerRequest ddox.htmlgenerator.generateModulePage(vibe.core.stream.OutputStream, ddox.entities.Package, ddox.entities.Module, ddox.settings.GeneratorSettings, immutable(char)[] delegate(ddox.entities.Entity), vibe.http.server.HTTPServerRequest).req, ddox.htmlgenerator.DocPageInfo ddox.htmlgenerator.generateModulePage(vibe.core.stream.OutputStream, ddox.entities.Package, ddox.entities.Module, ddox.settings.GeneratorSettings, immutable(char)[] delegate(ddox.entities.Entity), vibe.http.server.HTTPServerRequest).info).compileDietFile(vibe.core.stream.OutputStream) [0x93936c]
source/ddox/htmlgenerator.d:308 void ddox.htmlgenerator.generateModulePage(vibe.core.stream.OutputStream, ddox.entities.Package, ddox.entities.Module, ddox.settings.GeneratorSettings, immutable(char)[] delegate(ddox.entities.Entity), vibe.http.server.HTTPServerRequest) [0x92bdc2]
source/ddox/htmlgenerator.d:158 _D4ddox13htmlgenerator16generateHtmlDocsFS4vibe4inet4path4PathC4ddox8entities7PackageC4ddox8settings17GeneratorSettingsZ11visitModuleMFC4ddox8entities6ModuleS4vibe4inet4path4PathZ47__T9__lambda4TC4vibe4core6stream12OutputStreamZ9__lambda4MFC4vibe4core6stream12OutputStreamZv [0x92ae28]
source/ddox/htmlgenerator.d:141 void ddox.htmlgenerator.generateHtmlDocs(vibe.inet.path.Path, ddox.entities.Package, ddox.settings.GeneratorSettings).writeHashedFile(vibe.inet.path.Path, scope void delegate(vibe.core.stream.OutputStream)) [0x92aa7d]
source/ddox/htmlgenerator.d:157 void ddox.htmlgenerator.generateHtmlDocs(vibe.inet.path.Path, ddox.entities.Package, ddox.settings.GeneratorSettings).visitModule(ddox.entities.Module, vibe.inet.path.Path) [0x92ad90]
source/ddox/htmlgenerator.d:174 void ddox.htmlgenerator.generateHtmlDocs(vibe.inet.path.Path, ddox.entities.Package, ddox.settings.GeneratorSettings).visitPackage(ddox.entities.Package, vibe.inet.path.Path) [0x92b1f8]
source/ddox/htmlgenerator.d:181 void ddox.htmlgenerator.generateHtmlDocs(vibe.inet.path.Path, ddox.entities.Package, ddox.settings.GeneratorSettings) [0x92a185]
source/ddox/main.d:56 int ddox.main.cmdGenerateHtml(immutable(char)[][]) [0x95a425]
source/ddox/main.d:38 int ddox.main.ddoxMain(immutable(char)[][]) [0x95a22d]
source/app.d:8 _Dmain [0x8bc967]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0xb486e2]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0xb48638]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0xb4869e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0xb48638]
??:? _d_run_main [0xb48595]
??:? main [0x8bdb6f]
??:? __libc_start_main [0x3dc86a3f]