Skip to content
New issue

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

Logical expressions should be allowed in function arguments #82

Merged
merged 3 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}]
}
]
}
Loading