hsh :: command :: LeafToken :: Class LeafToken
[hide private]
[frames] | no frames]

Class LeafToken

object --+    
         |    
     Token --+
             |
            LeafToken
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__str__(self)
Return the raw text entered by the user.
 
__len__(self)
There is no default implementation of this method.
 
modify(self, txt='', begin=0, end=None)
Modify this token by replacing the text between begin and end with the given text.
 
dump(self)
Return a representation of the token tree as a list of strings.

Inherited from Token: commences, completions, expand, expand_directives, terminated, terminates

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from Token: commencer_ch, dquotable

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

Return the raw text entered by the user. There is no default implementation of this method.

Overrides: object.__str__
(inherited documentation)

__len__(self)
(Length operator)

 

There is no default implementation of this method.

Overrides: Token.__len__
(inherited documentation)

modify(self, txt='', begin=0, end=None)

 

Modify this token by replacing the text between begin and end with the given text. begin defaults to the beginning of the token, end to the end, and txt to the empty string.

Returns a 3-tuple:

  1. string: text which wasn't used by this token and spills over to the next token.
  2. boolean: True means that this token may absorb some characters from the next token. Spill over is not possible in this case.
  3. boolean: True means that this token needs to be deleted. May include spillover.

The default implementation checks the insertion range, raising an exception in case of error, but does not perform the actual modify.

Overrides: Token.modify
(inherited documentation)

dump(self)

 

Return a representation of the token tree as a list of strings. The default implementation returns an empty list.

Overrides: Token.dump
(inherited documentation)