pmacs3/mode_console.py

26 lines
865 B
Python
Raw Normal View History

2007-06-24 09:51:43 -04:00
import code, string, StringIO, sys, traceback
import color, completer, method, mode2
from lex2 import Grammar, PatternRule
from point2 import Point
class ConsoleGrammar(Grammar):
rules = [
PatternRule(name=r'mesg', pattern=r'^[A-Za-z].*$'),
PatternRule(name=r'input', pattern=r'^>>>.*$'),
PatternRule(name=r'input2', pattern=r'^-->.*$'),
PatternRule(name=r'output', pattern=r'^ .*$'),
]
class Console(mode2.Fundamental):
grammar = ConsoleGrammar()
2007-03-06 10:05:38 -05:00
def __init__(self, w):
2007-06-24 09:51:43 -04:00
mode2.Fundamental.__init__(self, w)
self.colors = {
'mesg': color.build('blue', 'default'),
'input': color.build('cyan', 'default'),
'input2': color.build('cyan', 'default'),
'output': color.build('default', 'default'),
}
2007-03-06 10:05:38 -05:00
def name(self):
return "Console"