Skip to content

Commit

Permalink
Logical expressions should be allowed in function arguments (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath authored Sep 24, 2023
1 parent 576d2b9 commit 57d144b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/src/grammar/json_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class JsonPathGrammarDefinition extends GrammarDefinition<Expression<Nodes>> {
literal,
_filterPath(),
ref0(_funExpr),
ref0(_logicalExpr),
].toChoiceParser().trim();

Parser<T> _funCall<T>(T Function(FunCall) toFun) =>
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
6 changes: 6 additions & 0 deletions test/cases/extra/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}]
}
]
}

0 comments on commit 57d144b

Please sign in to comment.