diff --git a/CHANGELOG.md b/CHANGELOG.md index 7697709..e58222b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.6] - 2023-09-23 +### Fixed +- Logical expressions should be allowed in function arguments + ## [0.6.5] - 2023-09-11 ### Fixed - Certain numbers were not parsed correctly @@ -172,6 +176,7 @@ Previously, no modification would be made and no errors/exceptions thrown. ### Added - Basic design draft +[0.6.6]: https://github.com/f3ath/jessie/compare/0.6.5...0.6.6 [0.6.5]: https://github.com/f3ath/jessie/compare/0.6.4...0.6.5 [0.6.4]: https://github.com/f3ath/jessie/compare/0.6.3...0.6.4 [0.6.3]: https://github.com/f3ath/jessie/compare/0.6.2...0.6.3 diff --git a/lib/src/grammar/json_path.dart b/lib/src/grammar/json_path.dart index d4fb981..ad69104 100644 --- a/lib/src/grammar/json_path.dart +++ b/lib/src/grammar/json_path.dart @@ -63,6 +63,7 @@ class JsonPathGrammarDefinition extends GrammarDefinition> { literal, _filterPath(), ref0(_funExpr), + ref0(_logicalExpr), ].toChoiceParser().trim(); Parser _funCall(T Function(FunCall) toFun) => diff --git a/pubspec.yaml b/pubspec.yaml index 6d54ed4..54b934e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: json_path -version: 0.6.5 +version: 0.6.6 description: Implementation of JSONPath expressions like "$.store.book[2].price". Reads and writes values in parsed JSON objects. homepage: "https://github.com/f3ath/jessie" diff --git a/test/cases/extra/cases.json b/test/cases/extra/cases.json index cf46511..6a3222d 100644 --- a/test/cases/extra/cases.json +++ b/test/cases/extra/cases.json @@ -47,6 +47,12 @@ "selector" : "$[?is_boolean(@)]", "document" : [1, true, {}, [42], "foo", {"a": "b"}, false], "result": [true, false] + }, + { + "name": "parens in functional args", + "selector" : "$[?xor((@.b), (@.a))]", + "document" : [{"a": 0}, {"a": 0, "b": 0}, {"b": 0}, {}], + "result": [{"a": 0}, {"b": 0}] } ] } \ No newline at end of file