aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-22 18:56:34 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-22 19:33:08 -0700
commitab7ae4da85c41ce4e75e5cb2498a426a5597a349 (patch)
tree100aa2fd01fcb6f5c6960453b13e81db9c41516a
parent9803f3fa9327c7600042bcc4549fb9e33b73d24c (diff)
downloadconsfigurator-ab7ae4da85c41ce4e75e5cb2498a426a5597a349.tar.gz
fix extracting indentation declarations in property definitions
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/property.lisp4
-rw-r--r--src/util.lisp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/property.lisp b/src/property.lisp
index d94a534..f0a89a7 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -235,7 +235,9 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV."
(when (> (length ,declarations) 1)
(error "Multiple DECLARE forms unsupported."))
,@mforms
- (let ((indent (cadr (assoc 'indent (cdar ,declarations)))))
+ (let ((indent (cadr (find-if (lambda (e)
+ (form-beginning-with indent e))
+ (cdar ,declarations)))))
`(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
(record-known-property ',,name))
diff --git a/src/util.lisp b/src/util.lisp
index 7ee7e1a..f07e90e 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -116,7 +116,9 @@ supported."
(error ',name :format-control message :format-arguments args))))
(defmacro form-beginning-with (sym form)
- `(and (listp ,form) (eq ',sym (car ,form))))
+ `(and (listp ,form)
+ (symbolp (car ,form))
+ (string= (symbol-name (car ,form)) ,(symbol-name sym))))
(defun strip-declarations (forms)
(loop while (form-beginning-with declare (car forms))