mirror of
https://github.com/github/semantic.git
synced 2024-11-27 12:57:49 +03:00
Parse block nodes (incorrectly).
This commit is contained in:
parent
b7f1d1f928
commit
52f6d2b07c
@ -137,6 +137,7 @@ parseNode o = do
|
||||
"false" -> pure (const (bool False))
|
||||
"throw" -> fmap throw <$> edge (head edges)
|
||||
"if" -> liftA3 iff <$> findEdge (edgeNamed "condition") <*> findEdge (edgeNamed "consequence") <*> findEdge (edgeNamed "alternative") <|> pure (const noop)
|
||||
"block" -> pure (const (bool True))
|
||||
t -> A.parseFail ("unrecognized type: " <> t)
|
||||
edge = A.withObject "edge" (fmap (flip (IntMap.!)) . (A..: pack "sink"))
|
||||
edgeNamed name sink attrs = attrs A..: pack "type" >>= guard . (== name) >> pure (IntMap.! sink)
|
||||
|
Loading…
Reference in New Issue
Block a user