44 lines
2.0 KiB
Python
44 lines
2.0 KiB
Python
|
import re, sets, string, sys
|
||
|
import color, commands, default, lex, lex_javascript, method, mode, point, regex, tab_javascript
|
||
|
|
||
|
class Javascript(mode.Fundamental):
|
||
|
def __init__(self, w):
|
||
|
mode.Fundamental.__init__(self, w)
|
||
|
|
||
|
self.tag_matching = True
|
||
|
self.grammar = lex_javascript.JavascriptGrammar()
|
||
|
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_attr(color.pairs('default', 'default'))
|
||
|
self.colors = {
|
||
|
'keyword' : color.build('cyan', 'default', 'bold'),
|
||
|
'pseudo-keyword' : color.build('cyan', 'default', 'bold'),
|
||
|
'built-in method' : color.build('cyan', 'default', 'bold'),
|
||
|
'function declaration' : color.build('blue', 'default', 'bold'),
|
||
|
'class declaration' : color.build('green', 'default'),
|
||
|
'string4' : color.build('green', 'default'),
|
||
|
'string3' : color.build('green', 'default'),
|
||
|
'string2' : color.build('green', 'default'),
|
||
|
'string1' : color.build('green', 'default'),
|
||
|
'comment' : color.build('red', 'default'),
|
||
|
'continuation' : color.build('red', 'default'),
|
||
|
#'operator' : color.build('yellow', 'default'),
|
||
|
#'delimiter' : color.build('magenta', 'default'),
|
||
|
'system_identifier' : color.build('cyan', 'default', 'bold'),
|
||
|
#'bound method' : color.build('yellow', 'default'),
|
||
|
'import statement' : color.build('magenta', 'green'),
|
||
|
'bizzaro' : color.build('magenta', 'green'),
|
||
|
}
|
||
|
|
||
|
#self.highlighter.lex_buffer()
|
||
|
#self.get_regions()
|
||
|
self.tabber = tab_javascript.JavascriptTabber(self)
|
||
|
|
||
|
def name(self):
|
||
|
return "Javascript"
|
||
|
|