[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [patch] Bind: parsing of pointers to const
From: |
Florian Zumbiehl |
Subject: |
[Chicken-hackers] [patch] Bind: parsing of pointers to const |
Date: |
Sun, 17 Feb 2013 14:06:52 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi,
currently, the bind egg parses const char * as (const (c-pointer char)),
even though that's the type signature of a pointer to constant characters
and not of a constant pointer to characters.
The patch below fixes that--though I am not sure whether the parsing
strategy wouldn't actually need a more fundamental change to make it scope
specifiers and qualifiers correctly in general.
Regards, Florian
---------------------------------------------------------------------------
diff --git a/bind-translator.scm b/bind-translator.scm
index 6ec4088..966168c 100644
--- a/bind-translator.scm
+++ b/bind-translator.scm
@@ -248,9 +248,13 @@
(define parse-type-rec
(match-lambda
- [('const . more)
+ [('const . more)
(let-values ([(t0 more) (parse-type-rec more)])
- (values `(const ,t0) more) ) ]
+ (values
+ (match t0
+ [`(c-pointer . ,t0) `(c-pointer (const . ,t0))]
+ [_ `(const ,t0)])
+ more))]
[('unsigned t 'star . more)
(let-values ([(t0 more) (parse-type-rec (cons* 'unsigned t more))])
(values `(c-pointer ,t0) more) ) ]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Chicken-hackers] [patch] Bind: parsing of pointers to const,
Florian Zumbiehl <=