[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Fri Jan 4 14:12:48 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv23422/Drei

Modified Files:
	lr-syntax.lisp 
Log Message:
Don't use the drawing options of the stack-top in Drei.

This solves a problem where pretty much the entire buffer would be
drawn a beautiful shade of bright red when a syntax error occured. I
think the Right Thing is to make Lisp syntax a little more intelligent
with respect to syntax errors.


--- /project/mcclim/cvsroot/mcclim/Drei/lr-syntax.lisp	2008/01/03 21:11:40	1.8
+++ /project/mcclim/cvsroot/mcclim/Drei/lr-syntax.lisp	2008/01/04 14:12:48	1.9
@@ -91,6 +91,10 @@
    (preceding-parse-tree :initform nil :reader preceding-parse-tree)
    (parser-state :initform nil :initarg :parser-state :reader parser-state)))
 
+(defmethod print-object ((object parser-symbol) stream)
+  (print-unreadable-object (object stream :type t :identity t)
+    (format stream "~s ~s" (start-offset object) (end-offset object))))
+
 (defclass literal-object-mixin () ()
   (:documentation "Mixin for parser symbols representing
 literal (non-character) objects in the buffer."))
@@ -118,10 +122,6 @@
 
 (defclass lexeme (parser-symbol) ())
 
-(defmethod print-object ((lexeme lexeme) stream)
-  (print-unreadable-object (lexeme stream :type t :identity t)
-    (format stream "~s ~s" (start-offset lexeme) (end-offset lexeme))))
-
 (defclass nonterminal (parser-symbol) ())
 
 (defmethod initialize-instance :after ((parser-symbol nonterminal) &rest args)
@@ -467,8 +467,8 @@
 
 (defun get-drawing-options (highlighting-rules syntax parse-symbol)
   "Get the drawing options with which `parse-symbol' should be
-drawn. If `parse-symbol' is NIL, return NIL."
-  (when parse-symbol
+drawn. If `parse-symbol' or the stack-top of syntax, return NIL."
+  (when (and parse-symbol (not (eq (stack-top syntax) parse-symbol)))
     (funcall highlighting-rules syntax parse-symbol)))
 
 (defstruct (pump-state
@@ -535,7 +535,7 @@
                               (finish (line-end-offset line) start-symbol))
                              ((and (typep symbol 'literal-object-mixin))
                               (finish (start-offset symbol) symbol
-                                      (or (get-drawing-options highlighting-rules syntax symbol)
+                                      (or symbol-drawing-options
                                           (make-drawing-options :function (object-drawer)))))
                              ((and (> (start-offset symbol) offset)
                                    (not (drawing-options-equal (or symbol-drawing-options




More information about the Mcclim-cvs mailing list