on master help sign in
javascript: remove doubled semicolons
6cb9626raichoo
src/IRTS/CodegenJavaScript.hs+5−1
@@ -241,6 +241,10 @@ compileJS' indent (JSIndex lhs rhs) =
241compileJS' indent (JSCond branches) =
241compileJS' indent (JSCond branches) =
242 intercalate " else " $ map createIfBlock branches
242 intercalate " else " $ map createIfBlock branches
243 where
243 where
244+ createIfBlock (JSNoop, e@(JSSeq _)) =
245+ "{\n"
246+ ++ compileJS' (indent + 2) e
247+ ++ "\n" ++ replicate indent ' ' ++ "}"
244 createIfBlock (JSNoop, e) =
248 createIfBlock (JSNoop, e) =
245 "{\n"
249 "{\n"
246 ++ compileJS' (indent + 2) e
250 ++ compileJS' (indent + 2) e
@@ -248,7 +252,7 @@ compileJS' indent (JSCond branches) =
248 createIfBlock (cond, e@(JSSeq _)) =
252 createIfBlock (cond, e@(JSSeq _)) =
249 "if (" ++ compileJS' indent cond ++") {\n"
253 "if (" ++ compileJS' indent cond ++") {\n"
250 ++ compileJS' (indent + 2) e
254 ++ compileJS' (indent + 2) e
251− ++ ";\n" ++ replicate indent ' ' ++ "}"
255+ ++ "\n" ++ replicate indent ' ' ++ "}"
252 createIfBlock (cond, e) =
256 createIfBlock (cond, e) =
253 "if (" ++ compileJS' indent cond ++") {\n"
257 "if (" ++ compileJS' indent cond ++") {\n"
254 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e
258 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e