aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2013-12-09 17:23:25 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2013-12-09 17:23:25 -0500
commit31ab9f8c18c9e071392090960a8041febf7a2807 (patch)
tree61e6fe93ed1154836f155e7e8420936b347a4a12 /lib/js
parentc6e641ffb3195827acbb2787bb202824fef0cfa6 (diff)
Add JavaScript mappings for isprint and ord
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 59708150..e211d318 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -35,10 +35,11 @@ function isAlnum(c) { return isAlpha(c) || isDigit(c); }
function isBlank(c) { return c == ' ' || c == '\t'; }
function isSpace(c) { return isBlank(c) || c == '\r' || c == '\n'; }
function isXdigit(c) { return isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); }
+function ord(c) { return c.charCodeAt(0); }
+function isPrint(c) { return ord(c) > 31 && ord(c) < 127; }
function toLower(c) { return c.toLowerCase(); }
function toUpper(c) { return c.toUpperCase(); }
-
// Lists
function cons(v, ls) {