[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] bind bug?
From: |
Ross Lonstein |
Subject: |
Re: [Chicken-users] bind bug? |
Date: |
Mon, 21 Feb 2011 08:59:15 -0600 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Sun, Feb 20, 2011 at 09:04:36PM -0600, Ross Lonstein wrote:
[snip]
> Error: during expansion of (bind ...) - lexer error: illegal character: `''
> (code 39)
>
> Call history:
>
> <syntax> (##core#begin (bind "#define
> PARSE_THIS_ARRAY '\\x00','\\x00','\\x00','\\x00'"))
> <syntax> (bind "#define PARSE_THIS_ARRAY
> '\\x00','\\x00','\\x00','\\x00'") <--
>
> Error: shell command terminated with non-zero exit status 17920:
> /opt/chicken/bin/chicken bind-bug.scm -output-file bind-bug.c
[snip]
Messed with the specification fed to the lexer, the below gets me
further. It's not correct since escaped hex can be any length but for
the header I'm working with it's ok.
--- /tmp/bind/c.l 2011-02-21 09:44:24.000000000 -0500
+++ /tmp/bind-hack/c.l 2011-02-21 09:44:32.000000000 -0500
@@ -131,6 +131,7 @@
(tok (list 'string
(reverse-list->string
cs)) )]
[else (loop (cons c cs))]
) ) )
\'\\{digit}{digit}{digit}\' (tok (list 'char (string->number
(substring yytext 3 5) 8)))
+\'\\x{digit16}+\' (tok (list 'char (string->number
(substring yytext 3 (string-length yytext)) 16)))
\'\\0\' (tok '(char #\nul))
\'\\a\' (tok '(char #\alarm))
\'\\b\' (tok '(char #\backspace))
Thanks.
- Ross