summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-31 17:10:01 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-31 17:10:01 +0300
commit70d884a705e5f116e9f3f04315cebebfefc96957 (patch)
treedc185ef41c4267e3e925fa7d44f2c79535aaf9dc
parentf097319d197b847ad9386290b7f5377fece8c102 (diff)
downloadmplint-70d884a705e5f116e9f3f04315cebebfefc96957.tar.gz
mplint-70d884a705e5f116e9f3f04315cebebfefc96957.tar.bz2
mplint-70d884a705e5f116e9f3f04315cebebfefc96957.tar.xz
mplint-70d884a705e5f116e9f3f04315cebebfefc96957.zip
Add test for final/notfinal keywords on classes.
-rw-r--r--src/Makefile.am1
-rw-r--r--src/rules/final.cpp37
2 files changed, 38 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 3805f41..13592ca 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,6 +20,7 @@ mplint_SOURCES = \
rules/constructor.cpp \
rules/debug.cpp \
rules/dump.cpp \
+ rules/final.cpp \
rules/license.cpp
# set the include path found by configure
diff --git a/src/rules/final.cpp b/src/rules/final.cpp
new file mode 100644
index 0000000..17134ed
--- /dev/null
+++ b/src/rules/final.cpp
@@ -0,0 +1,37 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "template.hpp"
+
+registerRuleExt(finalCheck, "007", "(.+)[.](cpp|h)")
+
+startRule(finalCheck)
+{
+}
+
+endRule(finalCheck)
+{
+}
+
+parseLineRule(finalCheck)
+{
+ if (isMatch(data, "(.*)(class|struct) ([a-zA-Z_]+)([\\\\n]|( [:])([^;]+)(.*))"))
+ print(data);
+}