Lines Matching defs:stack
159 /// The purpose of this limit is to act as a heuristic to prevent stack
162 /// constant stack space and moving the call stack to the heap), other
246 /// A stack of grouped sub-expressions, including alternations.
248 /// A stack of nested character classes. This is only non-empty when
276 /// GroupState represents a single stack frame while parsing nested groups
292 /// stack, then this state should be modified to include the new
297 /// ClassState represents a single stack frame while parsing character classes.
301 /// Note that a parser's character class stack is only non-empty when parsing
630 /// Parse and push a single alternation on to the parser's internal stack.
631 /// If the top of the stack already has an alternation, then add to that
649 /// internal stack of state.
653 let mut stack = self.parser().stack_group.borrow_mut();
654 if let Some(&mut Alternation(ref mut alts)) = stack.last_mut() {
658 stack.push(Alternation(ast::Alternation {
665 /// parser's internal stack. Return a fresh concatenation corresponding
709 /// Pop a group AST from the parser's internal stack and set the group's
723 let mut stack = self.parser().stack_group.borrow_mut();
724 let (mut prior_concat, mut group, ignore_whitespace, alt) = match stack
730 Some(Alternation(alt)) => match stack.pop() {
764 /// Pop the last state from the parser's internal stack, if it exists, and
766 /// single alternation item on the stack. Any other scenario produces an
773 let mut stack = self.parser().stack_group.borrow_mut();
774 let ast = match stack.pop() {
788 match stack.pop() {
793 // `GroupState::Alternation`s adjacent in the parser's stack,
796 // the stack.
806 /// parsing context onto the parser's stack. This assumes that the parser
829 /// parser stack. The union given corresponds to the last union built
836 /// If the stack is empty after popping, then this returns the final
840 /// If there is no corresponding opening bracket on the parser's stack,
851 let mut stack = self.parser().stack_class.borrow_mut();
852 match stack.pop() {
854 // We can never observe an empty stack:
856 // 1) We are guaranteed to start with a non-empty stack since
859 // 2) If we ever observe an empty stack while popping after
862 panic!("unexpected empty character class stack")
867 // Namely, every push to the class parser stack is guarded by
868 // whether an existing Op is already on the top of the stack.
869 // If it is, the existing Op is modified. That is, the stack
877 if stack.is_empty() {
898 // We are guaranteed to have a non-empty stack with at least
903 /// Push the current set of class items on to the class parser's stack as
923 /// Pop a character class set from the character class parser stack. If the
924 /// top of the stack is just an item (not an operation), then return the
925 /// given set unchanged. If the top of the stack is an operation, then the
927 /// stack. In that case, the binary operation is returned as a set.
930 let mut stack = self.parser().stack_class.borrow_mut();
931 let (kind, lhs) = match stack.pop() {
934 stack.push(state);
1877 /// when it is popped from the parser's stack.