on master help sign in
javascript: remove jsobject
commitb173d5819e0f48122f29689972d6ca4cab543015 authorraichoo <raichoo@googlemail.com> dateThu 30 Jan 2014, 19:59 (13 years ago) parent0e17c90
1 file changed−10
src/IRTS/CodegenJavaScript.hs−10
src/IRTS/CodegenJavaScript.hs−10
@@ -62,7 +62,6 @@ data JS = JSRaw String
6262 | JSTrue
6363 | JSFalse
6464 | JSArray [JS]
65− | JSObject [(String, JS)]
6665 | JSString String
6766 | JSChar String
6867 | JSNum JSNum
@@ -145,12 +144,6 @@ compileJS JSFalse =
145144compileJS (JSArray elems) =
146145 "[" ++ intercalate "," (map compileJS elems) ++ "]"
147146
148−compileJS (JSObject fields) =
149− "{" ++ intercalate ",\n" (map compileField fields) ++ "}"
150− where
151− compileField :: (String, JS) -> String
152− compileField (name, val) = '\'' : name ++ "' : " ++ compileJS val
153−
154147compileJS (JSString str) =
155148 show str
156149
@@ -480,9 +473,6 @@ inlineJS (JSAlloc name (Just js)) =
480473inlineJS (JSCond cases) =
481474 JSCond $ map (inlineJS *** inlineJS) cases
482475
483−inlineJS (JSObject fields) =
484− JSObject (map (second inlineJS) fields)
485−
486476inlineJS (JSOp op lhs rhs) =
487477 JSOp op (inlineJS lhs) (inlineJS rhs)
488478