diff --git a/CHANGES.md b/CHANGES.md index a1f6254..e13a707 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ * Update IMDb-pie 5.6.3 (4220e83) to 5.6.4 (f695e87) * Update MsgPack 0.6.0 (197e307) to 0.6.1 (737f08a) * Update profilehooks module 1.10.1 (fdbf19d) to 1.11.0 (e17f378) +* Update pyjsparser 2.4.5 (39b468e) to 2.7.1 (5465d03) * Update PySocks 1.6.8 (b687a34) to 1.7.0 (91dcdf0) * Update Requests library 2.21.0 (e52932c) to 2.22.0 (aeda65b) * Update scandir 1.9.0 (9ab3d1f) to 1.10.0 (982e6ba) diff --git a/lib/pyjsparser/__init__.py b/lib/pyjsparser/__init__.py index 2a9de69..9b3114f 100644 --- a/lib/pyjsparser/__init__.py +++ b/lib/pyjsparser/__init__.py @@ -1,4 +1,5 @@ -__all__ = ['PyJsParser', 'parse', 'JsSyntaxError'] +__all__ = ['PyJsParser', 'parse', 'JsSyntaxError', 'pyjsparserdata'] __author__ = 'Piotr Dabkowski' __version__ = '2.2.0' -from .parser import PyJsParser, parse, JsSyntaxError \ No newline at end of file +from .parser import PyJsParser, parse, JsSyntaxError +from . import pyjsparserdata \ No newline at end of file diff --git a/lib/pyjsparser/parser.py b/lib/pyjsparser/parser.py index c60ca5b..fa9843c 100644 --- a/lib/pyjsparser/parser.py +++ b/lib/pyjsparser/parser.py @@ -23,12 +23,16 @@ from .std_nodes import * from pprint import pprint import sys -__all__ = ['PyJsParser', 'parse', 'ENABLE_JS2PY_ERRORS', 'ENABLE_PYIMPORT', 'JsSyntaxError'] -REGEXP_SPECIAL_SINGLE = ('\\', '^', '$', '*', '+', '?', '.', '[', ']', '(', ')', '{', '{', '|', '-') +__all__ = [ + 'PyJsParser', 'parse', 'ENABLE_JS2PY_ERRORS', 'ENABLE_PYIMPORT', + 'JsSyntaxError' +] +REGEXP_SPECIAL_SINGLE = ('\\', '^', '$', '*', '+', '?', '.', '[', ']', '(', + ')', '{', '{', '|', '-') ENABLE_PYIMPORT = False ENABLE_JS2PY_ERRORS = False -PY3 = sys.version_info >= (3,0) +PY3 = sys.version_info >= (3, 0) if PY3: basestring = str @@ -84,9 +88,9 @@ class PyJsParser: # 7.4 Comments def skipSingleLineComment(self, offset): - start = self.index - offset; + start = self.index - offset while self.index < self.length: - ch = self.source[self.index]; + ch = self.source[self.index] self.index += 1 if isLineTerminator(ch): if (ord(ch) == 13 and ord(self.source[self.index]) == 10): @@ -144,14 +148,15 @@ class PyJsParser: break elif (start and ch == 0x2D): # U+002D is '-' # U+003E is '>' - if (ord(self.source[self.index + 1]) == 0x2D) and (ord(self.source[self.index + 2]) == 0x3E): + if (ord(self.source[self.index + 1]) == 0x2D) and (ord( + self.source[self.index + 2]) == 0x3E): # '-->' is a single-line comment self.index += 3 self.skipSingleLineComment(3) else: break elif (ch == 0x3C): # U+003C is '<' - if self.source[self.index + 1: self.index + 4] == '!--': + if self.source[self.index + 1:self.index + 4] == '!--': #