MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / BranchPattern

Class BranchPattern

preprocessor/docopt.py:133–147  ·  view source on GitHub ↗

Branch/inner node of a pattern tree.

Source from the content-addressed store, hash-verified

131
132
133class BranchPattern(Pattern):
134
135 """Branch/inner node of a pattern tree."""
136
137 def __init__(self, *children):
138 self.children = list(children)
139
140 def __repr__(self):
141 return '%s(%s)' % (self.__class__.__name__,
142 ', '.join(repr(a) for a in self.children))
143
144 def flat(self, *types):
145 if type(self) in types:
146 return [self]
147 return sum([child.flat(*types) for child in self.children], [])
148
149
150class Argument(LeafPattern):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected