@@ -20,13 +20,14 @@ import qualified Reporting.Result as Result
2020import qualified Validate
2121
2222
23+
2324program
2425 :: Package.Name
2526 -> OpTable
2627 -> String
2728 -> Result.Result wrn Error.Error M.ValidModule
2829program pkgName table src =
29− do (M.Module name filePath docs exports imports sourceDecls) <-
30+ do (M.Module kind name filePath docs exports imports sourceDecls) <-
3031 parseWithTable table src (programParser pkgName)
3132
3233 validDecls <- Validate.declarations sourceDecls
@@ -37,14 +38,16 @@ program pkgName table src =
3738 , imports
3839 )
3940
40− return (M.Module name filePath docs exports ammendedImports validDecls)
41+ return (M.Module kind name filePath docs exports ammendedImports validDecls)
42+
4143
4244
4345-- HEADERS AND DECLARATIONS
4446
47+
4548programParser :: Package.Name -> IParser M.SourceModule
4649programParser pkgName =
47− do (M.Header name docs exports imports) <- Module.header
50+ do (M.Header kind name docs exports imports) <- Module.header
4851 decls <- declarations
4952 _ <- many (spaces <|> newline)
5053 eof
@@ -52,7 +55,7 @@ programParser pkgName =
5255 let canonicalName =
5356 ModuleName.Canonical pkgName name
5457
55− return $ M.Module canonicalName "" docs exports imports decls
58+ return $ M.Module kind canonicalName "" docs exports imports decls
5659
5760
5861declarations :: IParser [D.SourceDecl]
@@ -68,8 +71,10 @@ freshDef =
6871 Decl.declaration
6972
7073
74+
7175-- RUN PARSERS
7276
77+
7378parse :: String -> IParser a -> Result.Result wrn Error.Error a
7479parse source parser =
7580 case iParse parser source of
@@ -101,6 +106,7 @@ parseWithTable table source parser =
101106
102107-- INFIX INFO
103108
109+
104110makeInfixTable
105111 :: Map.Map String (Int, D.Assoc)
106112 -> [(String, InfixInfo)]
@@ -142,4 +148,4 @@ parseFixities =
142148data InfixInfo = InfixInfo
143149 { _region :: R.Region
144150 , _info :: (Int, D.Assoc)
145− }
151+ }