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

Method parse_string

src/blib2to3/pgen2/driver.py:195–198  ·  view source on GitHub ↗

Parse a string and return the syntax tree.

(self, text: str, debug: bool = False)

Source from the content-addressed store, hash-verified

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."""
197 tokens = tokenize.tokenize(text, grammar=self.grammar)
198 return self.parse_tokens(tokens, debug)
199
200 def _partially_consume_prefix(self, prefix: str, column: int) -> tuple[str, str]:
201 lines: list[str] = []

Callers 2

lib2to3_parseFunction · 0.95
parse_fileMethod · 0.95

Calls 1

parse_tokensMethod · 0.95

Tested by

no test coverage detected