on master help sign in
Cosmetic changes
commitbef646a3f189537ce9b2ac3dba639331eca9b8a3 authorevancz <info@elm-lang.org> dateSun 7 Apr 2013, 06:46 (14 years ago) parent1d04b34
2 files changed+8−7
compiler/Gen/CompileToJS.hs+3−3 compiler/Parse/Patterns.hs+5−4
compiler/Gen/CompileToJS.hs+3−3
@@ -202,12 +202,12 @@ makeRecord kvs = record `liftM` collect kvs
202202instance ToJS Expr where
203203 toJS expr =
204204 case expr of
205− IntNum n -> return $ show n
206− FloatNum n -> return $ show n
207205 Var x -> return $ x
208206 Chr c -> return $ quoted [c]
209207 Str s -> return $ "_str" ++ parens (quoted s)
210− Boolean b -> return $ if b then "true" else "false"
208+ IntNum n -> return $ show n
209+ FloatNum n -> return $ show n
210+ Boolean b -> return $ if b then "true" else "false"
211211 Range lo hi -> jsRange `liftM` toJS' lo `ap` toJS' hi
212212 Access e x -> access x `liftM` toJS' e
213213 Remove e x -> remove x `liftM` toJS' e
compiler/Parse/Patterns.hs+5−4
@@ -88,10 +88,11 @@ matchSingle :: Pattern -> CExpr -> Pattern -> GuidCounter [Def]
8888matchSingle pat exp@(C t s _) p =
8989 let ctx = C t s in
9090 case p of
91− PData _ ps -> do x <- guid
92− let v = '_' : show x
93− dss <- mapM (matchSingle pat . ctx $ Var v) ps
94− return (FnDef v [] exp : concat dss)
91+ PData _ ps -> do
92+ x <- guid
93+ let v = '_' : show x
94+ dss <- mapM (matchSingle pat . ctx $ Var v) ps
95+ return (FnDef v [] exp : concat dss)
9596
9697 PVar x ->
9798 return [ FnDef x [] (ctx $ Case exp [(pat, ctx $ Var x)]) ]