pike.git / src / post_modules / JSON / JSON.pmod.in

version» Context lines:

pike.git/src/post_modules/JSON/JSON.pmod.in:1:      #pike __REAL_VERSION__ + #require constant(@module@)      //! @ignore - #if !constant (@module@) - constant this_program_does_not_exist = 1; - #else +    inherit @module@;   //! @endignore      //! @appears Standards.JSON module   //!   //! Tools for handling the JSON structured data format. See - //! @url{http://www.json.org/@} and RFC 4627. + //! @url{http://www.json.org/@} and @rfc{4627@}.      //! @ignore   // Use getters and Val-> to ensure dynamic resolving in case the   // values in Val.pmod are replaced.   Val.True `->true() {return Val->true;}   Val.False `->false() {return Val->false;}   Val.Null `->null() {return Val->null;}   //! @endignore      //! @decl Val.True true
pike.git/src/post_modules/JSON/JSON.pmod.in:38:    constant error_type = "json_decode";    constant is_json_decode_error = 1;       //! The string that failed to be decoded.    string err_str;       //! The failing position in @[err_str].    int err_pos;       protected void create(string err_str, int err_pos, void|string reason, void|array bt) { -  this_program::err_str = err_str; -  this_program::err_pos = err_pos; +  this::err_str = err_str; +  this::err_pos = err_pos;       string pre_context = err_pos > 13 ?    sprintf ("...%O", err_str[err_pos - 10..err_pos - 1]) :    err_pos > 0 ?    sprintf ("%O", err_str[..err_pos - 1]) :    "";    if (err_pos >= sizeof (err_str))    err_str = sprintf ("%s-><-", pre_context);    else {    string post_context = err_pos < sizeof (err_str) - 14 ?
pike.git/src/post_modules/JSON/JSON.pmod.in:898:    // matching schema    errors += ({ sprintf("JSON invalid: Object %O has unexpected property %O\n",    key, prop_key) });    }       errors = filter(errors, stringp); // remove all non-errors    if (sizeof(errors)) return errors * "";    else return 0;    }   } -  - #endif // constant (@module@) +