class documentation

class NegatedPattern(BasePattern): (source)

View In Hierarchy

Undocumented

Method __init__ Initializer.
Method generate_matches Generator yielding all matches for this pattern.
Method match Does this pattern exactly match a node?
Method match_seq Does this pattern exactly match a sequence of nodes?
Instance Variable content Undocumented

Inherited from BasePattern:

Method __new__ Constructor that prevents BasePattern from being instantiated.
Method __repr__ Undocumented
Method optimize A subclass can define this as a hook for optimizations.
Class Variable name Undocumented
Class Variable type Undocumented
Property type_repr Get the type as a human-readable string.
def __init__(self, content=None): (source)

Initializer. The argument is either a pattern or None. If it is None, this only matches an empty sequence (effectively '$' in regex lingo). If it is not None, this matches whenever the argument pattern doesn't have any matches.

def generate_matches(self, nodes): (source)

Generator yielding all matches for this pattern. Default implementation for non-wildcard patterns.

def match(self, node): (source)

Does this pattern exactly match a node? Returns True if it matches, False if not. If results is not None, it must be a dict which will be updated with the nodes matching named subpatterns. Default implementation for non-wildcard patterns.

def match_seq(self, nodes): (source)

Does this pattern exactly match a sequence of nodes? Default implementation for non-wildcard patterns.