on master help sign in
javascript: fix ptr handling
commitdd3517539c4b7cfe435b345d3e9133eadd976baa authorraichoo <raichoo@googlemail.com> dateFri 26 Apr 2013, 17:28 (14 years ago) parentd52534c
2 files changed+4−1
js/Runtime-common.js+2 src/IRTS/CodegenJavaScript.hs+2−1
js/Runtime-common.js+2
@@ -10,8 +10,10 @@ __IDRRT__.Char = new __IDRRT__.Type('Char');
1010__IDRRT__.String = new __IDRRT__.Type('String');
1111__IDRRT__.Integer = new __IDRRT__.Type('Integer');
1212__IDRRT__.Float = new __IDRRT__.Type('Float');
13+__IDRRT__.Ptr = new __IDRRT__.Type('Pointer')
1314__IDRRT__.Forgot = new __IDRRT__.Type('Forgot');
1415
16+
1517/** @constructor */
1618__IDRRT__.Tailcall = function(f) { this.f = f };
1719
src/IRTS/CodegenJavaScript.hs+2−1
@@ -139,6 +139,7 @@ translateConstant ChType = "__IDRRT__.Char"
139139translateConstant StrType = "__IDRRT__.String"
140140translateConstant BIType = "__IDRRT__.Integer"
141141translateConstant FlType = "__IDRRT__.Float"
142+translateConstant PtrType = "__IDRRT__.Ptr"
142143translateConstant Forgot = "__IDRRT__.Forgot"
143144translateConstant c =
144145 "(function(){throw 'Unimplemented Const: " ++ show c ++ "';})()"
@@ -450,7 +451,7 @@ translateCase var (SConstCase ty e)
450451 | IType <- ty = matchHelper "Int"
451452 | BIType <- ty = matchHelper "Integer"
452453 | FlType <- ty = matchHelper "Float"
453− | PtrType <- ty = matchHelper "Pointer"
454+ | PtrType <- ty = matchHelper "Ptr"
454455 | Forgot <- ty = matchHelper "Forgot"
455456 where
456457 matchHelper tyName = translateTypeMatch var tyName e