import pyjsparser import pyjsparser.parser from . import translating_nodes import hashlib import re # Enable Js2Py exceptions and pyimport in parser pyjsparser.parser.ENABLE_JS2PY_ERRORS = True pyjsparser.parser.ENABLE_PYIMPORT = True # the re below is how we'll recognise numeric constants. # it finds any 'simple numeric that is not preceded with an alphanumeric character # the numeric can be a float (so a dot is found) but # it does not recognise notation such as 123e5, 0xFF, infinity or NaN CP_NUMERIC_RE = re.compile(r'(?