Parse the given Python source code using the specified [`PySourceType`].
(source: &str, source_type: PySourceType)
| 292 | |
| 293 | /// Parse the given Python source code using the specified [`PySourceType`]. |
| 294 | pub fn parse_unchecked_source(source: &str, source_type: PySourceType) -> Parsed<ModModule> { |
| 295 | // SAFETY: Safe because `PySourceType` always parses to a `ModModule` |
| 296 | Parser::new(source, ParseOptions::from(source_type)) |
| 297 | .parse() |
| 298 | .try_into_module() |
| 299 | .unwrap() |
| 300 | } |
| 301 | |
| 302 | /// Parses each `range` of `source` as an independent module and concatenates the results into a |
| 303 | /// single [`Parsed<ModModule>`] whose nodes keep their offsets into `source`. |
nothing calls this directly
no test coverage detected