Skip to content

Fallback parsing of literals as strings is invalid and inconsistent #90

@gibson042

Description

@gibson042

https://jmespath.org/specification.html#grammar and https://jmespath.site/#spec-grammar both require a `…` literal to contain a valid JSON value. tokenize('`[x]`') accordingly throws a SyntaxError, but expressions like tokenize('`x`') and tokenize('`0x`') and tokenize('`Infinity`') incorrectly return a Literal.

If support for "the old syntax of allowing elided quotes in JSON literal expressions" is intentional, then it should be consistent and should also come with a deprecation warning (cf. JEP-12).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions