Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.support.pygments.token._TokenType Class Reference

List of all members.

Public Member Functions

def split
def __init__
def __contains__
def __getattr__
def __hash__
def __repr__

Public Attributes

 subtypes

Static Public Attributes

 parent = None

Detailed Description

Definition at line 17 of file token.py.


Constructor & Destructor Documentation

Definition at line 29 of file token.py.

00029 
00030     def __init__(self, *args):
00031         # no need to call super.__init__
00032         self.subtypes = set()


Member Function Documentation

Definition at line 33 of file token.py.

00033 
00034     def __contains__(self, val):
00035         return self is val or (
00036             type(val) is self.__class__ and
00037             val[:len(self)] == self
00038         )

Definition at line 39 of file token.py.

00039 
00040     def __getattr__(self, val):
00041         if not val or not val[0].isupper():
00042             return tuple.__getattribute__(self, val)
00043         new = _TokenType(self + (val,))
00044         setattr(self, val, new)
00045         self.subtypes.add(new)
00046         new.parent = self
00047         return new

Definition at line 48 of file token.py.

00048 
00049     def __hash__(self):
00050         return hash(tuple(self))

Definition at line 51 of file token.py.

00051 
00052     def __repr__(self):
00053         return 'Token' + (self and '.' or '') + '.'.join(self)
00054 

Definition at line 20 of file token.py.

00020 
00021     def split(self):
00022         buf = []
00023         node = self
00024         while node is not None:
00025             buf.append(node)
00026             node = node.parent
00027         buf.reverse()
00028         return buf


Member Data Documentation

Definition at line 18 of file token.py.

Definition at line 31 of file token.py.


The documentation for this class was generated from the following file: