Returns true if and only if this AST has any (including possibly empty) subexpressions.
(&self)
| 527 | /// Returns true if and only if this AST has any (including possibly empty) |
| 528 | /// subexpressions. |
| 529 | fn has_subexprs(&self) -> bool { |
| 530 | match *self { |
| 531 | Ast::Empty(_) |
| 532 | | Ast::Flags(_) |
| 533 | | Ast::Literal(_) |
| 534 | | Ast::Dot(_) |
| 535 | | Ast::Assertion(_) => false, |
| 536 | Ast::Class(_) |
| 537 | | Ast::Repetition(_) |
| 538 | | Ast::Group(_) |
| 539 | | Ast::Alternation(_) |
| 540 | | Ast::Concat(_) => true, |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | /// Print a display representation of this Ast. |