Skip to content

Commit 88d4a8c

Browse files
committed
Re-fourmolize with 0.17.0.0
1 parent 8c2caac commit 88d4a8c

File tree

4 files changed

+80
-79
lines changed

4 files changed

+80
-79
lines changed

src/Codec/CBOR/Cuddle/CBOR/Validator.hs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -740,26 +740,26 @@ flattenGroup :: HasCallStack => CDDL -> [Rule] -> [Rule]
740740
flattenGroup cddl nodes =
741741
mconcat
742742
[ case resolveIfRef cddl rule of
743-
Literal {} -> [rule]
744-
Postlude {} -> [rule]
745-
Map {} -> [rule]
746-
Array {} -> [rule]
747-
Choice {} -> [rule]
748-
KV {} -> [rule]
749-
Occur {} -> [rule]
750-
Range {} -> [rule]
751-
Control {} -> [rule]
752-
Enum e -> case resolveIfRef cddl e of
743+
Literal {} -> [rule]
744+
Postlude {} -> [rule]
745+
Map {} -> [rule]
746+
Array {} -> [rule]
747+
Choice {} -> [rule]
748+
KV {} -> [rule]
749+
Occur {} -> [rule]
750+
Range {} -> [rule]
751+
Control {} -> [rule]
752+
Enum e -> case resolveIfRef cddl e of
753+
Group g -> flattenGroup cddl g
754+
_ -> error "Malformed cddl"
755+
Unwrap g -> case resolveIfRef cddl g of
756+
Map n -> flattenGroup cddl n
757+
Array n -> flattenGroup cddl n
758+
Tag _ n -> [n]
759+
_ -> error "Malformed cddl"
760+
Tag {} -> [rule]
753761
Group g -> flattenGroup cddl g
754-
_ -> error "Malformed cddl"
755-
Unwrap g -> case resolveIfRef cddl g of
756-
Map n -> flattenGroup cddl n
757-
Array n -> flattenGroup cddl n
758-
Tag _ n -> [n]
759-
_ -> error "Malformed cddl"
760-
Tag {} -> [rule]
761-
Group g -> flattenGroup cddl g
762-
_ -> error "Not yet implemented"
762+
_ -> error "Not yet implemented"
763763
| rule <- nodes
764764
]
765765

src/Codec/CBOR/Cuddle/CDDL/Resolve.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ import Codec.CBOR.Cuddle.CDDL as CDDL
4848
import Codec.CBOR.Cuddle.CDDL.CTree (
4949
CTree (..),
5050
CTreeExt,
51-
ProvidedParameters (..), CTreeRoot (..),
51+
CTreeRoot (..),
52+
ProvidedParameters (..),
5253
)
5354
import Codec.CBOR.Cuddle.CDDL.CTree qualified as CTree
5455
import Codec.CBOR.Cuddle.CDDL.Postlude (PTerm (..))

test/Test/Codec/CBOR/Cuddle/CDDL/Parser.hs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -347,27 +347,27 @@ type2Spec = describe "type2" $ do
347347
, gcComment = Comment mempty
348348
}
349349
:| [ GrpChoice
350-
{ gcGroupEntries =
351-
[ GroupEntry
352-
{ geOccurrenceIndicator = Nothing
353-
, geComment = Comment mempty
354-
, geVariant =
355-
GEType
356-
Nothing
357-
( Type0
358-
{ t0Type1 =
359-
Type1
360-
{ t1Main = T2Name (Name {name = "string", nameComment = Comment mempty}) Nothing
361-
, t1TyOp = Nothing
362-
, t1Comment = Comment mempty
363-
}
364-
:| []
365-
}
366-
)
367-
}
368-
]
369-
, gcComment = Comment mempty
370-
}
350+
{ gcGroupEntries =
351+
[ GroupEntry
352+
{ geOccurrenceIndicator = Nothing
353+
, geComment = Comment mempty
354+
, geVariant =
355+
GEType
356+
Nothing
357+
( Type0
358+
{ t0Type1 =
359+
Type1
360+
{ t1Main = T2Name (Name {name = "string", nameComment = Comment mempty}) Nothing
361+
, t1TyOp = Nothing
362+
, t1Comment = Comment mempty
363+
}
364+
:| []
365+
}
366+
)
367+
}
368+
]
369+
, gcComment = Comment mempty
370+
}
371371
]
372372
}
373373
)
@@ -395,22 +395,22 @@ type2Spec = describe "type2" $ do
395395
, gcComment = Comment mempty
396396
}
397397
:| [ GrpChoice
398-
{ gcGroupEntries =
399-
[ GroupEntry
400-
{ geOccurrenceIndicator = Nothing
401-
, geComment = Comment mempty
402-
, geVariant =
403-
GEType
404-
Nothing
405-
( Type0
406-
{ t0Type1 =
407-
Type1 {t1Main = T2Value (value $ VUInt 1), t1TyOp = Nothing, t1Comment = Comment mempty} :| []
408-
}
409-
)
410-
}
411-
]
412-
, gcComment = Comment mempty
413-
}
398+
{ gcGroupEntries =
399+
[ GroupEntry
400+
{ geOccurrenceIndicator = Nothing
401+
, geComment = Comment mempty
402+
, geVariant =
403+
GEType
404+
Nothing
405+
( Type0
406+
{ t0Type1 =
407+
Type1 {t1Main = T2Value (value $ VUInt 1), t1TyOp = Nothing, t1Comment = Comment mempty} :| []
408+
}
409+
)
410+
}
411+
]
412+
, gcComment = Comment mempty
413+
}
414414
]
415415
}
416416
)

test/Test/Codec/CBOR/Cuddle/CDDL/Pretty.hs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,30 +86,30 @@ drep =
8686
]
8787
mempty
8888
:| [ GrpChoice
89-
[ GroupEntry
90-
Nothing
91-
mempty
92-
(GEType Nothing (Type0 $ Type1 (T2Value . value $ VUInt 1) Nothing mempty :| []))
93-
, GroupEntry
94-
Nothing
95-
mempty
96-
(GEType Nothing (Type0 $ Type1 (T2Name "script_hash" Nothing) Nothing mempty :| []))
97-
]
98-
mempty
89+
[ GroupEntry
90+
Nothing
91+
mempty
92+
(GEType Nothing (Type0 $ Type1 (T2Value . value $ VUInt 1) Nothing mempty :| []))
93+
, GroupEntry
94+
Nothing
95+
mempty
96+
(GEType Nothing (Type0 $ Type1 (T2Name "script_hash" Nothing) Nothing mempty :| []))
97+
]
98+
mempty
9999
, GrpChoice
100-
[ GroupEntry
101-
Nothing
102-
mempty
103-
(GEType Nothing (Type0 $ Type1 (T2Value . value $ VUInt 2) Nothing mempty :| []))
104-
]
105-
mempty
100+
[ GroupEntry
101+
Nothing
102+
mempty
103+
(GEType Nothing (Type0 $ Type1 (T2Value . value $ VUInt 2) Nothing mempty :| []))
104+
]
105+
mempty
106106
, GrpChoice
107-
[ GroupEntry
108-
Nothing
109-
mempty
110-
(GEType Nothing (Type0 $ Type1 (T2Value . value $ VUInt 3) Nothing mempty :| []))
111-
]
112-
mempty
107+
[ GroupEntry
108+
Nothing
109+
mempty
110+
(GEType Nothing (Type0 $ Type1 (T2Value . value $ VUInt 3) Nothing mempty :| []))
111+
]
112+
mempty
113113
]
114114
)
115115
)

0 commit comments

Comments
 (0)