dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_preproc.c,1.2,1.3


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_preproc.c,1.2,1.3
Date: Tue, 08 Jul 2003 07:16:07 -0400

Update of /cvsroot/dotgnu-pnet/pnet/cscc/common
In directory subversions:/tmp/cvs-serv24824/cscc/common

Modified Files:
        cc_preproc.c 
Log Message:
ignore escape sequences in literal strings


Index: cc_preproc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/common/cc_preproc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** cc_preproc.c        8 May 2003 17:35:31 -0000       1.2
--- cc_preproc.c        8 Jul 2003 11:16:05 -0000       1.3
***************
*** 222,225 ****
--- 222,226 ----
        int dcomment, quote;
        int lineStart, sawEOF;
+       int literal;
        int directive;
  
***************
*** 241,244 ****
--- 242,246 ----
        dcomment = 0;
        quote = 0;
+       literal = 0;
        lineStart = bufLen;
        directive = 0;
***************
*** 472,493 ****
                                /* End of the string literal */
                                ADD_CH(ch);
!                               quote = 0;
!                       }
!                       else if(ch == '\\')
!                       {
!                               /* Escape sequence of some type */
!                               ADD_CH('\\');
!                               ch = getc(stream);
!                               if(ch == '"' || ch == '\'' || ch == '\\')
                                {
!                                       ADD_CH(ch);
                                }
!                               else if(ch != EOF)
                                {
!                                       ungetc(ch, stream);
                                }
!                               else
                                {
!                                       sawEOF = 1;
                                }
                        }
--- 474,515 ----
                                /* End of the string literal */
                                ADD_CH(ch);
!                               if(literal)
                                {
!                                       ch=getc(stream);        
!                                       if(ch==quote)
!                                       {
!                                               ADD_CH(quote);
!                                       }
!                                       else
!                                       {
!                                               ungetc(ch,stream);
!                                               quote=0;
!                                               literal=0;
!                                       }
                                }
!                               else
                                {
!                                       quote = 0;
                                }
!                       }
!                       else if(ch == '\\')
!                       {
!                               ADD_CH('\\');
!                               if(!literal)
                                {
!                                       /* Escape sequence of some type */
!                                       ch = getc(stream);
!                                       if(ch == '"' || ch == '\'' || ch == 
'\\')
!                                       {
!                                               ADD_CH(ch);
!                                       }
!                                       else if(ch != EOF)
!                                       {
!                                               ungetc(ch, stream);
!                                       }
!                                       else
!                                       {
!                                               sawEOF = 1;
!                                       }
                                }
                        }
***************
*** 561,564 ****
--- 583,602 ----
                        directive = 1;
                        ADD_CH(ch);
+               }
+               else if(ch == '@')
+               {
+                       /* This may be the start of a literal string */
+                       ADD_CH(ch);
+                       ch = getc(stream);
+                       if(ch == '"' || ch == '\'')
+                       {
+                               quote = ch;
+                               literal = 1;
+                               ADD_CH(ch);
+                       }
+                       else
+                       {
+                               ungetc(ch, stream);
+                       }
                }
                else





reply via email to

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