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

Class BracedToken

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

Super class for tokens which can be enclosed in braces, after a commencing character like $ or ~.

Instance Methods [hide private]
 
_braced(self)
 
_text(self)
 
terminates(self, ch)
Return a pair of strings if the first character of the provided text would terminate this token.
 
terminated(self)
Return True if this token will not accept any more characters at the end because it has terminated.
 
_completions(self, cloc, possibilities, root=None, brace=True)

Inherited from LeafToken: __init__, __len__, __str__, dump, modify

Inherited from Token: commences, completions, expand, expand_directives

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]

terminates(self, ch)

 

Return a pair of strings if the first character of the provided text would terminate this token. The first string are the characters to be included in the token, the second are the characters which spill over to the next token. Return None if the text would not terminate the token.

The token mustn't end in an escape character (\) because that would make the test incorrect.

The default implementation matches txt against the regexp self.terminator. On a match it returns match groups 1 and 2, otherwise it returns None. The default value of self.terminator is ()(\s) to terminate on whitespace, but not accept it.

Overrides: Token.terminates
(inherited documentation)

terminated(self)

 

Return True if this token will not accept any more characters at the end because it has terminated. The default implementation returns False.

Overrides: Token.terminated
(inherited documentation)