Skip to content
This repository
Browse code

Fixes needed to get Fay example working.

  • Loading branch information...
commit b02c4cddcf82e291696cfc9fbfe746e53d1b795c 1 parent 108dd75
Hamish Mackenzie authored July 25, 2012

Showing 1 changed file with 35 additions and 3 deletions. Show diff stats Hide diff stats

  1. 38  rts/rts-common.js
38  rts/rts-common.js
... ...
@@ -1,6 +1,9 @@
1 1
 var $hs_mkBool = function(b) {
2 2
     return b ? $$GHCziTypes_True:$$GHCziTypes_False;
3 3
 };
  4
+var $hs_tagToEnumzh = function(t) {
  5
+    return $d(t+1, []);
  6
+};
4 7
 var $hs_mulIntMayOflozh = function(a, b) {
5 8
     if(WORD_SIZE_IN_BITS==32) {
6 9
         var x = a * b;
@@ -241,6 +244,9 @@ var __int_encodeDouble = function(b, e) {
241 244
 var rintDouble = function(a) {
242 245
     return Math.round(a);
243 246
 };
  247
+var rintFloat = function(a) {
  248
+    return Math.round(a);
  249
+};
244 250
 var $hs_newMutVarzh = function(a, s) {
245 251
     return [s, {value : a}];
246 252
 };
@@ -1565,6 +1571,29 @@ var memcmp = function(a, b, count) {
1565 1571
         return 0;
1566 1572
     }
1567 1573
 };
  1574
+
  1575
+var $hs_unicodeCat = null;
  1576
+
  1577
+var u_gencat = function(a) {
  1578
+    if($hs_unicodeCat == null) {
  1579
+        $hs_unicodeCat = [];
  1580
+        // concatMap (\run ->
  1581
+        //    case run of
  1582
+        //        [a]   -> [chr (a+64)]
  1583
+        //        (a:_) -> show (length run) ++ [chr (a+64)]) . group $ map (fromEnum . generalCategory) ['\x00'..'\xFFFF']
  1584
+        var s = "32YV3QS3QMNQRQL2Q10H2Q3R2Q26@MQNTKT26AMRNR33YVQ4S2UTUAORZUTUR2JTAUQTJAP3JQ23@R7@24AR8A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@2A@A@A@A@A@A@A@A@2A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A2@A@A@3A2@A@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10I2E6Q8]23T9C2T@A@A@A@A@A@A@3A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@AC8A@A@A2@A@A@A@A@AC2T@A@A]@A14]@A@A@A@A@A80]A7DE3DE4DE23D2F2EF4U4]6J2USU6]52D4Q8]2F50D16FE9]2Q10H6]18E6D3QD4]10H28D8E2Q23D11E2F11]Q29D3]3EF47DE2F4E2FE4F13Q]C10H4]2Q32]41D6E2F2E2F2E9]3DE8DEF2]10H2]4Q16DC6D3UDF4]48DED3E2D2E5D2EDED24]2DC2Q33]6D2]6D2]6D9]7D]7D145]35D2FE2FE2FQFE2]10H6]11172D12]23D4]49D4]2048[6400\\302D2]62D2]106D38]7A12]5A5]DE10DR13D]5D]D]2D]2D]108D16T17]363DMN16]64D2]54D40]12DSU2]16E7QMNQ6]7E9]Q2L2KMNMNMNMNMNMNMNMN2QMN4Q3K3Q]4QLMNMNMN3QRL3R]QS2Q4]5D]135D2]Z]3QS3QMNQRQL2Q10H2Q3R2Q26@MQNTKT26AMRNRMNQMN2Q10DC45D2C31D3]6D2]6D2]6D2]3D3]2SRTU2S]U4R2U10]3Z2U2]";
  1585
+        for(var n = 0; n != s.length; n++) {
  1586
+            var l = '';
  1587
+            while(goog.string.isNumeric(s[n]))
  1588
+                l = l + s[n++];
  1589
+            l = (l === '') ? 1 : (l | 0);
  1590
+            var c = s[n].charCodeAt() - 64;
  1591
+            for(var x = 0; x !== l; x++)
  1592
+                $hs_unicodeCat[$hs_unicodeCat.length] = c;
  1593
+        }
  1594
+    }
  1595
+    return $hs_unicodeCat[a];
  1596
+};
1568 1597
 var u_iswalpha = function(a) {
1569 1598
     return goog.string.isAlpha(String.fromCharCode(a)) ?
1570 1599
         (WORD_SIZE_IN_BITS == 32 ? 1 : goog.math.Long.ONE)
@@ -1576,17 +1605,18 @@ var u_iswalnum = function(a) {
1576 1605
        :(WORD_SIZE_IN_BITS == 32 ? 0 : goog.math.Long.ZERO);
1577 1606
 };
1578 1607
 var u_iswspace = function(a) {
1579  
-    return goog.string.isSpace(String.fromCharCode(a)) ?
  1608
+    return '\t\n\v\f\r \u0020\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
  1609
+        .indexOf(String.fromCharCode(a)) != -1 ?
1580 1610
         (WORD_SIZE_IN_BITS == 32 ? 1 : goog.math.Long.ONE)
1581 1611
        :(WORD_SIZE_IN_BITS == 32 ? 0 : goog.math.Long.ZERO);
1582 1612
 };
1583 1613
 var u_iswlower = function(a) {
1584  
-    return a === u_towupper(a) ?
  1614
+    return a !== u_towupper(a) ?
1585 1615
         (WORD_SIZE_IN_BITS == 32 ? 1 : goog.math.Long.ONE)
1586 1616
        :(WORD_SIZE_IN_BITS == 32 ? 0 : goog.math.Long.ZERO);
1587 1617
 };
1588 1618
 var u_iswupper = function(a) {
1589  
-    return a === u_towlower(a) ?
  1619
+    return a !== u_towlower(a) ?
1590 1620
         (WORD_SIZE_IN_BITS == 32 ? 1 : goog.math.Long.ONE)
1591 1621
        :(WORD_SIZE_IN_BITS == 32 ? 0 : goog.math.Long.ZERO);
1592 1622
 };
@@ -2236,6 +2266,8 @@ var hs_cons = function(x, xs) {
2236 2266
 var $$GHCziPrim_realWorldzh = 0;
2237 2267
 var $$GHCziPrim_coercionTokenzh = 0;
2238 2268
 var $hs_init = function() {
  2269
+    $$GHCziTypes_False = $d(1, []);
  2270
+    $$GHCziTypes_True = $d(2, []);
2239 2271
 };
2240 2272
 var MD5Init = function(ctx) {
2241 2273
     ctx.googCtx = new goog.crypt.Md5();

0 notes on commit b02c4cd

Please sign in to comment.
Something went wrong with that request. Please try again.