chiark / gitweb /
src/c-types-parse.lisp: Hoist up the `ds-FOO' methods for raw types.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 29 May 2016 14:08:43 +0000 (15:08 +0100)
Having them just after the definition of `declspecs' doesn't seem to
make a great deal of sense.

src/c-types-parse.lisp

index 58e3ced06115bbdc726df1cb14646d2bc8686085..4475c720d179862cf77c46f61cf7003faeabae78 100644 (file)
@@ -119,6 +119,10 @@ (defparameter *declspec-map*
     map)
   "Maps symbolic labels and textual names to `declspec' instances.")
 
+(defmethod ds-label ((ty c-type)) :c-type)
+(defmethod ds-name ((ty c-type)) (princ-to-string ty))
+(defmethod ds-kind ((ty c-type)) 'type)
+
 ;; A collection of declaration specifiers, and how to merge them together.
 
 (defclass declspecs ()
@@ -143,10 +147,6 @@ (defclass declspecs ()
    collection isn't good, I must roll back to the previous version.  So I
    don't get to take advantage of a mutable structure.)"))
 
-(defmethod ds-label ((ty c-type)) :c-type)
-(defmethod ds-name ((ty c-type)) (princ-to-string ty))
-(defmethod ds-kind ((ty c-type)) 'type)
-
 (defparameter *good-declspecs*
   '(((:int) (:signed :unsigned) (:short :long :long-long) ())
     ((:char) (:signed :unsigned) () ())