From 4188bc2fda175a7584886da3560374dcf9425bf6 Mon Sep 17 00:00:00 2001 From: Tom Dryer Date: Sat, 12 Jul 2014 14:11:56 -0700 Subject: [PATCH] Upgrade to purplex 0.2.2 This version of purplex no longer depends on PLY. --- hangups/javascript.py | 6 ++---- setup.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hangups/javascript.py b/hangups/javascript.py index 06c601fe..ff8232ef 100644 --- a/hangups/javascript.py +++ b/hangups/javascript.py @@ -30,7 +30,7 @@ def loads(string): 'u': '', # unicode escapes are a special case } _STRING_RE = ('(\'(([^\\\\\'])|(\\\\[{0}]))*?\')|("(([^\\\\"])|(\\\\[{0}]))*?")' - .format(''.join(_ESCAPES.keys()).replace('\\', '\\\\'))) + .format(''.join(_ESCAPES.keys()).replace('\\', '\\\\'))) def _unescape_string(s): @@ -93,6 +93,7 @@ class JavaScriptParser(purplex.Parser): # pylint: disable=C0111,R0201,W0613,R0913 LEXER = JavaScriptLexer + START = 'e' PRECEDENCE = () @purplex.attach('listitems : e') @@ -163,9 +164,6 @@ def false(self, t): def string(self, s): return _unescape_string(s[1:-1]) - def on_error(self, p): - raise ValueError('Failed to load JavaScript: parse failed') - # instantiate the parser at module-load time for better performance _PARSER = JavaScriptParser() diff --git a/setup.py b/setup.py index 84e8061d..9c8263a5 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def run_tests(self): ], packages=['hangups'], install_requires=[ - 'purplex==0.1.5', + 'purplex==0.2.2', 'tornado==3.2.1', 'requests==2.2.1', 'urwid==1.2.1',