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

Implementation of additional proposed control operators and wasm bindings for validator #79

Merged
merged 49 commits into from
Sep 13, 2021

Conversation

anweiss
Copy link
Owner

@anweiss anweiss commented Dec 2, 2020

Implements additional control operators as proposed in draft-ietf-cbor-cddl-control-05. CC @cabo

JSON:

  • numeric addition
  • string concatenation
  • string concatenation with dedenting
  • embedded abnf (ignores .abnfb)
  • features

CBOR:

  • numeric addition
  • string concatenation
  • string concatenation with dedenting
  • embedded abnf
  • features

Also includes wasm bindings for the validator module (#83), fixes for multiline byte strings and #88 and a rework of the CLI. Fixes #82 as well.

@anweiss anweiss added the enhancement New feature or request label Dec 2, 2020
@anweiss anweiss added this to the v1.0.0 milestone Dec 2, 2020
@anweiss anweiss self-assigned this Dec 2, 2020
src/lexer.rs Outdated Show resolved Hide resolved
@anweiss anweiss force-pushed the cddl-control-00 branch 2 times, most recently from 5f1cecc to c800bc1 Compare December 7, 2020 14:54
@cabo
Copy link

cabo commented Jan 13, 2021

Is adding .abnf/.abnfb part of your plans?

@anweiss
Copy link
Owner Author

anweiss commented Jan 13, 2021

@cabo indeed it is

@cabo
Copy link

cabo commented Jan 13, 2021

That is great to hear, because that will help us with moving forward on that internet-draft!

@cabo
Copy link

cabo commented Feb 22, 2021

So is the non-ABNF part of this ready for prime time?
I was updating the "Implementation Status" section of draft-ietf-cbor-cddl-control.md and was about to point to your implementation...

@anweiss
Copy link
Owner Author

anweiss commented Mar 9, 2021

@cabo not quite ready yet. Still got some kinks to iron out, even for existing control operators. Case in point, #88.

Since there don't seem to be any Rust crates that can validate a string against an ABNF grammar (there's https://crates.io/crates/abnf but it only parses ABNF), my current approach is to use https://crates.io/crates/abnf_to_pest to convert the ABNF to a Pest grammar, and then validate the string against Pest per pest-parser/pest#432. This isn't ideal, but the ABNF options in Rust are limited.

@cabo
Copy link

cabo commented Apr 21, 2021

Since there don't seem to be any Rust crates that can validate a string against an ABNF grammar (there's https://crates.io/crates/abnf but it only parses ABNF), my current approach is to use https://crates.io/crates/abnf_to_pest to convert the ABNF to a Pest grammar, and then validate the string against Pest per pest-parser/pest#432. This isn't ideal, but the ABNF options in Rust are limited.

(That is pretty much the way I have been implementing ABNF: I have the ABNF to treetop translator in the abnftt gem, and use the treetop PEG parser then. Note that this impresses a PEG interpretation on ABNF...)

@anweiss anweiss changed the title Implementation of additional proposed control operators Implementation of additional proposed control operators and wasm bindings for validator Sep 3, 2021
@anweiss anweiss marked this pull request as ready for review September 10, 2021 17:03
@anweiss
Copy link
Owner Author

anweiss commented Sep 10, 2021

Moving this out of draft status. All control operators as of draft-ietf-cbor-cddl-control-05 have been implemented. Still missing some more unit tests before merging.

@anweiss anweiss mentioned this pull request Sep 13, 2021
@anweiss anweiss merged commit 4a69948 into main Sep 13, 2021
@anweiss anweiss deleted the cddl-control-00 branch September 26, 2022 20:28
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tstr type allows maps?
2 participants