def _is_expression_x()

in src/advisor/helpers/c/naive_cpp.py [0:0]


    def _is_expression_x(expression, x):
        tokens = NaiveCpp.TOKEN_PROG.split(expression)
        for token in tokens:
            match = NaiveCpp.DEFINED_PROG.match(token)
            if not match:
                match = NaiveCpp.MACRO_PROG.match(token)
            if match:
                negated = match.group(1) == '!'
                macro = match.group(2)
                if macro in NaiveCpp.IGNORE_MACROS:
                    continue
                if x.match(macro) is not None:
                    return not negated
        return None