
Update of /project/climacs/cvsroot/climacs In directory clnet:/tmp/cvs-serv881 Modified Files: lisp-syntax.lisp lisp-syntax-swine.lisp Log Message: Even more fixes regarding handling of quoted forms (now works I think). --- /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/09/16 10:30:37 1.117 +++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/09/16 12:11:11 1.118 @@ -2025,8 +2025,7 @@ (loop for (first . rest) on children if (formp first) do - (cond ((and (< (start-offset first) offset) - (<= offset (end-offset first))) + (cond ((< (start-offset first) offset (end-offset first)) (return (if (null (children first)) nil (form-before-in-children (children first) offset)))) @@ -2034,8 +2033,12 @@ (or (null (first-form rest)) (<= offset (start-offset (first-form rest))))) (return (let ((potential-form - (when (form-list-p first) - (form-before-in-children (children first) offset)))) + (cond ((form-list-p first) + (form-before-in-children (children first) offset)) + ((and (form-quoted-p first) + (not (form-incomplete-p first)) + (form-list-p (second (children first)))) + (form-before-in-children (children (second (children first))) offset))))) (if (not (null potential-form)) (if (<= (end-offset first) (end-offset potential-form)) --- /project/climacs/cvsroot/climacs/lisp-syntax-swine.lisp 2006/09/16 10:30:37 1.10 +++ /project/climacs/cvsroot/climacs/lisp-syntax-swine.lisp 2006/09/16 12:11:12 1.11 @@ -493,13 +493,14 @@ ;; nested/destructuring argument lists such as those found in ;; macros. (labels ((recurse (candidate-form) - (when (parent candidate-form) - (if (and (direct-arg-p syntax (first-form (children candidate-form)) - arg-form) - (not (find-applicable-form syntax (first-form (children candidate-form))))) - candidate-form + (if (and (direct-arg-p syntax (first-form (children candidate-form)) + arg-form) + (not (find-applicable-form syntax (first-form (children candidate-form))))) + candidate-form + (unless (form-at-top-level-p candidate-form) (recurse (parent candidate-form)))))) - (recurse (parent arg-form)))) + (unless (form-at-top-level-p arg-form) + (recurse (parent arg-form))))) (defun relevant-keywords (arglist arg-indices) "Return a list of the keyword arguments that it would make @@ -770,7 +771,8 @@ ;; If nothing else can be found, and `arg-form' ;; is the operator of its enclosing form, we use ;; the enclosing form. - (when (eq (first-form (children (parent immediate-form))) immediate-form) + (when (and (not (form-at-top-level-p immediate-form)) + (eq (first-form (children (parent immediate-form))) immediate-form)) (parent immediate-form)))))) ;; If we cannot find a form, there's no point in looking ;; up any of this stuff.
participants (1)
-
thenriksen