mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
kh: fail to parse invalid belts
Previously we would allow the tags that were added Haskell-side for union type syntax. Now we explicitly reject those before falling back to the auto-generated noun parsing logic.
This commit is contained in:
parent
0f6c3c05cd
commit
ddf579bd75
@ -306,10 +306,13 @@ $(pure [])
|
||||
instance FromNoun Bolt where
|
||||
parseNoun = \case
|
||||
A c -> pure $ Key $ C.chr $ fromIntegral c
|
||||
C (A 7955819) _ -> fail "%key not valid bolt tag"
|
||||
n -> $(deriveFromNounFunc ''Bolt) n
|
||||
|
||||
instance FromNoun Belt where
|
||||
parseNoun n = Bol <$> parseNoun n <|> $(deriveFromNounFunc ''Belt) n
|
||||
parseNoun = \case
|
||||
C (A 7106402) _ -> fail "%bol not valid belt tag"
|
||||
n -> Bol <$> parseNoun n <|> $(deriveFromNounFunc ''Belt) n
|
||||
|
||||
instance ToNoun Bolt where
|
||||
toNoun = \case
|
||||
|
Loading…
Reference in New Issue
Block a user