Parse the opening of a character class and push the current class parsing context onto the parser's stack. This assumes that the parser is positioned at an opening `[`. The given union should correspond to the union of set items built up before seeing the `[`. If there was a problem parsing the opening of the class, then an error is returned. Otherwise, a new union of set items for the class is r
(
&self,
parent_union: ast::ClassSetUnion,
)
| 832 | /// is returned. Otherwise, a new union of set items for the class is |
| 833 | /// returned (which may be populated with either a `]` or a `-`). |
| 834 | fn push_class_open( |
| 835 | &self, |
| 836 | parent_union: ast::ClassSetUnion, |
| 837 | ) -> Result<ast::ClassSetUnion> { |
| 838 | assert_eq!(self.char(), '['); |
| 839 | |
| 840 | let (nested_set, nested_union) = self.parse_set_class_open()?; |
| 841 | self.parser().stack_class.borrow_mut().push(ClassState::Open { |
| 842 | union: parent_union, |
| 843 | set: nested_set, |
| 844 | }); |
| 845 | Ok(nested_union) |
| 846 | } |
| 847 | |
| 848 | /// Parse the end of a character class set and pop the character class |
| 849 | /// parser stack. The union given corresponds to the last union built |
no test coverage detected