Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional JSOL (Object Literals) support #11

Open
prof-milki opened this issue Jan 12, 2015 · 1 comment
Open

Optional JSOL (Object Literals) support #11

prof-milki opened this issue Jan 12, 2015 · 1 comment

Comments

@prof-milki
Copy link

This didn't pass through to php-internals, but it's somewhat off-topic for the PHP7 jsond RFC discussion anyway. → It's more of a feature-feasibility inquiry.

Is jsond extensible enough to somewhen support JSOL besides standard JSON?

"JSOL" is somewhat of a catchy but not widely agreed-on term. Simply meaning JavaScript Object Literals. The primary difference to JSON being unquoted object keys.

Supporting it obviously comes with the danger of encouraging its use over proper JSON. However it just happens to exist and persist in the wild. And a lot of quirky PHP userland workarounds have been concocted already to utilize it (same goes for Ruby, Python, and JavaScript of course). Just a few easy-to-google samples:

Clearly there shouldn't be json_encode() support for "JSOL". But something like a JSON_PARSE_LITERALS flag for the decoder might be desirable at some point.

Your lexing and parser tables look really tidy. So would supporting this optionally be possible at all - without harming jsonds` performance advantage in general?

@bukka
Copy link
Owner

bukka commented Jan 18, 2015

Hi,

I have been already thinking about this before. As you say that would have to be added as a non-default feature only. However it's not a priority at the moment but I might try it later and possibly do an RFC. I'll leave this issue open and update it if I do some work on it... ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants