Skip to content

Optional JSOL (Object Literals) support #11

@prof-milki

Description

@prof-milki

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions