on master help sign in
A localizer cannot always be produced
commit4914a4162e662aea07fcadd2aea4f8676cc980da authorEvan Czaplicki <evancz@users.noreply.github.com> dateSat 10 Feb 2018, 17:56 (9 years ago) parent22a5c27
1 file changed+5−24
src/Elm/Compiler.hs+5−24
src/Elm/Compiler.hs+5−24
@@ -4,8 +4,6 @@ module Elm.Compiler
44 , Context(..)
55 , Compile.Artifacts(..)
66 , compile
7− , Localizer
8− , dummyLocalizer
97 , Error.Error
108 , errorsToDoc
119 , Warning.Warning
@@ -24,7 +22,6 @@ import qualified Elm.Package as Pkg
2422import qualified Reporting.Error as Error
2523import qualified Reporting.Helpers as H
2624import qualified Reporting.Render.Code as Code
27−import qualified Reporting.Render.Type as RenderType
2825import qualified Reporting.Report as Report
2926import qualified Reporting.Result as Result
3027import qualified Reporting.Warning as Warning
@@ -52,38 +49,22 @@ data Context =
5249 }
5350
5451
55−compile :: Context -> BS.ByteString -> (Localizer, [Warning.Warning], Either [Error.Error] Compile.Artifacts)
52+compile :: Context -> BS.ByteString -> ([Warning.Warning], Either [Error.Error] Compile.Artifacts)
5653compile (Context pkg exposed importDict interfaces) source =
5754 let
5855 docsFlag =
5956 if exposed then Compile.YesDocs else Compile.NoDocs
60−
61− (warnings, errorOrArtifacts) =
62− Result.run $ Compile.compile docsFlag pkg importDict interfaces source
6357 in
64− ( dummyLocalizer, warnings, errorOrArtifacts )
65−
66−
67−
68−-- DEALIASER
69−
70−
71−newtype Localizer =
72− Localizer RenderType.Localizer
73−
74−
75−dummyLocalizer :: Localizer
76−dummyLocalizer =
77− Localizer Map.empty
58+ Result.run $ Compile.compile docsFlag pkg importDict interfaces source
7859
7960
8061
8162-- ERRORS
8263
8364
84−errorsToDoc :: FilePath -> Text.Text -> Localizer -> [Error.Error] -> H.Doc
85−errorsToDoc filePath source (Localizer localizer) errors =
65+errorsToDoc :: FilePath -> Text.Text -> [Error.Error] -> H.Doc
66+errorsToDoc filePath source errors =
8667 H.vcat $
8768 map
8869 (Report.toDoc filePath)
89− (concatMap (Error.toReports (Code.toSource source) localizer) errors)
70+ (concatMap (Error.toReports (Code.toSource source) Map.empty) errors)