Skip to content

Commit

Permalink
Bump petitparser to 5.0.0. Fixes #29 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath authored Mar 21, 2022
1 parent a3b1283 commit c59b1d7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: google/dart:beta
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Update submodules
run: git submodule update --init --recursive
- name: Print Dart version
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ 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.3.1 - 2021-12-18
## [0.4.0] - 2022-03-21
### Changed
- Dart 2.16
- Dependency bump: petitparser 5.0.0

## [0.3.1] - 2021-12-18
### Added
- Filtering expressions

Expand Down Expand Up @@ -97,6 +102,8 @@ Previously, no modification would be made and no errors/exceptions thrown.
### Added
- Basic design draft

[0.4.0]: https://github.com/f3ath/jessie/compare/0.3.1...0.4.0
[0.3.1]: https://github.com/f3ath/jessie/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/f3ath/jessie/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/f3ath/jessie/compare/0.1.2...0.2.0
[0.1.2]: https://github.com/f3ath/jessie/compare/0.1.1...0.1.2
Expand Down
18 changes: 14 additions & 4 deletions lib/src/grammar/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ final _escapedControl = _escapedSlash |
_escapedReturn |
_escapedTab;

// The parser does not seem to support Unicode 6.0 boundary (0x10FFFF).
// We're limiting ourselves to Unicode 1.0 boundary (0xFFFF).
final _unicodeBoundary = String.fromCharCode(0xFFFF);

// Exclude double quote '"' and back slash '\'
final _doubleUnescaped =
range(0x20, 0x21) | range(0x23, 0x5B) | range(0x5D, 0x10FFF);
range(' ', '!') | range('#', '[') | range(']', _unicodeBoundary);

final _hexDigit = anyOf('0123456789ABCDEF');

Expand All @@ -37,8 +42,9 @@ final _doubleInner =
.star()
.map((value) => value.join(''));

// Exclude single quote "'" and back slash "\"
final _singleUnescaped =
range(0x20, 0x26) | range(0x28, 0x5B) | range(0x5D, 0x10FFF);
range(' ', '&') | range('(', '[') | range(']', _unicodeBoundary);

final _escapedSingleQuote = (_escape & _singleQuote).map((_) => "'");

Expand All @@ -55,5 +61,9 @@ final doubleQuotedString = (_doubleQuote & _doubleInner & _doubleQuote)
final singleQuotedString = (_singleQuote & _singleInner & _singleQuote)
.map<String>((value) => value[1]);

final dotString =
(anyOf('-_') | letter() | digit() | range(0x80, 0x10FFF)).plus().flatten();
final dotString = (anyOf('-_') |
letter() |
digit() |
range(String.fromCharCode(0x80), _unicodeBoundary))
.plus()
.flatten();
17 changes: 11 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: json_path
version: 0.3.1
version: 0.4.0
description: Implementation of JSONPath expressions like "$.store.book[2].price". Reads and writes values in parsed JSON objects.
homepage: "https://github.com/f3ath/jessie"

environment:
sdk: '>=2.15.1 <3.0.0'
sdk: '>=2.16.0 <3.0.0'

dependencies:
rfc_6901: ^0.1.0
petitparser: ^4.0.0
rfc_6901: ^0.1.1
petitparser: ^5.0.0

dev_dependencies:
lints: ^1.0.1
test: ^1.20.0
test: ^1.20.1
path: ^1.8.1
check_coverage: ^0.0.2
check_coverage: ^0.0.4
cider: ^0.1.0

cider:
link_template:
tag: https://github.com/f3ath/jessie/releases/tag/%tag%
diff: https://github.com/f3ath/jessie/compare/%from%...%to%

0 comments on commit c59b1d7

Please sign in to comment.