Exemple #1
0
def new_decoder():
    from json.decoder import JSONDecoder
    from json.scanner import py_make_scanner
    decoder = JSONDecoder()
    decoder.parse_object = NBDecoder
    decoder.scan_once = py_make_scanner(decoder)
    return decoder
Exemple #2
0
def make_decoder():
    json.decoder.scanstring = record_parser_name(py_scanstring)

    decoder = JSONDecoder()
    decoder.parse_object = record_parser_name(decoder.parse_object)
    decoder.parse_array = record_parser_name(decoder.parse_array)
    decoder.parse_string = record_parser_name(py_scanstring)
    decoder.parse_object = record_parser_name(decoder.parse_object)

    decoder.scan_once = py_make_scanner(decoder)
    return decoder