MCPcopy Index your code
hub / github.com/python/mypy / main

Function main

misc/dump-ast.py:27–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26
27def main() -> None:
28 # Parse a file and dump the AST (or display errors).
29 parser = argparse.ArgumentParser(
30 description="Parse source files and print the abstract syntax tree (AST)."
31 )
32 parser.add_argument("--quiet", action="store_true", help="do not print AST")
33 parser.add_argument("FILE", nargs="*", help="files to parse")
34 args = parser.parse_args()
35
36 status = 0
37 for fname in args.FILE:
38 try:
39 dump(fname, defaults.PYTHON3_VERSION, args.quiet)
40 except CompileError as e:
41 for msg in e.messages:
42 sys.stderr.write("%s\n" % msg)
43 status = 1
44 sys.exit(status)
45
46
47if __name__ == "__main__":

Callers 1

dump-ast.pyFile · 0.70

Calls 4

dumpFunction · 0.85
add_argumentMethod · 0.80
exitMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…