summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar fab <fabrice.leal.ch@gmail.com>2018-11-19 20:33:20 +0000
committerGravatar fab <fabrice.leal.ch@gmail.com>2018-11-19 20:33:20 +0000
commitf6d40570a8859260571f0b904ba329a1c4d1046c (patch)
treed04bfed92db59c1adc4d921569eef28783f46b6f /lib
parent6ad2fd84552652fe7197a90b8a17311eedafae1b (diff)
several fixes on unit tests and implementation
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index f81f05e3..de1a2ad0 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -27,8 +27,8 @@ function le(x, y) { return x <= y; }
// Characters
-function isLower(c) { return c >= 'a' && c <= 'z'; }
-function isUpper(c) { return c >= 'A' && c <= 'Z'; }
+function isLower(c) { return c.toLowerCase() == c && c != c.toUpperCase(); }
+function isUpper(c) { return c.toUpperCase() == c && c != c.toLowerCase(); }
function isAlpha(c) { return isLower(c) || isUpper(c); }
function isDigit(c) { return c >= '0' && c <= '9'; }
function isAlnum(c) { return isAlpha(c) || isDigit(c); }
@@ -36,7 +36,7 @@ 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 isPrint(c) { return ord(c) > 31 && ord(c) != 127; }
function toLower(c) { return c.toLowerCase(); }
function toUpper(c) { return c.toUpperCase(); }