File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/Codec/CBOR/Cuddle/CBOR Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,14 @@ genForCTree (CTree.Control op target controller) = do
308
308
tt <- resolveIfRef target
309
309
ct <- resolveIfRef controller
310
310
case (op, ct) of
311
+ (CtlOp. Le , CTree. Literal (VUInt n)) -> case tt of
312
+ CTree. Postlude PTUInt -> S . TInteger <$> genUniformRM (0 , fromIntegral n)
313
+ _ -> error " Cannot apply le operator to target"
314
+ (CtlOp. Le , _) -> error $ " Invalid controller for .le operator: " <> show controller
315
+ (CtlOp. Lt , CTree. Literal (VUInt n)) -> case tt of
316
+ CTree. Postlude PTUInt -> S . TInteger <$> genUniformRM (0 , fromIntegral n - 1 )
317
+ _ -> error " Cannot apply lt operator to target"
318
+ (CtlOp. Lt , _) -> error $ " Invalid controller for .lt operator: " <> show controller
311
319
(CtlOp. Size , CTree. Literal (VUInt n)) -> case tt of
312
320
CTree. Postlude PTText -> S . TString <$> genText (fromIntegral n)
313
321
CTree. Postlude PTBytes -> S . TBytes <$> genBytes (fromIntegral n)
You can’t perform that action at this time.
0 commit comments