jmespath / jmespath/jmespath.js
Parser incorrectly parses incomplete expression
- Dominant language
- JavaScript
- Stars
- 847
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
Tested with python and the `jp` CLI, incomplete expressions should generate an error. Note the delta here:
```
$ jp --ast 'foo.'
SyntaxError: Expected identifier, lbracket, or lbrace
foo.
^
```
```
>>> import jmespath
jmespath.exceptions.ParseError: Expecting: ['quoted_identifier', 'unquoted_identifier', 'lbracket', 'lbrace'], got: eof: Parse error at column 8, token "" (EOF), for expression:
"foo.bar."
^
>>>
```
But in javascript:
```
> var jmespath = require('./jmespath');
undefined
> jmespath.compile('foo.');
{ type: 'Subexpression',
children: [ { type: 'Field', name: 'foo' }, undefined ] }
```
Javascript should be raising an error here.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.