on master help sign in
cosmetic: match indentation of other cases
commit9ff299c51c862f886e87967c4bc6701664aa9604 authorEvan Czaplicki <info@elm-lang.org> dateThu 28 Aug 2014, 00:27 (12 years ago) parentfb3dd80
1 file changed+10−10
compiler/Generate/JavaScript.hs+10−10
compiler/Generate/JavaScript.hs+10−10
@@ -147,16 +147,16 @@ expression (A region expr) =
147147 return $ function [] (stmts ++ [ ret exp ]) `call` []
148148
149149 MultiIf branches ->
150− do branches' <- forM branches $ \(b,e) -> (,) <$> expression b <*> expression e
151− return $ case last branches of
152− (A _ (Var (Var.Canonical (Var.Module "Basics") "otherwise")), _) ->
153− safeIfs branches'
154− (A _ (Literal (Boolean True)), _) -> safeIfs branches'
155− _ -> ifs branches' (throw "If" region)
156− where
157− safeIfs branches = ifs (init branches) (snd (last branches))
158− ifs branches finally = foldr iff finally branches
159− iff (if', then') else' = CondExpr () if' then' else'
150+ do branches' <- forM branches $ \(b,e) -> (,) <$> expression b <*> expression e
151+ return $ case last branches of
152+ (A _ (Var (Var.Canonical (Var.Module "Basics") "otherwise")), _) ->
153+ safeIfs branches'
154+ (A _ (Literal (Boolean True)), _) -> safeIfs branches'
155+ _ -> ifs branches' (throw "If" region)
156+ where
157+ safeIfs branches = ifs (init branches) (snd (last branches))
158+ ifs branches finally = foldr iff finally branches
159+ iff (if', then') else' = CondExpr () if' then' else'
160160
161161 Case e cases ->
162162 do (tempVar,initialMatch) <- Case.toMatch cases