Git Product home page Git Product logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
It may be a convenient extension for some applications but we need to carefully 
think
of the following items:
- It's not part of JSON spec (http://www.ietf.org/rfc/rfc4627.txt)
- We have to develop an extension grammar (in BNF or other forms) to JSON spec 
and
make compatible to original one
- It may confuse some of users (we have some users who don't like the extension 
of
JSON spec in the implementation, see comments on
http://code.google.com/p/json-simple/wiki/DecodingExamples#Notes_-_Multithreadin
g_and_extensions).

So I am a bit reluctant to add this feature.

Original comment by [email protected] on 17 Mar 2010 at 8:37

from json-simple.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
I did notice these discussions earlier.  I am definitely sympathetic to both 
sides, 
although I would find this extension useful.  Allow me to ask a few questions 
which 
might simplify your decisions:

- if I were to provide a patch for this, would you accept it?
- if I were to provide a patch for this and the requested "strict" mode, would 
you 
accept that?

Original comment by matt.fowles on 17 Mar 2010 at 3:01

from json-simple.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
That will be great!
May I ask what the grammar for the single quoted strings is?
And may I have a look at the codes?

Thanks.

Original comment by [email protected] on 17 Mar 2010 at 4:16

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from json-simple.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
The grammar for string would become:

string := double_quote_string | single_quote_string ;
double_quote_string := " double_quote__char* " ;
single_quote_string := ' single_quote_char* '  ;
double_quote_char := any-Unicode-character-except-"-or-\-or-control-character
 | \"
 | escape_sequence ;
single_quote_char := any-Unicode-character-except-'-or-\-or-control-character
 | \'
 | escape_sequence ;
escape_sequence := \\ | \/ | \b | \f | \n | \r | \t | \u four-hex-digits ;

I have not written the code yet because I was not sure if you would accept the 
patch or 
not.

Original comment by matt.fowles on 17 Mar 2010 at 5:06

from json-simple.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
Thanks a lot for providing the grammar. It looks good.
And it seems the changes will have non-trivial impacts on the existing codes. 
Could
you provide a sample scenario which requires this enhancement? We need to make 
sure
why we need such kind of enhancement.

Thanks.   

Original comment by [email protected] on 18 Mar 2010 at 5:51

from json-simple.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
When hardcoding JSON in Java, the string within string issue becomes quite 
annoying:

String json = "{ \"asdf\" : \"qwer\\\"zxcv\" }"

vs

String json = "{ 'asdf' : 'qwer\"zxcv' }"


Also, because xml allows either form of quoting for attributes, copying and 
pasting 
strings from xml requires extra work converting.

Original comment by matt.fowles on 18 Mar 2010 at 3:03

from json-simple.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 11, 2024
I still haven't implemented this because I was waiting on some sort of 
indication as to whether or not the code would be accepted.  Sorry for the long 
delay in response, but life got distracting.

Original comment by matt.fowles on 8 Jun 2010 at 3:30

from json-simple.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.