From 7a80c0f643e764d802a3e183f34a327c6222b137 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 5 Jan 2015 17:52:10 -0800 Subject: [PATCH] Fix #217 --- src/analysis/undocumented.d | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/analysis/undocumented.d b/src/analysis/undocumented.d index c1273f4..9e73aa9 100644 --- a/src/analysis/undocumented.d +++ b/src/analysis/undocumented.d @@ -42,29 +42,30 @@ class UndocumentedDeclarationCheck : BaseAnalyzer setOverride(true); } } - else + + bool shouldPop = false; + bool prevOverride = getOverride(); + bool ovr = false; + foreach (attribute; dec.attributes) { - bool shouldPop = false; - bool prevOverride = getOverride(); - bool ovr = false; - foreach (attribute; dec.attributes) + shouldPop = dec.attributeDeclaration !is null; + if (isProtection(attribute.attribute.type)) { - if (isProtection(attribute.attribute.type)) - { - shouldPop = true; + if (dec.attributeDeclaration) + set(attribute.attribute.type); + else push(attribute.attribute.type); - } - else if (attribute.attribute == tok!"override") - ovr = true; } - if (ovr) - setOverride(true); - dec.accept(this); - if (shouldPop) - pop(); - if (ovr) - setOverride(prevOverride); + else if (attribute.attribute == tok!"override") + ovr = true; } + if (ovr) + setOverride(true); + dec.accept(this); + if (shouldPop) + pop(); + if (ovr) + setOverride(prevOverride); } override void visit(const VariableDeclaration variable)