Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def visit_FileAST(self, n):
s = ''
from pycparserext.ext_c_parser import PreprocessorLine
for ext in n.ext:
if isinstance(ext, (c_ast.FuncDef, PreprocessorLine)):
s += self.visit(ext)
else:
s += self.visit(ext) + ';\n'
return s
def p_pp_directive(self, p):
""" pp_directive : PPHASH
"""
p[0] = [PreprocessorLine(p[1], coord=self._coord(p.lineno(1)))]