MCPcopy
hub / github.com/psf/black / parse_file

Method parse_file

src/blib2to3/pgen2/driver.py:187–193  ·  view source on GitHub ↗

Parse a file and return the syntax tree.

(
        self, filename: Path, encoding: str | None = None, debug: bool = False
    )

Source from the content-addressed store, hash-verified

185 return p.rootnode
186
187 def parse_file(
188 self, filename: Path, encoding: str | None = None, debug: bool = False
189 ) -> NL:
190 """Parse a file and return the syntax tree."""
191 with open(filename, encoding=encoding) as stream:
192 text = stream.read()
193 return self.parse_string(text, debug)
194
195 def parse_string(self, text: str, debug: bool = False) -> NL:
196 """Parse a string and return the syntax tree."""

Callers

nothing calls this directly

Calls 2

parse_stringMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected