Attempts to convert the [`Parsed `] into a [`Parsed `]. This method checks if the `syntax` field of the output is a [`Mod::Module`]. If it is, the method returns [`Some(Parsed )`] with the contained module. Otherwise, it returns [`None`]. [`Some(Parsed )`]: Some
(self)
| 492 | /// |
| 493 | /// [`Some(Parsed<ModModule>)`]: Some |
| 494 | pub fn try_into_module(self) -> Option<Parsed<ModModule>> { |
| 495 | match self.syntax { |
| 496 | Mod::Module(module) => Some(Parsed { |
| 497 | syntax: module, |
| 498 | tokens: self.tokens, |
| 499 | errors: self.errors, |
| 500 | unsupported_syntax_errors: self.unsupported_syntax_errors, |
| 501 | }), |
| 502 | Mod::Expression(_) => None, |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | /// Attempts to convert the [`Parsed<Mod>`] into a [`Parsed<ModExpression>`]. |
| 507 | /// |
no outgoing calls