(defn, include_path=())
return ''.join(tok.value for tok in p.parser if tok.type not in p.ignore)
Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible?
Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible?
Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible?
def do_preprocess(defn, include_path=()):
    """
    Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible?
    """
    from pycparser.ply import lex, cpp  # pylint:disable=import-outside-toplevel
    lexer = lex.lex(cpp)
    p = cpp.Preprocessor(lexer)
    for included in include_path:
        p.add_path(included)
    p.parse(defn)
    return ''.join(tok.value for tok in p.parser if tok.type not in p.ignore)
def do_preprocess ( defn , include_path = ( ) ) : from pycparser . ply import lex , cpp # pylint:disable=import-outside-toplevel lexer = lex . lex ( cpp ) p = cpp . Preprocessor ( lexer ) for included in include_path : p . add_path ( included ) p . parse ( defn ) return '' . join ( tok . value for tok in p . parser if tok . type not in p . ignore )