blark.parse.parse_source_code
- blark.parse.parse_source_code(source_code: str, *, verbose: int = 0, fn: str | Path = 'unknown', preprocessors: Sequence[Callable[[str], str]] = (), parser: Lark | None = None, starting_rule: str | None = None, line_map: dict[int, int] | None = None, item: BlarkSourceItem | None = None) ParseResult [source]
Parse source code into a
ParseResult
.- Parameters:
- source_codestr
The source code text.
- verboseint, optional
Verbosity level for output. (deprecated)
- fnpathlib.Path or str, optional
The filename associated with the source code.
- preprocessorslist, optional
Callable preprocessors to apply to the source code.
- parserlark.Lark, optional
The parser instance to use. Defaults to the global shared one from
get_parser
.