From: David Vazquez Date: Sat, 22 Dec 2012 05:55:40 +0000 (+0000) Subject: Accept tabs as whitespaces X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=fac643c4f0860bfd9c0af35f95d41344bb5d9a76;p=jscl.git Accept tabs as whitespaces --- diff --git a/lispstrack.lisp b/lispstrack.lisp index 9c3db2b..0516837 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -85,7 +85,7 @@ (setcdr stream (1+ (cdr stream)))))) (defun whitespacep (ch) - (or (char= ch #\space) (char= ch #\newline))) + (or (char= ch #\space) (char= ch #\newline) (char= ch #\tab))) (defun skip-whitespaces (stream) (let (ch) @@ -178,6 +178,7 @@ (read-until stream #'terminalp)))) (cond ((string= cname "space") (char-code #\space)) + ((string= cname "tab") (char-code #\tab)) ((string= cname "newline") (char-code #\newline)) (t (char-code (char cname 0)))))) (#\+ diff --git a/test.lisp b/test.lisp index bfbabe2..8efbcbe 100644 --- a/test.lisp +++ b/test.lisp @@ -328,7 +328,7 @@ (setcdr stream (1+ (cdr stream)))))) (defun whitespacep (ch) - (or (char= ch #\space) (char= ch #\newline))) + (or (char= ch #\space) (char= ch #\newline) (char= ch #\tab))) (defun skip-whitespaces (stream) (let (ch) @@ -421,6 +421,7 @@ (read-until stream #'terminalp)))) (cond ((string= cname "space") (char-code #\space)) + ((string= cname "tab") (char-code #\tab)) ((string= cname "newline") (char-code #\newline)) (t (char-code (char cname 0)))))) (#\+