Commit 14859f43 authored by Troels Henriksen's avatar Troels Henriksen

More fixes regarding handling of quoted forms.

parent 4e98448e
......@@ -1424,7 +1424,8 @@ to find completions based on `string'."
(funcall fn syntax
(if useful-token
(start-offset (fully-quoted-form token))
(if (form-quoted-p token)
(if (and (form-quoted-p token)
(form-incomplete-p token))
(start-offset token)
(offset mark)))
(if useful-token
......@@ -1565,6 +1565,12 @@ stripping leading non-forms."
(defmethod form-operator (syntax (form list-form))
(first-form (rest (children form))))
(defmethod form-operator (syntax (form complete-quote-form))
(first-form (rest (children (second (children form))))))
(defmethod form-operator (syntax (form complete-backquote-form))
(first-form (rest (children (second (children form))))))
(defgeneric form-operands (syntax form)
(:documentation "Returns the operands of `form' as a list of
tokens. Returns nil if none can be found.")
......@@ -1698,6 +1704,12 @@ the form that `token' quotes, peeling away all quote forms."
(define-form-predicate comment-p (comment))
(defgeneric form-at-top-level-p (form)
(:documentation "Return NIL if `form' is not a top-level-form,
T otherwise.")
(:method ((form t))
(typep (parent form) 'form*)))
;;; Useful functions for modifying forms based on the mark.
......@@ -2013,7 +2025,8 @@ after `string'."
(loop for (first . rest) on children
if (formp first)
(cond ((< (start-offset first) offset (end-offset first))
(cond ((and (< (start-offset first) offset)
(<= offset (end-offset first)))
(return (if (null (children first))
(form-before-in-children (children first) offset))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment