pmacs3/mode/console.py

25 lines
968 B
Python
Raw Normal View History

2007-10-21 20:55:29 -04:00
import color, mode
2007-10-21 20:52:48 -04:00
from lex import Grammar, PatternRule, RegionRule
from mode.python import StringGrammar1, StringGrammar2, PythonGrammar
2007-07-21 11:40:53 -04:00
2008-10-19 18:00:51 -04:00
#class ConsoleGrammar(Grammar):
# rules = [
# RegionRule(r'string', r'"', StringGrammar2, r'"'),
# RegionRule(r'string', r"'", StringGrammar1, r"'"),
# RegionRule(r'console_input', r'^(?:>>>|-->)', PythonGrammar, '\n$'),
# PatternRule(r'console_mesg', r'^[A-Za-z].*$'),
# PatternRule(r'console_reserved', r'True|False|None'),
# PatternRule(r'console_bareword', r'[a-zA-Z_][a-zA-Z0-9_]*'),
# ]
2007-10-21 20:55:29 -04:00
class Console(mode.Fundamental):
2007-10-18 17:07:35 -04:00
modename = 'Console'
2008-10-19 18:00:51 -04:00
# grammar = ConsoleGrammar()
# colors = {
# 'console_mesg': ('red', 'default', 'bold'),
# 'console_input.start': ('red', 'default', 'bold'),
# 'console_reserved': ('magenta', 'default', 'bold'),
# 'console_bareword': ('default', 'default', 'bold'),
# }
2007-10-19 02:41:33 -04:00
install = Console.install