jmespath / jmespath/jmespath.js
Fallback parsing of literals as strings is invalid and inconsistent
- Dominant language
- JavaScript
- Stars
- 847
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
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](https://github.com/jmespath/jmespath.site/blob/master/docs/proposals/raw-string-literals.rst#impact)).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.