2007-03-06 10:05:38 -05:00
|
|
|
import sets, sys
|
2007-05-06 00:32:20 -04:00
|
|
|
import color, commands, default, lex, lex_tt, method, mode, point, regex, tab_xml
|
2007-03-06 10:05:38 -05:00
|
|
|
|
|
|
|
class Template(mode.Fundamental):
|
|
|
|
def __init__(self, w):
|
|
|
|
mode.Fundamental.__init__(self, w)
|
|
|
|
|
2007-05-06 00:32:20 -04:00
|
|
|
#self.grammar = lex_xml.XMLGrammar()
|
|
|
|
self.grammar = lex_tt.TTGrammar()
|
2007-03-06 10:05:38 -05:00
|
|
|
self.lexer = lex.Lexer(self.grammar)
|
|
|
|
|
|
|
|
self.add_bindings('close-paren', (')',))
|
|
|
|
self.add_bindings('close-brace', ('}',))
|
|
|
|
self.add_bindings('close-bracket', (']',))
|
|
|
|
|
|
|
|
self.default_color = color.build('default', 'default')
|
|
|
|
self.colors = {
|
2007-05-06 00:32:20 -04:00
|
|
|
'template': color.build('magenta', 'default'),
|
2007-03-06 10:05:38 -05:00
|
|
|
'markup': color.build('red', 'default'),
|
|
|
|
'namespace': color.build('magenta', 'default'),
|
|
|
|
'opentag': color.build('blue', 'default'),
|
|
|
|
'nodevalue': color.build('default', 'default'),
|
|
|
|
'attrname': color.build('cyan', 'default'),
|
|
|
|
'attrvalue': color.build('green', 'default'),
|
|
|
|
'closetag': color.build('blue', 'default'),
|
|
|
|
'comment': color.build('red', 'default'),
|
|
|
|
'bizzaro': color.build('magenta', 'green'),
|
|
|
|
}
|
|
|
|
|
|
|
|
self.tabber = tab_xml.XMLTabber(self)
|
|
|
|
|
|
|
|
def name(self):
|
2007-05-06 00:32:20 -04:00
|
|
|
return "Template"
|