[climacs-cvs] CVS update: climacs/cl-syntax.lisp

Robert Strandh rstrandh at common-lisp.net
Wed Mar 2 03:59:09 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv3501

Modified Files:
	cl-syntax.lisp 
Log Message:
Whitespace is no longer considered a syntax element, and is skipped
over instead.  This makes the incremental lexer even faster.


Date: Wed Mar  2 04:59:07 2005
Author: rstrandh

Index: climacs/cl-syntax.lisp
diff -u climacs/cl-syntax.lisp:1.4 climacs/cl-syntax.lisp:1.5
--- climacs/cl-syntax.lisp:1.4	Sun Feb 27 07:23:28 2005
+++ climacs/cl-syntax.lisp	Wed Mar  2 04:59:03 2005
@@ -48,9 +48,6 @@
   ()
   (:documentation "dummy entry before all the others."))
 
-(defclass whitespace-entry (terminal-entry)
-  ())
-
 (defclass token-entry (terminal-entry)
   ()
   (:documentation "the syntactic class of tokens."))
@@ -233,12 +230,7 @@
 						do (fo))
 					  (make-entry 'character-entry))))
 			      (t (make-entry 'error-entry)))))
-		   (t (cond ((whitespacep object)
-			     (loop until (end-of-buffer-p scan)
-				   while (whitespacep (object-after scan))
-				   do (fo))
-			     (make-entry 'whitespace-entry))
-			    ((constituentp object)
+		   (t (cond ((constituentp object)
 			     (loop until (end-of-buffer-p scan)
 				   while (constituentp (object-after scan))
 				   do (fo))
@@ -271,11 +263,13 @@
 				   0
 				   (end-offset (element* elements (1- guess-pos))))))
 	 ;; scan
-	 (unless (end-of-buffer-p scan)
-	   (loop with start-mark = nil
-		 until (if (end-of-buffer-p high-mark)
-			   (end-of-buffer-p scan)
-			   (mark> scan high-mark))
-		 do (setf start-mark (clone-mark scan))
-		    (insert* elements guess-pos (next-entry scan))
-		    (incf guess-pos)))))))
+	 (loop with start-mark = nil
+	       do (loop until (end-of-buffer-p scan)
+			while (whitespacep (object-after scan))
+			do (forward-object scan))
+	       until (if (end-of-buffer-p high-mark)
+			 (end-of-buffer-p scan)
+			 (mark> scan high-mark))
+	       do (setf start-mark (clone-mark scan))
+		  (insert* elements guess-pos (next-entry scan))
+		  (incf guess-pos))))))




More information about the Climacs-cvs mailing list