on master help sign in
javascript: fix indentation error
c82427braichoo
src/IRTS/CodegenJavaScript.hs+4−2
@@ -318,8 +318,10 @@ compileJS' indent (JSCond branches) =
318 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e
318 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e
319 ++ ";\n" ++ replicate indent ' ' ++ "}"
319 ++ ";\n" ++ replicate indent ' ' ++ "}"
320
320
321−compileJS' indent (JSSwitch val [(_,seq)] Nothing) =
321+compileJS' indent (JSSwitch val [(_,JSSeq seq)] Nothing) =
322+ let (h,t) = splitAt 1 seq in
322− compileJS' indent seq
323+ (concatMap (compileJS' indent) h ++ ";\n")
324+ ++ (intercalate ";\n" $ map ((replicate indent ' ' ++) . compileJS' indent) t)
323
325
324compileJS' indent (JSSwitch val branches def) =
326compileJS' indent (JSSwitch val branches def) =
325 "switch(" ++ compileJS' indent val ++ "){\n"
327 "switch(" ++ compileJS' indent val ++ "){\n"