From 8982ed2f2159069051153f1652b20515050d4d1c Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 6 Apr 2022 14:53:38 -0700 Subject: [PATCH] =?UTF-8?q?ignored=20=E2=86=92=20unknown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quad2/attr.rkt | 13 +++++-------- quad2/constants.rkt | 2 +- quad2/struct.rkt | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/quad2/attr.rkt b/quad2/attr.rkt index 659f3dcb..387dacc1 100644 --- a/quad2/attr.rkt +++ b/quad2/attr.rkt @@ -53,8 +53,8 @@ (cond [(attr-key? ak) av] [(symbol? ak) - (match (hash-ref attr-lookup-table ak :ignored-key) - [(== :ignored-key eq?) + (match (hash-ref attr-lookup-table ak :unknown-key) + [(== :unknown-key eq?) #:when strict-attrs? (raise-argument-error 'upgrade-attr-keys "known attr" ak)] [attr-key @@ -94,10 +94,8 @@ (do-attr-iteration qs #:which-attr attr-numeric-key? #:attr-proc (λ (ak av attrs) - (cond - [(string->number av)] - [else - (raise-argument-error 'convert-numeric-attr-values "numeric string" av)])))) + (or (string->number av) + (raise-argument-error 'convert-numeric-attr-values "numeric string" av))))) (define-pass (complete-attr-paths qs) #:pre (list-of quad?) @@ -107,8 +105,7 @@ ;; relies on `current-directory` being parameterized to source file's dir (do-attr-iteration qs #:which-attr attr-path-key? - #:attr-proc (λ (ak av attrs) - (path->complete-path av)))) + #:attr-proc (λ (ak av attrs) (path->complete-path av)))) (define-pass (parse-dimension-strings qs) #:pre (list-of quad?) diff --git a/quad2/constants.rkt b/quad2/constants.rkt index 930b0c3e..1151bd2c 100644 --- a/quad2/constants.rkt +++ b/quad2/constants.rkt @@ -9,7 +9,7 @@ (define LIST-NAME (list ATTR-NAME ...)))) (define-attr-list all-attrs - [:ignored-key (attr-ignored-key (gensym))] + [:unknown-key (attr-unknown-key (gensym))] [:font-family (attr-uncased-string-key 'font-family)] [:font-path (attr-path-key 'font-path)] [:font-bold (attr-boolean-key 'font-bold)] diff --git a/quad2/struct.rkt b/quad2/struct.rkt index ea12c8c6..1379b8c7 100644 --- a/quad2/struct.rkt +++ b/quad2/struct.rkt @@ -25,4 +25,4 @@ path numeric boolean - ignored) \ No newline at end of file + unknown) \ No newline at end of file