From baa2d50e5a11158ac998dfc0f3c8d5293666f77a Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 6 May 2012 22:02:12 +0000 Subject: * interp/lexing.boot (indentationLocation): New. * interp/macros.lisp (expand-tabs): Use it in lieu of NDENT-POS. * interp/preparse.lisp (PREPARSE1): Likewise. --- src/interp/macros.lisp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'src/interp/macros.lisp') diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp index 227533d5..c11951cb 100644 --- a/src/interp/macros.lisp +++ b/src/interp/macros.lisp @@ -475,29 +475,10 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (terpri stream) (finish-output stream))) -;; moved here from preparse.lisp - -(defun NEXT-TAB-LOC (i) (* (1+ (truncate i 8)) 8)) - -(defun INDENT-POS (STR) - (do ((i 0 (1+ i)) - (pos 0)) - ((>= i (length str)) nil) - (case (char str i) - (#\space (incf pos)) - (#\tab (setq pos (next-tab-loc pos))) - (otherwise (return pos))))) - -;;(defun expand-tabs (str) -;; (let ((bpos (nonblankloc str)) -;; (tpos (indent-pos str))) -;; (if (eql bpos tpos) str -;; (concatenate 'string (make-string tpos :initial-element #\space) -;; (subseq str bpos))))) (defun expand-tabs (str) (if (and (stringp str) (> (length str) 0)) (let ((bpos (nonblankloc str)) - (tpos (indent-pos str))) + (tpos (|indentationLocation| str))) (setq str (if (eql bpos tpos) str -- cgit v1.2.3