on master help sign in
javascript: remove jsobject
b173d58raichoo
src/IRTS/CodegenJavaScript.hs−10
@@ -62,7 +62,6 @@ data JS = JSRaw String
62 | JSTrue
62 | JSTrue
63 | JSFalse
63 | JSFalse
64 | JSArray [JS]
64 | JSArray [JS]
65− | JSObject [(String, JS)]
66 | JSString String
65 | JSString String
67 | JSChar String
66 | JSChar String
68 | JSNum JSNum
67 | JSNum JSNum
@@ -145,12 +144,6 @@ compileJS JSFalse =
145compileJS (JSArray elems) =
144compileJS (JSArray elems) =
146 "[" ++ intercalate "," (map compileJS elems) ++ "]"
145 "[" ++ intercalate "," (map compileJS elems) ++ "]"
147
146
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−
154compileJS (JSString str) =
147compileJS (JSString str) =
155 show str
148 show str
156
149
@@ -480,9 +473,6 @@ inlineJS (JSAlloc name (Just js)) =
480inlineJS (JSCond cases) =
473inlineJS (JSCond cases) =
481 JSCond $ map (inlineJS *** inlineJS) cases
474 JSCond $ map (inlineJS *** inlineJS) cases
482
475
483−inlineJS (JSObject fields) =
484− JSObject (map (second inlineJS) fields)
485−
486inlineJS (JSOp op lhs rhs) =
476inlineJS (JSOp op lhs rhs) =
487 JSOp op (inlineJS lhs) (inlineJS rhs)
477 JSOp op (inlineJS lhs) (inlineJS rhs)
488
478