guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ANN] nyacc 0.80.4 released


From: Matt Wette
Subject: Re: [ANN] nyacc 0.80.4 released
Date: Tue, 1 Aug 2017 16:10:48 -0700

> On Aug 1, 2017, at 1:53 PM, Jan Nieuwenhuizen <address@hidden> wrote:
> 
> Matt Wette writes:
> 
>> NYACC version 0.80.4 is released 
>> 
>> This is a bug-fix release, to fix several bugs discovered by janneke.  
>> Thanks Jan.
>> 1) C parser not parsing “0ULL” as numeric; fixed.
>> 2) #undef FOO not working; fixed;
>> 3) struct foo { …} => (struct-def (ident (“foo”))… ; fixed: => (struct-def 
>> (ident “foo”) …
>> 4) C pre-processor argument reading dropping characters 
> 
> Yay, thanks again!

Thanks for the reports.  I am happy to see the severity in bugs reducing.
For the FFI-helper I need to parse the rat’s nest under /usr/include so I am 
catching more.

> 
> Meanwhile, rain1 and I found two bugs.  First is not really a bug, debug
> printing while parsing \xXX.  Do
> 
>    (with-input-from-file "x00.c" parse-c99)
> 
> with x00.c:
> 
>    char *s = "\x66\x6f\x6f\x20";
> 
> see patch attached.
> 
> The others is parsing of "\0", see null.c.  Instead of a null character
> (or possibly literally "\0") we get an ascii 0 (without backslash).
> 
> Not sure what we want here, if "\0" passes through literally, the
> compiler will need to parse strings again and change those to null?


I am not sure what you are getting at here.  If I have
        char *s = “foo\0bar”;
then the tree is
  (trans-unit
    (decl (decl-spec-list (type-spec (fixed-type "char")))
          (init-declr-list
            (init-declr
              (ptr-declr (pointer) (ident "s"))
              (initzer (p-expr (string "foo\x00bar")))))))
so the null character makes it into the tree.  The tree language is SXML so 
this should be a 
legal Scheme string, which I think it is.  See 
http://dl.acm.org/citation.cfm?doid=571727.571736.

On the other hand, the C99 pretty-printer turns out
  char *s = "foo\x00bar”;
which is wrong.  I will work on something to make this look like “foo\0bar”.

Look for fixes to above, along with some (minor) changes in c99 output, in 
0.81.0.

Matt





reply via email to

[Prev in Thread] Current Thread [Next in Thread]