branch : pmacs2
This commit is contained in:
moculus 2008-09-30 01:02:23 +00:00
parent d4f4b89573
commit 49ecf5acfd
3 changed files with 5 additions and 1 deletions

View File

@ -59,6 +59,7 @@ class Application(object):
'comment.end': ('red', 'default', 'bold'),
'continuation': ('red', 'default', 'bold'),
'string.start': ('green', 'default', 'bold'),
'string.data': ('green', 'default', 'bold'),
'string.null': ('green', 'default', 'bold'),
'string.hex': ('magenta', 'default', 'bold'),
'string.octal': ('magenta', 'default', 'bold'),

View File

@ -26,8 +26,10 @@ class JavascriptGrammar(Grammar):
# whether a "/" starts a literal regex, or is part of a mathematical
# expression/assignment. so for now we will require either a space or $
# after / in order to *not* treat it as a regex. dammit!
PatternRule(r'eol', r'\n'),
PatternRule(r'spaces', r' +'),
PatternRule(r'delimiter', r'%=|&&=|&=|\(|\)|\*=|\+=|,|-=|\.{3}|\.|/=(?= |$)|::|:|;|<<=|>>=|>>>=|\?|\[|\]|^=|^^=|\{|\}|\|=|\|\|='),
PatternRule(r'operator', r'!==|!=|!|%|&&|&|\*|\+\+|\+|--|-|/(?= |$)|<<=|<<|<=|<|===|==|=|>>>=|>>>|>>=|>>|>=|>|\\'),
PatternRule(r'operator', r'!==|!=|!|%|&&|&|\*|\+\+|\+|--|-|/(?= |$)|<<=|<<|<=|<|===|==|=|>>>=|>>>|>>=|>>|>=|>|\\|\|\|'),
RegionRule('js_regex', "/", StringGrammar, "/"),
RegionRule('string', "'", StringGrammar, "'"),

View File

@ -8,6 +8,7 @@ class StringGrammar(Grammar):
PatternRule(r'octal', r'\\[0-7]{3}'),
PatternRule(r'hex', r'\\x[0-9a-fA-F]{2}'),
PatternRule(r'escaped', r'\\.'),
PatternRule(r'data', r'[^\\"\']+'),
]
class PythonGrammar(Grammar):