Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes
MoinMoin.support.pygments.lexers.math.MatlabSessionLexer Class Reference
Inheritance diagram for MoinMoin.support.pygments.lexers.math.MatlabSessionLexer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.pygments.lexers.math.MatlabSessionLexer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def get_tokens_unprocessed

Static Public Attributes

string name = 'Matlab session'
list aliases = ['matlabsession']

Detailed Description

For Matlab (or GNU Octave) sessions.  Modeled after PythonConsoleLexer.
Contributed by Ken Schutte <kschutte@csail.mit.edu>.

*New in Pygments 0.10.*

Definition at line 204 of file math.py.


Member Function Documentation

Definition at line 214 of file math.py.

00214 
00215     def get_tokens_unprocessed(self, text):
00216         mlexer = MatlabLexer(**self.options)
00217 
00218         curcode = ''
00219         insertions = []
00220 
00221         for match in line_re.finditer(text):
00222             line = match.group()
00223 
00224             if line.startswith('>>'):
00225                 insertions.append((len(curcode),
00226                                    [(0, Generic.Prompt, line[:3])]))
00227                 curcode += line[3:]
00228 
00229             elif line.startswith('???'):
00230 
00231                 idx = len(curcode)
00232 
00233                 # without is showing error on same line as before...?
00234                 line = "\n" + line
00235                 token = (0, Generic.Traceback, line)
00236                 insertions.append(  (idx, [token,]) )
00237 
00238             else:
00239                 if curcode:
00240                     for item in do_insertions(
00241                         insertions, mlexer.get_tokens_unprocessed(curcode)):
00242                         yield item
00243                     curcode = ''
00244                     insertions = []
00245 
00246                 yield match.start(), Generic.Output, line
00247 
00248         if curcode: # or item:
00249             for item in do_insertions(
00250                 insertions, mlexer.get_tokens_unprocessed(curcode)):
00251                 yield item
00252 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 212 of file math.py.

Definition at line 211 of file math.py.


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