on master help sign in
Remove 'Crash' from AST.Expression.General
92dc057Evan Czaplicki
elm-compiler.cabal−2
@@ -78,7 +78,6 @@ Library
78 Elm.Compiler.Version,
78 Elm.Compiler.Version,
79 Generate.JavaScript,
79 Generate.JavaScript,
80 Generate.JavaScript.BuiltIn,
80 Generate.JavaScript.BuiltIn,
81− Generate.JavaScript.Crash,
82 Generate.JavaScript.Helpers,
81 Generate.JavaScript.Helpers,
83 Generate.JavaScript.Literal,
82 Generate.JavaScript.Literal,
84 Generate.JavaScript.Port,
83 Generate.JavaScript.Port,
@@ -100,7 +99,6 @@ Library
100 Parse.Pattern,
99 Parse.Pattern,
101 Parse.Type,
100 Parse.Type,
102 Reporting.Annotation,
101 Reporting.Annotation,
103− Reporting.Crash,
104 Reporting.Error,
102 Reporting.Error,
105 Reporting.Error.Canonicalize,
103 Reporting.Error.Canonicalize,
106 Reporting.Error.Docs,
104 Reporting.Error.Docs,
src/AST/Expression/General.hs−5
@@ -16,7 +16,6 @@ import qualified AST.Pattern as Pattern
16import qualified AST.Type as Type
16import qualified AST.Type as Type
17import qualified AST.Variable as Var
17import qualified AST.Variable as Var
18import qualified Reporting.Annotation as A
18import qualified Reporting.Annotation as A
19−import qualified Reporting.Crash as Crash
20import qualified Reporting.PrettyPrint as P
19import qualified Reporting.PrettyPrint as P
21
20
22
21
@@ -59,7 +58,6 @@ data Expr' ann def var typ
59 -- for type checking and code gen only
58 -- for type checking and code gen only
60 | Port (PortImpl (Expr ann def var typ) typ)
59 | Port (PortImpl (Expr ann def var typ) typ)
61 | GLShader String String Literal.GLShaderTipe
60 | GLShader String String Literal.GLShaderTipe
62− | Crash Crash.Details
63 deriving (Show)
61 deriving (Show)
64
62
65
63
@@ -249,9 +247,6 @@ instance (P.Pretty def, P.Pretty var, Var.ToString var) => P.Pretty (Expr' ann d
249 Port portImpl ->
247 Port portImpl ->
250 P.pretty dealiaser needsParens portImpl
248 P.pretty dealiaser needsParens portImpl
251
249
252− Crash details ->
253− P.text ("<crash:" ++ Crash.summary details ++ ">")
254−
255
250
256instance P.Pretty (PortImpl expr tipe) where
251instance P.Pretty (PortImpl expr tipe) where
257 pretty _ _ impl =
252 pretty _ _ impl =
src/Canonicalize.hs−3
@@ -487,9 +487,6 @@ expression env (A.A region validExpr) =
487 GLShader uid src tipe ->
487 GLShader uid src tipe ->
488 Result.ok (GLShader uid src tipe)
488 Result.ok (GLShader uid src tipe)
489
489
490− Crash details ->
491− Result.ok (Crash details)
492−
493
490
494pattern
491pattern
495 :: Env.Environment
492 :: Env.Environment
src/Canonicalize/Sort.hs−3
@@ -108,9 +108,6 @@ reorder (A.A ann expression) =
108 Task name expr tipe ->
108 Task name expr tipe ->
109 (\e -> Task name e tipe) <$> reorder expr
109 (\e -> Task name e tipe) <$> reorder expr
110
110
111− Crash _ ->
112− return expression
113−
114 -- Actually do some reordering
111 -- Actually do some reordering
115 Let defs body ->
112 Let defs body ->
116 do body' <- reorder body
113 do body' <- reorder body
src/Generate/JavaScript/Crash.hsdeleted−32
@@ -1,32 +0,0 @@
1−module Generate.JavaScript.Crash where
2−
3−import Language.ECMAScript3.Syntax (Expression)
4−
5−import Generate.JavaScript.Helpers (call, obj, ref, string)
6−import qualified Reporting.Crash as Crash
7−import qualified Reporting.Region as R
8−
9−
10−localModuleName :: String
11−localModuleName =
12− "$moduleName"
13−
14−
15−crash :: Crash.Details -> Expression ()
16−crash details =
17− case details of
18− Crash.IncompleteMultiIf region ->
19− obj ["_U","badIf"]
20− `call`
21− [ ref localModuleName
22− , string (R.toString region)
23− ]
24−
25− Crash.IncompletePatternMatch _region ->
26− obj ["_U","badCase"]
27− `call`
28− [ ref localModuleName
29− , string "bugs in reporting the exact location right now" -- TODO
30− ]
31−
32−
src/Nitpick/PatternMatches.hs−3
@@ -181,9 +181,6 @@ checkExpression tagDict (A.A region expression) =
181 E.GLShader _ _ _ ->
181 E.GLShader _ _ _ ->
182 Result.ok ()
182 Result.ok ()
183
183
184− E.Crash _ ->
185− Result.ok ()
186−
187
184
188-- CHECK PATTERNS
185-- CHECK PATTERNS
189
186
src/Reporting/Crash.hsdeleted−20
@@ -1,20 +0,0 @@
1−{-# OPTIONS_GHC -Wall #-}
2−module Reporting.Crash where
3−
4−import qualified Reporting.Region as R
5−
6−
7−data Details
8− = IncompleteMultiIf R.Region
9− | IncompletePatternMatch R.Region
10− deriving (Show)
11−
12−
13−summary :: Details -> String
14−summary details =
15− case details of
16− IncompleteMultiIf _ ->
17− "incomplete-multi-if"
18−
19− IncompletePatternMatch _ ->
20− "incomplete-pattern-match"
src/Type/Constrain/Expression.hs−3
@@ -168,9 +168,6 @@ constrain env annotatedExpr@(A.A region expression) tipe =
168 E.Task _ expr _ ->
168 E.Task _ expr _ ->
169 constrain env expr tipe
169 constrain env expr tipe
170
170
171− E.Crash _ ->
172− return CTrue
173−
174
171
175-- CONSTRAIN APP
172-- CONSTRAIN APP
176
173
src/Validate.hs−3
@@ -254,9 +254,6 @@ expression (A.A ann sourceExpression) =
254 do expr' <- expression expr
254 do expr' <- expression expr
255 return (Task name expr' tipe)
255 return (Task name expr' tipe)
256
256
257− Crash details ->
258− return (Crash details)
259−
260
257
261second :: (a, Source.Expr) -> Result.Result wrn Error.Error (a, Valid.Expr)
258second :: (a, Source.Expr) -> Result.Result wrn Error.Error (a, Valid.Expr)
262second (value, expr) =
259second (value, expr) =