Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
p = CmdPreprocessor(sys.argv)
sys.exit(p.return_code)
def on_potential_include_guard(self,macro):
self.potential_include_guard = macro
return super(CmdPreprocessor, self).on_potential_include_guard(macro)
def on_comment(self,tok):
if self.args.passthru_comments:
return True # Pass through
return super(CmdPreprocessor, self).on_comment(tok)
def main():
p = CmdPreprocessor(sys.argv)
sys.exit(p.return_code)
if __name__ == "__main__":
p = CmdPreprocessor(sys.argv)
sys.exit(p.return_code)
def on_unknown_macro_in_defined_expr(self,tok):
if self.args.undefines:
if tok.value in self.args.undefines:
return False
if self.args.passthru_undefined_exprs:
return None # Pass through as expanded as possible
return super(CmdPreprocessor, self).on_unknown_macro_in_defined_expr(tok)
def process_header(stl, header_path, flags, header):
try:
cmdline = [
'noexec',
'-o', os.path.join(stl, header + '.all.hpp'),
header_path % header,
'--filetimes=' + os.path.join(stl, header) + '.csv',
'-D', '__cplusplus=20300000',
'-D', '__cpp_lib_concepts=1'
] + flags
p = CmdPreprocessor(cmdline)
print("%s took %f secs" % (header, p.include_times[0].elapsed))
return (p.include_times[0].elapsed, header)
except:
print('%s: %s' % (header, traceback.format_exc()))
return (-1, header)