Lines Matching refs:dup
2591 # Once a node / subtree has been used in a stream, it must be dup'd
2594 # If dirty, then next() always returns a dup.
2651 size==1. If we've already used the element, dup (dirty bit set).
2657 # if out of elements and size is 1, dup
2659 return self.dup(el)
2679 if len(self) == 1: # if size is 1, it's ok; return and we'll dup
2682 # out of elements and size was not 1, so we can't dup
2696 def dup(self, el):
2698 When constructing trees, sometimes we need to dup a token or AST
2699 subtree. Dup'ing a token means just creating another AST node
2701 the element is for a tree root; then it must be a node dup.
2760 def dup(self, el):
2761 raise TypeError("dup can't be called for a token stream.")
2773 must dup the type node, but ID has been added.
2775 Referencing a rule result twice is ok; dup entire tree as
2779 a proper way to refactor. This needs to always call dup node
2780 and super.next() doesn't know which to call: dup node or dup tree.
2786 # if out of elements and size is 1, dup (at most a single node
2796 # dup just the root (want node here)
2800 def dup(self, el):
2819 def dup(self, el):
2820 # we dup every node, so don't have to worry about calling dup; short-
2822 raise TypeError("dup can't be called for a node stream.")