26 lines
865 B
Python
26 lines
865 B
Python
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()
|
|
def __init__(self, w):
|
|
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'),
|
|
}
|
|
def name(self):
|
|
return "Console"
|