MCPcopy Create free account
hub / github.com/davidblewett/rure-python / push_class_open

Method push_class_open

regex/regex-syntax/src/ast/parse.rs:834–846  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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

Callers 1

parse_set_classMethod · 0.80

Calls 3

parse_set_class_openMethod · 0.80
parserMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected