[Prev][Next][Index]
Re: Unparsing problems
- From: "Beata Winnicka" <bfatyga@slab.cica.indiana.edu>
- Date: Wed, 15 Feb 95 11:06:36 -0500
- To: Diego Novillo <diego@cs.ualberta.ca>
- Subject: Re: Unparsing problems
- Cc: sage-bugs@cica.indiana.edu (Sage Bug Reports)
>I'm having problems with SgFile::unparse(). It doesn't like things like:
>
> main()
> {
> char c = '\0';
>
> ...
>}
Looks like I've fixed this particular bug about a month ago. Try the following:
Find the following code in lib/newsrc/unparse.c:
if (strncmp(&(str[i]),"CHARVAL", strlen("CHARVAL"))== 0) /* %CHARVAL : Char Value */
{
switch(NODE_CV(ll)){
case '\n':BufPutChar('\\'); BufPutChar('n'); break;
case '\t':BufPutChar('\\'); BufPutChar('t'); break;
(This is around line 2043 in the version we have)
and add the following cases to the switch statement:
case '\0':BufPutChar('\\'); BufPutChar('0'); break;
case '\'':BufPutChar('\\'); BufPutChar('\''); break;
case '\"':BufPutChar('\\'); BufPutChar('\"'); break;
case '\\':BufPutChar('\\'); BufPutChar('\\'); break;
--Beata