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)
| 511 | /// |
| 512 | /// [`Some(Parsed<ModExpression>)`]: Some |
| 513 | pub fn try_into_expression(self) -> Option<Parsed<ModExpression>> { |
| 514 | match self.syntax { |
| 515 | Mod::Module(_) => None, |
| 516 | Mod::Expression(expression) => Some(Parsed { |
| 517 | syntax: expression, |
| 518 | tokens: self.tokens, |
| 519 | errors: self.errors, |
| 520 | unsupported_syntax_errors: self.unsupported_syntax_errors, |
| 521 | }), |
| 522 | } |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | impl Parsed<ModModule> { |
no outgoing calls
no test coverage detected