From 80cb350a6bbd1c9771d3a648dab2b0262d07fff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 26 Nov 2016 15:41:59 +0100 Subject: [PATCH] matchcompiler: remove redundant variable 'neg' and do some minor reformatting --- tools/matchcompiler.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/matchcompiler.py b/tools/matchcompiler.py index a3f7bcff0..19b1c8c2a 100755 --- a/tools/matchcompiler.py +++ b/tools/matchcompiler.py @@ -105,9 +105,7 @@ class MatchCompiler: elif tok == '%str%': return '(tok->tokType()==Token::eString)' elif tok == '%type%': - return ( - '(tok->isName() && tok->varId()==0U && !tok->isKeyword())' - ) + return '(tok->isName() && tok->varId()==0U && !tok->isKeyword())' elif tok == '%name%': return 'tok->isName()' elif tok == '%var%': @@ -163,15 +161,12 @@ class MatchCompiler: elif tok.find('|') > 0: tokens2 = tok.split('|') logicalOp = None - neg = None if "" in tokens2: ret += ' if (tok && (' logicalOp = ' || ' - neg = '' else: ret += ' if (!tok || !(' logicalOp = ' || ' - neg = '' first = True for tok2 in tokens2: if tok2 == '': @@ -179,7 +174,7 @@ class MatchCompiler: if not first: ret += logicalOp first = False - ret += neg + self._compileCmd(tok2) + ret += self._compileCmd(tok2) if "" in tokens2: ret += '))\n'