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)
| 299 | /// |
| 300 | /// [`Some(Parsed<ModModule>)`]: Some |
| 301 | pub fn try_into_module(self) -> Option<Parsed<ModModule>> { |
| 302 | match self.syntax { |
| 303 | Mod::Module(module) => Some(Parsed { |
| 304 | syntax: module, |
| 305 | tokens: self.tokens, |
| 306 | errors: self.errors, |
| 307 | }), |
| 308 | Mod::Expression(_) => None, |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /// Attempts to convert the [`Parsed<Mod>`] into a [`Parsed<ModExpression>`]. |
| 313 | /// |
no outgoing calls
no test coverage detected