Skip to content

Can't apply control operators to values that the rfc considers valid #71

Open
@jasagredo

Description

@jasagredo

Because of this code:

    (CtlOp.Lt, CTree.Literal (VUInt n)) -> case tt of
      CTree.Postlude PTUInt -> S . TInteger <$> genUniformRM (0, fromIntegral n - 1)
      _ -> error "Cannot apply lt operator to target"

We can only apply rules like uint .lt 2. It forbids the following cases:

rule1 = nint .lt 2
rule2 = int .lt 2
rule3 = 1..5 .lt 2
rule4 = 1 .lt 2
rule5 = ((1..3) / (1..5)) .lt 2

All these cases are accepted by the cddl tool. The same seems to happen with most of the other control operators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions