on master help sign in
javascript: fix indentation error
commitc82427be694841ed9999ec5cd2215675559f89e6 authorraichoo <raichoo@googlemail.com> dateSat 28 Jun 2014, 01:48 (12 years ago) parent81e8dfc
1 file changed+4−2
src/IRTS/CodegenJavaScript.hs+4−2
src/IRTS/CodegenJavaScript.hs+4−2
@@ -318,8 +318,10 @@ compileJS' indent (JSCond branches) =
318318 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e
319319 ++ ";\n" ++ replicate indent ' ' ++ "}"
320320
321−compileJS' indent (JSSwitch val [(_,seq)] Nothing) =
322− compileJS' indent seq
321+compileJS' indent (JSSwitch val [(_,JSSeq seq)] Nothing) =
322+ let (h,t) = splitAt 1 seq in
323+ (concatMap (compileJS' indent) h ++ ";\n")
324+ ++ (intercalate ";\n" $ map ((replicate indent ' ' ++) . compileJS' indent) t)
323325
324326compileJS' indent (JSSwitch val branches def) =
325327 "switch(" ++ compileJS' indent val ++ "){\n"