From fac643c4f0860bfd9c0af35f95d41344bb5d9a76 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Sat, 22 Dec 2012 05:55:40 +0000 Subject: [PATCH] Accept tabs as whitespaces --- lispstrack.lisp | 3 ++- test.lisp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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)))))) (#\+ -- 1.7.10.4