matchcompiler.py: Check Token::type() before comparing Token::str() against "||" or "|"

This commit is contained in:
PKEuS 2014-06-30 13:38:59 +02:00
parent 78f0a47170
commit ec59f1d9df
1 changed files with 2 additions and 2 deletions

View File

@ -106,9 +106,9 @@ class MatchCompiler:
elif tok == '%op%':
return 'tok->isOp()'
elif tok == '%or%':
return '(tok->str()==' + self._insertMatchStr('|') + ')/* | */'
return '(tok->type() == Token::eBitOp && tok->str()==' + self._insertMatchStr('|') + ')/* | */'
elif tok == '%oror%':
return '(tok->str()==' + self._insertMatchStr('||') + ')/* || */'
return '(tok->type() == Token::eLogicalOp && tok->str()==' + self._insertMatchStr('||') + ')/* || */'
elif tok == '%str%':
return '(tok->type()==Token::eString)'
elif tok == '%type%':