There is a discrepancy with how the JS library parses whitespace vs the PHP library. ```php $p = new \JmesPath\Parser(); var_dump($p->parse("[]\r[]")); array(3) { ["type"]=> string(10) "projection" ["from"]=> string(5) "array" ["children"]=> array(2) { [0]=> array(2) { ["type"]=> string(7) "flatten" ["children"]=> array(1) { [0]=> array(3) { ["type"]=> string(10) "projection" ["from"]=> string(5) "array" ["children"]=> array(2) { [0]=> array(2) { ["type"]=> string(7) "flatten" ["children"]=> array(1) { [0]=> array(1) { ["type"]=> string(7) "current" } } } [1]=> array(1) { ["type"]=> string(7) "current" } } } } } [1]=> array(1) { ["type"]=> string(7) "current" } } } ``` ```js jmespath.compile("[]\r[]"); jmespath.js:309 Uncaught LexerError: Unknown character: at Lexer.tokenize (https://run.plnkr.co/preview/ck3fuluzv0006315wgzsg94tg/jmespath.js:307:31) at Parser._loadTokens (https://run.plnkr.co/preview/ck3fuluzv0006315wgzsg94tg/jmespath.js:523:30) at Parser.parse (https://run.plnkr.co/preview/ck3fuluzv0006315wgzsg94tg/jmespath.js:508:16) at Object.compile (https://run.plnkr.co/preview/ck3fuluzv0006315wgzsg94tg/jmespath.js:1647:22) at <anonymous>:1:10 ``` It seems to me 1 of the implementations is wrong, not sure which.
Activity
SamMousa commentedon Nov 26, 2019
Javascript uses this: https://github.com/jmespath/jmespath.js/blob/master/jmespath.js#L212
PHP uses this: https://github.com/jmespath/jmespath.php/blob/master/src/Lexer.php#L73