on master help sign in
javascript: fix ptr handling
dd35175raichoo
js/Runtime-common.js+2
@@ -10,8 +10,10 @@ __IDRRT__.Char = new __IDRRT__.Type('Char');
10__IDRRT__.String = new __IDRRT__.Type('String');
10__IDRRT__.String = new __IDRRT__.Type('String');
11__IDRRT__.Integer = new __IDRRT__.Type('Integer');
11__IDRRT__.Integer = new __IDRRT__.Type('Integer');
12__IDRRT__.Float = new __IDRRT__.Type('Float');
12__IDRRT__.Float = new __IDRRT__.Type('Float');
13+__IDRRT__.Ptr = new __IDRRT__.Type('Pointer')
13__IDRRT__.Forgot = new __IDRRT__.Type('Forgot');
14__IDRRT__.Forgot = new __IDRRT__.Type('Forgot');
14
15
16+
15/** @constructor */
17/** @constructor */
16__IDRRT__.Tailcall = function(f) { this.f = f };
18__IDRRT__.Tailcall = function(f) { this.f = f };
17
19
src/IRTS/CodegenJavaScript.hs+2−1
@@ -139,6 +139,7 @@ translateConstant ChType = "__IDRRT__.Char"
139translateConstant StrType = "__IDRRT__.String"
139translateConstant StrType = "__IDRRT__.String"
140translateConstant BIType = "__IDRRT__.Integer"
140translateConstant BIType = "__IDRRT__.Integer"
141translateConstant FlType = "__IDRRT__.Float"
141translateConstant FlType = "__IDRRT__.Float"
142+translateConstant PtrType = "__IDRRT__.Ptr"
142translateConstant Forgot = "__IDRRT__.Forgot"
143translateConstant Forgot = "__IDRRT__.Forgot"
143translateConstant c =
144translateConstant c =
144 "(function(){throw 'Unimplemented Const: " ++ show c ++ "';})()"
145 "(function(){throw 'Unimplemented Const: " ++ show c ++ "';})()"
@@ -450,7 +451,7 @@ translateCase var (SConstCase ty e)
450 | IType <- ty = matchHelper "Int"
451 | IType <- ty = matchHelper "Int"
451 | BIType <- ty = matchHelper "Integer"
452 | BIType <- ty = matchHelper "Integer"
452 | FlType <- ty = matchHelper "Float"
453 | FlType <- ty = matchHelper "Float"
453− | PtrType <- ty = matchHelper "Pointer"
454+ | PtrType <- ty = matchHelper "Ptr"
454 | Forgot <- ty = matchHelper "Forgot"
455 | Forgot <- ty = matchHelper "Forgot"
455 where
456 where
456 matchHelper tyName = translateTypeMatch var tyName e
457 matchHelper tyName = translateTypeMatch var tyName e