diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-10 16:18:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-10 16:18:56 +0300 |
commit | ac6cdc8dd5f42820014b5d0b09b5e52593fb0a20 (patch) | |
tree | bf42969bed6ecc90e8c27ed31a16338d59b1e619 /src/rules | |
parent | f06a985adff1ec54e7a6c3753d8dfd077b5dd37d (diff) | |
download | mplint-ac6cdc8dd5f42820014b5d0b09b5e52593fb0a20.tar.gz mplint-ac6cdc8dd5f42820014b5d0b09b5e52593fb0a20.tar.bz2 mplint-ac6cdc8dd5f42820014b5d0b09b5e52593fb0a20.tar.xz mplint-ac6cdc8dd5f42820014b5d0b09b5e52593fb0a20.zip |
Add check for new CLASS().
Here brackets should be removed.
Diffstat (limited to 'src/rules')
-rw-r--r-- | src/rules/constructorbrackets.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/rules/constructorbrackets.cpp b/src/rules/constructorbrackets.cpp new file mode 100644 index 0000000..73dd9f3 --- /dev/null +++ b/src/rules/constructorbrackets.cpp @@ -0,0 +1,43 @@ +/* + * 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(constructorBrackets, "017", "(.+)[.](cpp|h)") + +startRule(constructorBrackets) +{ +} + +endRule(constructorBrackets) +{ +} + +parseLineRule(constructorBrackets) +{ + if (data.find("new ") != std::string::npos) + { + std::smatch m; + if (isMatch(data, "(.+)[ ]new[ ]([a-zA-Z_0123456789]+)[(][)](.+)", m)) + { + print("Remove () after new CLASS()."); + } + } +} |