@@ -86,25 +86,26 @@ record syn = do (doc, paramDocs, acc, opts) <- try (do
8686
8787 let constructorDoc' = annotate syn ist constructorDoc
8888
89− fields <- many . indented $ field syn
89+ fields <- many . indented $ fieldLine syn
9090
91− return (fields, constructorName, constructorDoc')
91+ return (concat fields, constructorName, constructorDoc')
9292 where
93− field :: SyntaxInfo -> IdrisParser ((Maybe (Name, FC)), Plicity, PTerm, Maybe (Docstring (Either Err PTerm)))
94− field syn = do doc <- optional docComment
95− c <- optional $ lchar '{'
96− n <- (do (n, nfc) <- fnName
97− return $ Just (expandNS syn n, nfc))
98− <|> (do symbol "_"
99− return Nothing)
100− lchar ':'
101− t <- typeExpr (allowImp syn)
102− p <- endPlicity c
103− ist <- get
104− let doc' = case doc of -- Temp: Throws away any possible arg docs
105− Just (d,_) -> Just $ annotate syn ist d
106− Nothing -> Nothing
107− return (n, p, t, doc')
93+ fieldLine :: SyntaxInfo -> IdrisParser [(Maybe (Name, FC), Plicity, PTerm, Maybe (Docstring (Either Err PTerm)))]
94+ fieldLine syn = do
95+ doc <- optional docComment
96+ c <- optional $ lchar '{'
97+ let oneName = (do (n, nfc) <- fnName
98+ return $ Just (expandNS syn n, nfc))
99+ <|> (symbol "_" >> return Nothing)
100+ ns <- commaSeparated oneName
101+ lchar ':'
102+ t <- typeExpr (allowImp syn)
103+ p <- endPlicity c
104+ ist <- get
105+ let doc' = case doc of -- Temp: Throws away any possible arg docs
106+ Just (d,_) -> Just $ annotate syn ist d
107+ Nothing -> Nothing
108+ return $ map (\n -> (n, p, t, doc')) ns
108109
109110 constructor :: IdrisParser (Name, FC)
110111 constructor = (reservedHL "constructor") *> fnName