diff --git a/esprima/character.py b/esprima/character.py index 929706c..2b225fd 100644 --- a/esprima/character.py +++ b/esprima/character.py @@ -82,7 +82,7 @@ del U_CATEGORIES, UNICODE_LETTER, UNICODE_COMBINING_MARK del UNICODE_DIGIT, UNICODE_CONNECTOR_PUNCTUATION -del DECIMAL_CONV, OCTAL_CONV, HEX_CONV +# del DECIMAL_CONV, OCTAL_CONV, HEX_CONV class Character: @staticmethod diff --git a/esprima/visitor.py b/esprima/visitor.py index ad32375..236f0c4 100644 --- a/esprima/visitor.py +++ b/esprima/visitor.py @@ -282,7 +282,12 @@ def visit_dict(self, obj): v = yield item k = unicode(k) items.append((self.map.get(k, k), v)) - yield Visited(dict(items)) + items = dict(items) + if "type" in items.keys() and "raw" in items.keys() and items["type"] == 'Literal' and items["raw"] == "null": + items["value"] = None + if "type" in items.keys() and "raw" in items.keys() and items["type"] == 'Literal' and "regex" in items.keys() and type(items["value"]) == re.Pattern: + items["value"] = None + yield Visited(items) def visit_SRE_Pattern(self, obj): yield Visited({})