Skip to content

Commit

Permalink
Upgrade to purplex 0.2.2
Browse files Browse the repository at this point in the history
This version of purplex no longer depends on PLY.
  • Loading branch information
tdryer committed Jul 12, 2014
1 parent 66fdf48 commit 4188bc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions hangups/javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -93,6 +93,7 @@ class JavaScriptParser(purplex.Parser):

# pylint: disable=C0111,R0201,W0613,R0913
LEXER = JavaScriptLexer
START = 'e'
PRECEDENCE = ()

@purplex.attach('listitems : e')
Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 4188bc2

Please sign in to comment.