From 49ecf5acfd71e11fe0355d0582bf95c74da0a890 Mon Sep 17 00:00:00 2001 From: moculus Date: Tue, 30 Sep 2008 01:02:23 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- application.py | 1 + mode/javascript.py | 4 +++- mode/python.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/application.py b/application.py index 2a3b1aa..48ea08f 100755 --- a/application.py +++ b/application.py @@ -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'), diff --git a/mode/javascript.py b/mode/javascript.py index 4a46708..dcac744 100644 --- a/mode/javascript.py +++ b/mode/javascript.py @@ -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, "'"), diff --git a/mode/python.py b/mode/python.py index f1c6eaa..8caa1b2 100644 --- a/mode/python.py +++ b/mode/python.py @@ -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):