comparison lib/js/urweb.js @ 1979:81bc76aa4acd

Merge in upstream changes.
author Patrick Hurst <phurst@mit.edu>
date Sat, 18 Jan 2014 18:26:24 -0500
parents a671e5258a2c
children 334b5cbff198 b2254554542f
comparison
equal deleted inserted replaced
1978:c5143edaf3c7 1979:81bc76aa4acd
33 function isDigit(c) { return c >= '0' && c <= '9'; } 33 function isDigit(c) { return c >= '0' && c <= '9'; }
34 function isAlnum(c) { return isAlpha(c) || isDigit(c); } 34 function isAlnum(c) { return isAlpha(c) || isDigit(c); }
35 function isBlank(c) { return c == ' ' || c == '\t'; } 35 function isBlank(c) { return c == ' ' || c == '\t'; }
36 function isSpace(c) { return isBlank(c) || c == '\r' || c == '\n'; } 36 function isSpace(c) { return isBlank(c) || c == '\r' || c == '\n'; }
37 function isXdigit(c) { return isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); } 37 function isXdigit(c) { return isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); }
38 function ord(c) { return c.charCodeAt(0); }
39 function isPrint(c) { return ord(c) > 31 && ord(c) < 127; }
38 function toLower(c) { return c.toLowerCase(); } 40 function toLower(c) { return c.toLowerCase(); }
39 function toUpper(c) { return c.toUpperCase(); } 41 function toUpper(c) { return c.toUpperCase(); }
40
41 42
42 // Lists 43 // Lists
43 44
44 function cons(v, ls) { 45 function cons(v, ls) {
45 return { next : ls, data : v }; 46 return { next : ls, data : v };
1572 function rv(chn, parse, k) { 1573 function rv(chn, parse, k) {
1573 if (!maySuspend) 1574 if (!maySuspend)
1574 er("May not 'recv' in main thread of 'code' for <active>"); 1575 er("May not 'recv' in main thread of 'code' for <active>");
1575 1576
1576 if (chn == null) 1577 if (chn == null)
1577 return; 1578 er("Client-side code tried to recv() from a channel belonging to a different page view.");
1578 1579
1579 if (chn < 0) 1580 if (chn < 0)
1580 whine("Out-of-bounds channel receive"); 1581 whine("Out-of-bounds channel receive");
1581 1582
1582 var ch; 1583 var ch;