cddl icon indicating copy to clipboard operation
cddl copied to clipboard

`.and` operator not fully supported?

Open thomas-fossati opened this issue 2 years ago • 1 comments

I have this CDDL snippet:

m = non-empty<{
  ? 0 => "zero"
}>

non-empty<M> = (M) .and ({ + any => any })

which produces this error:

> docker run -i --rm -v $PWD:/data -w /data ghcr.io/anweiss/cddl-cli:latest compile-cddl --cddl non-empty.cddl
error: parser errors
  ┌─ input:5:20
  │
5 │ non-empty<M> = (M) .and ({ + any => any })
  │                    ^^^^ expected rule identifier followed by an assignment token '=', '/=' or '//='

Error: "Parser error"

It looks like .and is not fully supported?

thomas-fossati avatar Apr 22 '22 09:04 thomas-fossati

Hmmm, thanks for reporting @thomas-fossati. It should be supported but it may be the way in which the crate is being compiled for the container image. Will take a look.

anweiss avatar May 26 '22 17:05 anweiss