MCPcopy Create free account
hub / github.com/nodejs/node / main

Function main

deps/v8/tools/update-object-macros-undef.py:29–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28
29def main():
30 if not os.path.isfile(INPUT):
31 sys.exit("Input file {} does not exist; run this script in a v8 checkout."
32 .format(INPUT))
33 if not os.path.isfile(OUTPUT):
34 sys.exit("Output file {} does not exist; run this script in a v8 checkout."
35 .format(OUTPUT))
36 regexp = re.compile('^#define (\w+)')
37 seen = set()
38 with open(INPUT, 'r') as infile, open(OUTPUT, 'w') as outfile:
39 outfile.write(HEADER)
40 for line in infile:
41 match = regexp.match(line)
42 if match and match.group(1) not in seen:
43 seen.add(match.group(1))
44 outfile.write('#undef {}\n'.format(match.group(1)))
45
46if __name__ == "__main__":
47 main()

Callers 1

Calls 8

formatMethod · 0.65
matchMethod · 0.65
addMethod · 0.65
setFunction · 0.50
openFunction · 0.50
exitMethod · 0.45
compileMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected