pmacs3/mode_console.py

22 lines
719 B
Python
Raw Normal View History

import color, mode2
2007-06-24 09:51:43 -04:00
from lex2 import Grammar, PatternRule
class ConsoleGrammar(Grammar):
rules = [
PatternRule(name=r'mesg', pattern=r'^[A-Za-z].*$'),
PatternRule(name=r'input', pattern=r'^>>>.*$'),
PatternRule(name=r'input', pattern=r'^-->.*$'),
2007-06-24 09:51:43 -04:00
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'),
'output': color.build('default', 'default'),
}
2007-03-06 10:05:38 -05:00
def name(self):
return "Console"