mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +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
@ -305,11 +305,14 @@ $(pure [])
|
||||
|
||||
instance FromNoun Bolt where
|
||||
parseNoun = \case
|
||||
A c -> pure $ Key $ C.chr $ fromIntegral c
|
||||
n -> $(deriveFromNounFunc ''Bolt) n
|
||||
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