Skip to content

Loading…

[clarinet] string escaping #1

Closed
thejh opened this Issue · 4 comments

2 participants

@thejh
Collaborator

Well, no clarinet here, can't test stuff, but looks to me like we're just stripping backslashes from strings, not interpreting \u0000 or so.

@thejh thejh was assigned
@thejh
Collaborator

Either a bunch of new states and stuff... or we cache the string with quotes and everything and then use JSON.parse on it.

@dscape
Owner

@thejh No, we deal with \u0000 fine I think:

https://github.com/dscape/clarinet/blob/master/test/clarinet.js#L35-#L44

If you think that test case is wrong and not running for some reason then we should fix this bug :)

@thejh
Collaborator
parser.write('{"a": "\\u0000"}').close();
OPEN a
VALUE u0000
CLOSE
END

Compare it to v8s JSON.parse:

> JSON.parse('{"a": "\\u0000"}')
{ a: '\u0000' }

http://json.org/ has a spec. We have to recognize backslash followed by one control character and backslash followed by u and four digits. And parse that stuff.

@thejh
Collaborator

Fixed.

@thejh thejh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.