Commit ea50a6d0 authored by Paul Ogris's avatar Paul Ogris
Browse files

Support aggregates in relations

This is a bit of a hack, but it's the quickest way to get aggregates to
parse. We don't need to inspect them, since they remain unchanged in
relaxation.
parent 841d72d8
......@@ -195,7 +195,14 @@ signedAtom :: Parser SignedAtom
signedAtom = try (negation *> (Negative <$> atom)) <|> (Positive <$> atom)
relation :: Parser Relation
relation = lexeme $ takeWhileP Nothing (\x -> x `notElem` [',', '.'])
relation = lexeme $ do
a <- takeWhileP Nothing (\x -> x `notElem` [',', '.', '{'])
b <- option "" $ do
_ <- openBrace
aggregate <- takeWhileP Nothing (/= '}')
rest <- takeWhileP Nothing (\x -> x `notElem` [',','.'])
pure $ "{ " <> aggregate <> rest
pure $ a <> b
stmt :: Parser Statement
stmt = StmtRule <$> rule
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment