shithub: MicroHs

Download patch

ref: 405cddb412eae4af7cefb1091612290f875d5dc4
parent: 01437fade6ad582b1395e285a6eba7f77568d8e9
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Sat Feb 10 09:47:43 EST 2024

Allow extra ';' in blocks

--- a/src/MicroHs/Parse.hs
+++ b/src/MicroHs/Parse.hs
@@ -338,7 +338,8 @@
 
 pFields :: P (Either [SType] [(Ident, SType)])
 pFields = Left  <$> emany pSAType
-      <|> Right <$> (pSpec '{' *> esepBy ((,) <$> (pLIdentSym <* pSymbol "::") <*> pSType) (pSpec ',') <* pSpec '}')
+      <|> Right <$> (pSpec '{' *> (concatMap flat <$> esepBy ((,) <$> (esepBy1 pLIdentSym (pSpec ',') <* pSymbol "::") <*> pSType) (pSpec ',') <* pSpec '}'))
+  where flat (is, t) = map (,t) is
 
 pSAType :: P (Bool, EType)
 pSAType = (,) <$> pStrict <*> pAType
--