on master help sign in
javascript: remove doubled semicolons
commit6cb96261d33caedf000b0d7ad50ced36cb3bed57 authorraichoo <raichoo@googlemail.com> dateMon 23 Jun 2014, 16:01 (12 years ago) parentc6cf819
1 file changed+5−1
src/IRTS/CodegenJavaScript.hs+5−1
src/IRTS/CodegenJavaScript.hs+5−1
@@ -241,6 +241,10 @@ compileJS' indent (JSIndex lhs rhs) =
241241compileJS' indent (JSCond branches) =
242242 intercalate " else " $ map createIfBlock branches
243243 where
244+ createIfBlock (JSNoop, e@(JSSeq _)) =
245+ "{\n"
246+ ++ compileJS' (indent + 2) e
247+ ++ "\n" ++ replicate indent ' ' ++ "}"
244248 createIfBlock (JSNoop, e) =
245249 "{\n"
246250 ++ compileJS' (indent + 2) e
@@ -248,7 +252,7 @@ compileJS' indent (JSCond branches) =
248252 createIfBlock (cond, e@(JSSeq _)) =
249253 "if (" ++ compileJS' indent cond ++") {\n"
250254 ++ compileJS' (indent + 2) e
251− ++ ";\n" ++ replicate indent ' ' ++ "}"
255+ ++ "\n" ++ replicate indent ' ' ++ "}"
252256 createIfBlock (cond, e) =
253257 "if (" ++ compileJS' indent cond ++") {\n"
254258 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e