From f6d40570a8859260571f0b904ba329a1c4d1046c Mon Sep 17 00:00:00 2001 From: fab Date: Mon, 19 Nov 2018 20:33:20 +0000 Subject: several fixes on unit tests and implementation --- lib/js/urweb.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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(); } -- cgit v1.2.3