javascript: compile single branch switch to seq
commit4d3fdf45878839dcc2d4cfd536d3ae1e3efc723d
authorraichoo <raichoo@googlemail.com>
dateTue 24 Jun 2014, 16:49 (12 years ago)
parenta10f705
src/IRTS/CodegenJavaScript.hs+3
@@ -294,6 +294,9 @@ compileJS' indent (JSCond branches) =
294294 ++ replicate (indent + 2) ' ' ++ compileJS' (indent + 2) e
295295 ++ ";\n" ++ replicate indent ' ' ++ "}"
296296
297+compileJS' indent (JSSwitch val [(_,seq)] Nothing) =
298+ compileJS' indent seq
299+
297300compileJS' indent (JSSwitch val branches def) =
298301 "switch(" ++ compileJS' indent val ++ "){\n"
299302 ++ concatMap mkBranch branches