MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / parse

Function parse

crates/sith_python_parser/src/lib.rs:212–214  ·  view source on GitHub ↗

Parse the given Python source code using the specified [`Mode`]. This function is the most general function to parse Python code. Based on the [`Mode`] supplied, it can be used to parse a single expression, a full Python program, an interactive expression or a Python program containing IPython escape commands. # Example If we want to parse a simple expression, we can use the [`Mode::Expression`

(source: &str, mode: Mode)

Source from the content-addressed store, hash-verified

210/// assert!(parsed.is_ok());
211/// ```
212pub fn parse(source: &str, mode: Mode) -> Result<Parsed<Mod>, ParseError> {
213 parse_unchecked(source, mode).into_result()
214}
215
216/// Parse the given Python source code using the specified [`Mode`].
217///

Callers 4

try_downloadMethod · 0.85
_build_docMethod · 0.85

Calls 2

parse_uncheckedFunction · 0.85
into_resultMethod · 0.80

Tested by 2