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

Method unclosed_class_error

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

Return an "unclosed class" error whose span points to the most recently opened class. This should only be called while parsing a character class.

(&self)

Source from the content-addressed store, hash-verified

908 ///
909 /// This should only be called while parsing a character class.
910 fn unclosed_class_error(&self) -> ast::Error {
911 for state in self.parser().stack_class.borrow().iter().rev() {
912 match *state {
913 ClassState::Open { ref set, .. } => {
914 return self.error(set.span, ast::ErrorKind::ClassUnclosed);
915 }
916 _ => {}
917 }
918 }
919 // We are guaranteed to have a non-empty stack with at least
920 // one open bracket, so we should never get here.
921 panic!("no open character class found")
922 }
923
924 /// Push the current set of class items on to the class parser's stack as
925 /// the left hand side of the given operator.

Callers 2

parse_set_classMethod · 0.80
parse_set_class_rangeMethod · 0.80

Calls 3

parserMethod · 0.80
iterMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected