on master help sign in
Merge pull request #2313 from raichoo/io

Fix IO for future node versions

commit423e21e0df6946bdbae73c278faef681d728d1bb authorraichoo <raichoo@googlemail.com> dateFri 22 May 2015, 22:49 (11 years ago) parent133b0ae0a49f66
2 files changed+7−7
jsrts/Runtime-node.js+2−2 src/IRTS/CodegenJavaScript.hs+5−5
jsrts/Runtime-node.js+2−2
@@ -1,7 +1,7 @@
11var i$putStr = (function() {
2− var util = require('util');
2+ var fs = require('fs');
33 return function(s) {
4− util.print(s);
4+ fs.write(1,s);
55 };
66})();
77
src/IRTS/CodegenJavaScript.hs+5−5
@@ -1329,7 +1329,7 @@ translateBC info bc
13291329 | NULL r <- bc = jsNULL info r
13301330 | CALL n <- bc = jsCALL info n
13311331 | TAILCALL n <- bc = jsTAILCALL info n
1332− | FOREIGNCALL r _ (FStr n) args
1332+ | FOREIGNCALL r _ (FStr n) args
13331333 <- bc = jsFOREIGN info r n (map fcall args)
13341334 | TOPBASE n <- bc = jsTOPBASE info n
13351335 | BASETOP n <- bc = jsBASETOP info n
@@ -1346,7 +1346,7 @@ translateBC info bc
13461346 | otherwise = JSRaw $ "//" ++ show bc
13471347 where fcall (t, arg) = (toFType t, arg)
13481348
1349−toAType (FCon i)
1349+toAType (FCon i)
13501350 | i == sUN "JS_IntChar" = ATInt ITChar
13511351 | i == sUN "JS_IntNative" = ATInt ITNative
13521352toAType t = error (show t ++ " not defined in toAType")
@@ -1359,14 +1359,14 @@ toFnType (FApp c [_,r])
13591359 | c == sUN "JS_FnBase" = FFunction
13601360toFnType t = error (show t ++ " not defined in toFnType")
13611361
1362−toFType (FCon c)
1362+toFType (FCon c)
13631363 | c == sUN "JS_Str" = FString
13641364 | c == sUN "JS_Float" = FArith ATFloat
13651365 | c == sUN "JS_Ptr" = FPtr
13661366 | c == sUN "JS_Unit" = FUnit
1367−toFType (FApp c [_,ity])
1367+toFType (FApp c [_,ity])
13681368 | c == sUN "JS_IntT" = FArith (toAType ity)
1369−toFType (FApp c [_,fty])
1369+toFType (FApp c [_,fty])
13701370 | c == sUN "JS_FnT" = toFnType fty
13711371toFType t = error (show t ++ " not yet defined in toFType")
13721372