diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-02 13:02:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-02 13:02:23 +0300 |
commit | 606bfb6b8c54fa786617f6cdf8da5679b1ecde64 (patch) | |
tree | e9f0cd89befb068d5633c79665de8145345b6b8c /src | |
parent | a942b438a5742d87f84f5f09711abde3daebea1e (diff) | |
download | mplint-606bfb6b8c54fa786617f6cdf8da5679b1ecde64.tar.gz mplint-606bfb6b8c54fa786617f6cdf8da5679b1ecde64.tar.bz2 mplint-606bfb6b8c54fa786617f6cdf8da5679b1ecde64.tar.xz mplint-606bfb6b8c54fa786617f6cdf8da5679b1ecde64.zip |
Fix final rule.
Improve debug comments.
Diffstat (limited to 'src')
-rw-r--r-- | src/lintmanager.cpp | 7 | ||||
-rw-r--r-- | src/rulebase.cpp | 2 | ||||
-rw-r--r-- | 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<std::string> &masks = rule->getMasks(); FOR_EACH (std::set<std::string>::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"); + } } |