From 606bfb6b8c54fa786617f6cdf8da5679b1ecde64 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 Jun 2014 13:02:23 +0300 Subject: Fix final rule. Improve debug comments. --- src/lintmanager.cpp | 7 ++++++- src/rulebase.cpp | 2 +- src/rules/final.cpp | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/lintmanager.cpp b/src/lintmanager.cpp index f595a38..1f1714e 100644 --- a/src/lintmanager.cpp +++ b/src/lintmanager.cpp @@ -187,13 +187,18 @@ void LintManager::selectRulesForFile() bool LintManager::isMatchFile(RuleBase *const rule) { -// printf("isMatchFile: %s\n", mFileName.c_str()); +// printf("rule: %s, isMatchFile: %s\n", rule->getName().c_str(), +// mFileName.c_str()); const std::set &masks = rule->getMasks(); FOR_EACH (std::set::const_iterator, it, masks) { +// printf("check regexp: %s\n", (*it).c_str()); std::regex exp(*it); if (std::regex_match (mFileName, exp)) + { +// printf("matched\n"); return true; + } } return false; } diff --git a/src/rulebase.cpp b/src/rulebase.cpp index 8b34ffe..f44421c 100644 --- a/src/rulebase.cpp +++ b/src/rulebase.cpp @@ -58,7 +58,7 @@ void RuleBase::deleteSelf() void RuleBase::terminateRule() { - lint.deleteSelectedRule(this); +// lint.deleteSelectedRule(this); flag = false; } diff --git a/src/rules/final.cpp b/src/rules/final.cpp index 17134ed..9ff82da 100644 --- a/src/rules/final.cpp +++ b/src/rules/final.cpp @@ -32,6 +32,9 @@ endRule(finalCheck) parseLineRule(finalCheck) { - if (isMatch(data, "(.*)(class|struct) ([a-zA-Z_]+)([\\\\n]|( [:])([^;]+)(.*))")) - print(data); + if (isMatch(data, "(.*)(class|struct) ([a-zA-Z_0123456789]+)" + "($|( [:])([^;]+)(.*))")) + { + print("Need add final or notfinal into class declaration"); + } } -- cgit v1.2.3-60-g2f50