[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Wed Jan 9 11:14:08 UTC 2008


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

Modified Files:
	lisp-syntax-swine.lisp lisp-syntax.lisp lr-syntax.lisp 
	packages.lisp 
Log Message:
Improved performance of LR syntax, and Lisp syntax's handling of non-character buffer objects.


--- /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax-swine.lisp	2008/01/09 08:55:24	1.11
+++ /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax-swine.lisp	2008/01/09 11:14:08	1.12
@@ -588,7 +588,7 @@
          (operands (when (and form (form-list-p form))
                      (mapcar #'(lambda (operand)
                                  (when operand
-                                   (form-to-object syntax operand)))
+                                   (form-to-object syntax operand :no-error t)))
                              (form-operands syntax form))))
          (current-operand-indices (when form
                                     (find-operand-info syntax offset form))))
--- /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax.lisp	2008/01/09 08:55:24	1.61
+++ /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax.lisp	2008/01/09 11:14:08	1.62
@@ -2571,9 +2571,11 @@
 (defun invoke-reader (syntax form)
   "Use the system reader to handle `form' and signal a
 `reader-invoked' condition with the resulting data."
-  (let* ((start-mark (make-buffer-mark (buffer syntax) (start-offset form))))
+  (let* ((start-mark (make-buffer-mark (buffer syntax) (start-offset form)))
+         (end-mark (make-buffer-mark (buffer syntax) (end-offset form))))
     (let* ((stream (make-buffer-stream :buffer (buffer syntax)
-                                       :start-mark start-mark))
+                                       :start-mark start-mark
+                                       :end-mark end-mark))
            (object (read-preserving-whitespace stream)))
       (signal 'reader-invoked :end-mark (point stream) :object object))))
 
@@ -2920,7 +2922,10 @@
 
 (defmethod form-to-object ((syntax lisp-syntax) (form complete-string-form)
                            &key &allow-other-keys)
-  (invoke-reader syntax form))
+  (if (notany #'literal-object-p (children form))
+      (invoke-reader syntax form)
+      (form-conversion-error
+       syntax form "String form contains non-character element")))
 
 (defmethod form-to-object ((syntax lisp-syntax) (form function-form) &rest args)
   (list 'cl:function (apply #'form-to-object syntax (second (children form)) args)))
--- /project/mcclim/cvsroot/mcclim/Drei/lr-syntax.lisp	2008/01/09 08:55:24	1.15
+++ /project/mcclim/cvsroot/mcclim/Drei/lr-syntax.lisp	2008/01/09 11:14:08	1.16
@@ -99,6 +99,11 @@
   (:documentation "Mixin for parser symbols representing
 literal (non-character) objects in the buffer."))
 
+(defun literal-object-p (parser-symbol)
+  "Return true if `parser-symbol' is of type
+`literal-object-mixin'."
+  (typep parser-symbol 'literal-object-mixin))
+
 (defmethod start-offset ((state parser-symbol))
   (let ((mark (start-mark state)))
     (when mark
@@ -378,7 +383,7 @@
                                              (parser-state stack-top)
                                              stack-top)))
           (loop do (parse-patch syntax)))))
-    (values 0 (offset (scan syntax)))))
+    (values 0 (size (buffer syntax)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
--- /project/mcclim/cvsroot/mcclim/Drei/packages.lisp	2008/01/07 22:55:11	1.37
+++ /project/mcclim/cvsroot/mcclim/Drei/packages.lisp	2008/01/09 11:14:08	1.38
@@ -515,7 +515,7 @@
 	   #:parser-symbol #:parent #:children
 	   #:start-offset #:end-offset #:parser-state
 	   #:preceding-parse-tree
-           #:literal-object-mixin
+           #:literal-object-mixin #:literal-object-p
 	   #:define-parser-state
 	   #:lexeme #:nonterminal
 	   #:action #:new-state #:done




More information about the Mcclim-cvs mailing list