Introduce some rules for checking cppcheck's use of Token::*Match

This commit is contained in:
Raphael Geissert 2011-02-02 09:16:27 -06:00
parent ffc4bb481b
commit 9075ca59ca
1 changed files with 18 additions and 0 deletions

18
rules/token-matching.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<rule version="1">
<pattern>Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"\s+</pattern>
<message>
<id>TokenMatchSpacing</id>
<severity>style</severity>
<summary>Useless extra spacing for Token::*Match.</summary>
</message>
</rule>
<rule version="1">
<pattern>Token :: Match \([^,]+,\s+"[^%|!\[\]]+"</pattern>
<message>
<id>UseTokensimpleMatch</id>
<severity>error</severity>
<summary>Token::simpleMatch should be used to match tokens
without special pattern requirements.</summary>
</message>
</rule>