Commit 7ddca8c6 authored by Niels Möller's avatar Niels Möller
Browse files

Handle declarations like (foo . int) properly.

Rev: src/make_class:1.8
parent 56261add
......@@ -242,14 +242,18 @@
;; (method (function int "struct this_type *self struct foo *arg") name)
(define (fix-method name var)
(case (cadr var)
((method)
`(,(car var) pointer (function ,(caddr var) ("struct " ,name " *self")
,@(cdddr var))))
((indirect-method)
`(,(car var) pointer (function ,(caddr var) ("struct " ,name " **self")
,@(cdddr var))))
(else var)))
(let ((type (var-type var))
(variable (var-name var)))
(if (atom? type)
var
(case (car type)
((method)
`(,variable pointer (function ,(cadr type) ("struct " ,name " *self")
,@(cddr type))))
((indirect-method)
`(,variable pointer (function ,(cadr type) ("struct " ,name " **self")
,@(cddr type))))
(else var)))))
(define (do-instance-struct name super vars)
; (werror "do-instance-struct\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment