File tree 5 files changed +23
-0
lines changed
5 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ genPostlude pt = case pt of
202
202
PTText -> TString <$> genText 30
203
203
PTAny -> pure $ TString " Any"
204
204
PTNil -> pure TNull
205
+ PTUndefined -> pure $ TSimple 23
205
206
206
207
--------------------------------------------------------------------------------
207
208
-- Kinds of terms
@@ -427,6 +428,7 @@ genValue (VText t) = pure $ TString t
427
428
genValue (VBytes b) = case Base16. decode b of
428
429
Right bHex -> pure $ TBytes bHex
429
430
Left err -> error $ " Unable to parse hex encoded bytestring: " <> err
431
+ genValue (VBool b) = pure $ TBool b
430
432
431
433
--------------------------------------------------------------------------------
432
434
-- Generator functions
Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ data Value
375
375
| VFloat64 Double
376
376
| VText T. Text
377
377
| VBytes B. ByteString
378
+ | VBool Bool
378
379
deriving (Eq , Generic , Show )
379
380
deriving anyclass (ToExpr )
380
381
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ data PTerm
49
49
| PTText
50
50
| PTAny
51
51
| PTNil
52
+ | PTUndefined
52
53
deriving (Eq , Generic , Ord , Show )
53
54
54
55
instance Hashable PTerm
Original file line number Diff line number Diff line change @@ -191,11 +191,28 @@ buildRefCTree rules = CTreeRoot $ fmap toCTreeRule rules
191
191
toCTreeT0 t0
192
192
toCTreeT2 (T2Tag (Just tag) t0) =
193
193
It . CTree. Tag tag $ toCTreeT0 t0
194
+ toCTreeT2 (T2DataItem 7 (Just mmin)) =
195
+ toCTreeDataItem mmin
194
196
toCTreeT2 (T2DataItem _maj _mmin) =
195
197
-- We don't validate numerical items yet
196
198
It $ CTree. Postlude PTAny
197
199
toCTreeT2 T2Any = It $ CTree. Postlude PTAny
198
200
201
+ toCTreeDataItem 20 =
202
+ It . CTree. Literal $ VBool False
203
+ toCTreeDataItem 21 =
204
+ It . CTree. Literal $ VBool True
205
+ toCTreeDataItem 25 =
206
+ It $ CTree. Postlude PTHalf
207
+ toCTreeDataItem 26 =
208
+ It $ CTree. Postlude PTFloat
209
+ toCTreeDataItem 27 =
210
+ It $ CTree. Postlude PTDouble
211
+ toCTreeDataItem 23 =
212
+ It $ CTree. Postlude PTUndefined
213
+ toCTreeDataItem _ =
214
+ It $ CTree. Postlude PTAny
215
+
199
216
toCTreeGroupEntryNC :: WithComments GroupEntry -> CTree. Node OrRef
200
217
toCTreeGroupEntryNC = toCTreeGroupEntry . stripComment
201
218
Original file line number Diff line number Diff line change @@ -218,3 +218,5 @@ instance Pretty Value where
218
218
pretty (VFloat64 i) = pretty i
219
219
pretty (VText t) = enclose " \" " " \" " $ pretty t
220
220
pretty (VBytes b) = fromString $ " h" <> " '" <> BS. unpack b <> " '"
221
+ pretty (VBool True ) = " true"
222
+ pretty (VBool False ) = " false"
You can’t perform that action at this time.
0 commit comments