Attempts to convert the [`Parsed `] into a [`Parsed `]. This method checks if the `syntax` field of the output is a [`Mod::Expression`]. If it is, the method returns [`Some(Parsed )`] with the contained expression. Otherwise, it returns [`None`]. [`Some(Parsed )`]: Some
(self)
| 317 | /// |
| 318 | /// [`Some(Parsed<ModExpression>)`]: Some |
| 319 | pub fn try_into_expression(self) -> Option<Parsed<ModExpression>> { |
| 320 | match self.syntax { |
| 321 | Mod::Module(_) => None, |
| 322 | Mod::Expression(expression) => Some(Parsed { |
| 323 | syntax: expression, |
| 324 | tokens: self.tokens, |
| 325 | errors: self.errors, |
| 326 | }), |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | impl Parsed<ModModule> { |
no outgoing calls
no test coverage detected