From 78804ca18c4982b00b7bf7714d62dac16648906b Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Tue, 21 Jun 2022 16:10:50 +0200 Subject: [PATCH] Remove ..., added by https://github.com/danmar/cppcheck/commit/52aab1e80c754b28b08b340a197853847ac8ec75 which broke internal checking. In addition another internal rule was added, following up the changes from https://github.com/danmar/cppcheck/pull/4182/files --- rules/token-matching.xml | 75 +++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/rules/token-matching.xml b/rules/token-matching.xml index 457cafb77..d85ed9e8e 100644 --- a/rules/token-matching.xml +++ b/rules/token-matching.xml @@ -1,36 +1,41 @@ - - - Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"(?:\s+|[^"]+?\s+") - - TokenMatchSpacing - style - Useless extra spacing for Token::*Match. - - - - (?U)Token :: Match \([^,]+,\s+"[^%|!\[\]]+" - - UseTokensimpleMatch - error - Token::simpleMatch should be used to match tokens -without special pattern requirements. - - - - \b[\w_]+ \. tokAt \( 0 \) - - TokentokAt0 - error - tok->tokAt(0) is a slow way to say tok. - - - - \b[\w_]+ \. strAt \( 0 \) - - TokenstrAt0 - error - tok->strAt(0) is a slow way to say tok->str() - - - + + Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"(?:\s+|[^"]+?\s+") + + TokenMatchSpacing + style + Useless extra spacing for Token::*Match. + + + + (?U)Token :: Match \([^,]+,\s+"[^%|!\[\]]+" \) + + UseTokensimpleMatch + error + Token::simpleMatch should be used to match tokens without special pattern requirements. + + + + \b[\w_]+ \. tokAt \( 0 \) + + TokentokAt0 + error + tok->tokAt(0) is a slow way to say tok. + + + + \b[\w_]+ \. strAt \( 0 \) + + TokenstrAt0 + error + tok->strAt(0) is a slow way to say tok->str() + + + + + + TokenMatchVariable + error + Simplify 'Token :: Match ( expr , %var% ) && expr->variable()' to 'expr->variable()' + +