on master help sign in
changed let and const to var
0e01ff0Rui Barreiro
src/IRTS/JavaScript/AST.hs+2−4
@@ -138,14 +138,12 @@ jsAst2Text (JsVar x) = x
138jsAst2Text (JsSeq JsEmpty y) = jsAst2Text y
138jsAst2Text (JsSeq JsEmpty y) = jsAst2Text y
139jsAst2Text (JsSeq x JsEmpty) = jsAst2Text x
139jsAst2Text (JsSeq x JsEmpty) = jsAst2Text x
140jsAst2Text (JsSeq x y) = T.concat [jsAst2Text x, ";\n", jsAst2Text y]
140jsAst2Text (JsSeq x y) = T.concat [jsAst2Text x, ";\n", jsAst2Text y]
141−jsAst2Text (JsConst name exp) = T.concat [ "const ", name, " = ", jsAst2Text exp]
141+jsAst2Text (JsConst name exp) = T.concat [ "var ", name, " = ", jsAst2Text exp] -- using var instead of const until ES6
142−jsAst2Text (JsLet name exp) = T.concat [ "let ", name, " = ", jsAst2Text exp]
142+jsAst2Text (JsLet name exp) = T.concat [ "var ", name, " = ", jsAst2Text exp] -- using var instead of const until ES6
143−--jsAst2Text (JsLetList lst) = T.concat [ "let ", T.intercalate ", " (map (\(n,v) -> T.concat [n, " = ", jsAst2Text v] ) lst) ]
144jsAst2Text (JsSetVar name exp) = T.concat [ name, " = ", jsAst2Text exp]
143jsAst2Text (JsSetVar name exp) = T.concat [ name, " = ", jsAst2Text exp]
145jsAst2Text (JsArrayProj i exp) = T.concat [ jsAst2Text exp, "[", jsAst2Text i, "]"]
144jsAst2Text (JsArrayProj i exp) = T.concat [ jsAst2Text exp, "[", jsAst2Text i, "]"]
146jsAst2Text (JsInt i) = T.pack $ show i ++ "|0"
145jsAst2Text (JsInt i) = T.pack $ show i ++ "|0"
147jsAst2Text (JsNum d) = T.pack $ show d
146jsAst2Text (JsNum d) = T.pack $ show d
148−--jsAst2Text (JsInteger i) = T.pack $ show i
149jsAst2Text (JsStr s) = "\"" `T.append` T.pack (concatMap translateChar s) `T.append` "\""
147jsAst2Text (JsStr s) = "\"" `T.append` T.pack (concatMap translateChar s) `T.append` "\""
150jsAst2Text (JsArray l) = T.concat [ "[", T.intercalate ", " (map jsAst2Text l), "]"]
148jsAst2Text (JsArray l) = T.concat [ "[", T.intercalate ", " (map jsAst2Text l), "]"]
151jsAst2Text (JsSwitchCase exp l d) =
149jsAst2Text (JsSwitchCase exp l d) =