From 48eb81ca02d7e618ecc474f73ef948b023586857 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 27 Jul 2019 01:05:41 +0100 Subject: [PATCH] src/pset-{proto,impl}.lisp: Move `decode-property' methods to `impl'. Most of these don't count as part of the protocol. --- src/pset-impl.lisp | 9 +++++++++ src/pset-proto.lisp | 8 +------- src/sod.asd.in | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pset-impl.lisp b/src/pset-impl.lisp index f938ad3..8e1743f 100644 --- a/src/pset-impl.lisp +++ b/src/pset-impl.lisp @@ -88,6 +88,15 @@ (defmethod file-location ((prop property)) (file-location (p-location prop))) +;;; Input conversions. + +(defmethod decode-property ((raw symbol)) (values :symbol raw)) +(defmethod decode-property ((raw integer)) (values :int raw)) +(defmethod decode-property ((raw string)) (values :string raw)) +(defmethod decode-property ((raw character)) (values :char raw)) +(defmethod decode-property ((raw function)) (values :func raw)) +(defmethod decode-property ((raw c-type)) (values :type raw)) + ;;; Keywords. (defmethod coerce-property-value diff --git a/src/pset-proto.lisp b/src/pset-proto.lisp index 764350a..5e02d9b 100644 --- a/src/pset-proto.lisp +++ b/src/pset-proto.lisp @@ -66,14 +66,8 @@ (export 'decode-property) (defgeneric decode-property (raw) (:documentation "Decode a RAW value into a TYPE, VALUE pair.") - (:method ((raw symbol)) (values :symbol raw)) - (:method ((raw integer)) (values :int raw)) - (:method ((raw string)) (values :string raw)) - (:method ((raw character)) (values :char raw)) (:method ((raw property)) (values (p-type raw) (p-value raw))) - (:method ((raw cons)) (values (car raw) (cdr raw))) - (:method ((raw function)) (values :func raw)) - (:method ((raw c-type)) (values :type raw))) + (:method ((raw cons)) (values (car raw) (cdr raw)))) (export 'make-property) (defun make-property (name raw-value &key type location seenp) diff --git a/src/sod.asd.in b/src/sod.asd.in index e1a6f46..0755979 100644 --- a/src/sod.asd.in +++ b/src/sod.asd.in @@ -118,7 +118,7 @@ ;; Property set protocol. (:file "pset-proto" :depends-on ("package" "c-types-proto")) - (:file "pset-impl" :depends-on ("pset-proto")) + (:file "pset-impl" :depends-on ("pset-proto" "module-proto")) (:file "pset-parse" :depends-on ("pset-proto" "lexer-proto")) ;; Code generation protocol. -- 2.11.0