Re: JSON compatibility

Andy Bakun <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
On Sat, 2007-05-05 at 10:56 -0700, Oren Ben-Kiki wrote:
> I just noticed that for some inexplicable reason, in JSON "\/" is the
> same as "/". No idea why they added escaping the perfectly innocent
> slash character, but it is in their spec. We'll need to add "\/" as a
> valid escape sequence in the YAML spec to maintain being a JSON
> superset.

I agree, this is extremely odd.  Additionally, the definition of a
string, in both the graphical representation and the simple BNF on the
right, is internally inconsistent, as the straight through path doesn't
mention solidus in the exceptions; or solidus is classified as a control
character.

Pages 18-20 of ECMA-262 (dated '99, is that the latest?) doesn't define
slash as an valid escape character.

I assume you are suggesting to add "\/" as yielding "/" on input only,
and not suggesting that "\/" be emitted when generating a YAML string
for "/"?  By ECMA-262, which I presume JSON is meant to be fully
compatible with, "\z", where z is not an already specified escape
character, yields the literal "z".

-- 
Andy Bakun <[email protected]>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.