From 314b0ef3dfa4549b3fab3878a0b664f0269175ef Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 25 Jan 2016 15:14:46 -0800 Subject: [PATCH] More correct checking for undocumented declarations --- src/analysis/undocumented.d | 7 ++++--- src/astprinter.d | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/analysis/undocumented.d b/src/analysis/undocumented.d index fd30650..91fa773 100644 --- a/src/analysis/undocumented.d +++ b/src/analysis/undocumented.d @@ -93,7 +93,7 @@ class UndocumentedDeclarationCheck : BaseAnalyzer override void visit(const VariableDeclaration variable) { - if (!currentIsInteresting() || variable.comment !is null) + if (!currentIsInteresting() || variable.comment.ptr !is null) return; if (variable.autoDeclaration !is null) { @@ -104,7 +104,8 @@ class UndocumentedDeclarationCheck : BaseAnalyzer } foreach (dec; variable.declarators) { - addMessage(dec.name.line, dec.name.column, dec.name.text); + if (dec.comment.ptr is null) + addMessage(dec.name.line, dec.name.column, dec.name.text); return; } } @@ -140,7 +141,7 @@ private: import std.traits : hasMember; if (currentIsInteresting()) { - if (declaration.comment is null) + if (declaration.comment.ptr is null) { static if (hasMember!(T, "name")) { diff --git a/src/astprinter.d b/src/astprinter.d index e447fa9..6aae2bd 100644 --- a/src/astprinter.d +++ b/src/astprinter.d @@ -1116,7 +1116,7 @@ class XMLPrinter : ASTVisitor private void writeDdoc(string comment) { - if (comment is null) return; + if (comment.ptr is null) return; output.writeln("", xmlEscape(comment), ""); }