From 35838a074d832a11b51a84be31c15602356c10b0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 5 Mar 2020 23:46:01 -0800 Subject: tags: handle option struct slots with more care * tags.tl (collect-tags): In proccessing a define-option-struct, don't record a tag for a long or short option that is nil. Each option definition defines only one slot. If both a long and short option are present (non-nil), then the long option names the slot. --- tags.tl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tags.tl b/tags.tl index 3d6be813..075fc523 100755 --- a/tags.tl +++ b/tags.tl @@ -101,8 +101,10 @@ (let ((struct-name (cadr obj))) (add (ntag struct-tag struct-name)) (each ((obj (cdddr obj))) - (add (ntag slot-tag (car obj) struct-name)) - (add (ntag slot-tag (cadr obj) struct-name))))) + (tree-bind (short long . rest) obj + (cond + (long (add (ntag slot-tag long struct-name))) + (short (add (ntag slot-tag short struct-name)))))))) ((defstruct) (let ((struct-obj obj) (struct-name (tree-case (cadr obj) -- cgit v1.2.3