parent
d4f4b89573
commit
49ecf5acfd
|
@ -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'),
|
||||
|
|
|
@ -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, "'"),
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue