We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a discrepancy with how the JS library parses whitespace vs the PHP library.
$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" } } }
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.
The text was updated successfully, but these errors were encountered:
Javascript uses this: https://github.com/jmespath/jmespath.js/blob/master/jmespath.js#L212
var skipChars = { " ": true, "\t": true, "\n": true };
PHP uses this: https://github.com/jmespath/jmespath.php/blob/master/src/Lexer.php#L73
' ' => self::STATE_WHITESPACE, "\t" => self::STATE_WHITESPACE, "\n" => self::STATE_WHITESPACE, "\r" => self::STATE_WHITESPACE,
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
There is a discrepancy with how the JS library parses whitespace vs the PHP library.
It seems to me 1 of the implementations is wrong, not sure which.
The text was updated successfully, but these errors were encountered: