8000 Add experimental fast parser powered by typed_ast · python/mypy@46c44df · GitHub
[go: up one dir, main page]

Skip to content

Commit 46c44df

Browse files
committed
Add experimental fast parser powered by typed_ast
1 parent e360dae commit 46c44df

File tree

5 files changed

+767
-4
lines changed

5 files changed

+767
-4
lines changed

mypy/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
DUMP_TYPE_STATS = 'dump-type-stats'
5252
DUMP_INFER_STATS = 'dump-infer-stats'
5353
SILENT_IMPORTS = 'silent-imports' # Silence imports of .py files
54+
FAST_PARSER = 'fast-parser' # Use experimental fast parser
5455
# Disallow calling untyped functions from typed ones
5556
DISALLOW_UNTYPED_CALLS = 'disallow-untyped-calls'
5657

@@ -833,7 +834,8 @@ def parse(self, source_text: Union[str, bytes], fnam: str) -> MypyFile:
833834
tree = parse.parse(source_text, fnam, self.errors(),
834835
pyversion=self.manager.pyversion,
835836
custom_typing_module=self.manager.custom_typing_module,
836-
implicit_any=self.manager.implicit_any)
837+
implicit_any=self.manager.implicit_any,
838+
fast_parser=FAST_PARSER in self.manager.flags)
837839
tree._fullname = self.id
838840
if self.errors().num_messages() != num_errs:
839841
self.errors().raise_error()

0 commit comments

Comments
 (0)
0