]> andersk Git - splint.git/commitdiff
Fixed \ line parsing.
authorevans1629 <evans1629>
Sat, 23 Aug 2003 19:34:09 +0000 (19:34 +0000)
committerevans1629 <evans1629>
Sat, 23 Aug 2003 19:34:09 +0000 (19:34 +0000)
src/cpplib.c

index 100290d1ea40c176cea3fdff609fe0fb1adbea16..db2265e22c0e4fe1493a35d57561b865b27575d5 100644 (file)
@@ -6390,10 +6390,20 @@ get_next:
        op2:
          token = CPP_OTHER;
          pfile->only_seen_white = 0;
-        op2any:
+        op2any: /* jumped to for \ continuations */
          cpplib_reserve(pfile, 3);
          cppReader_putCharQ (pfile, c);
-         cppReader_putCharQ (pfile, cppReader_getC (pfile));
+
+         /* evans 2003-08-24: This is a hack to fix line output for \
+            continuations.  Someday I really should get a decent pre-processor! 
+         */
+
+         if (c == '\\') {
+           (void) cppReader_getC (pfile); /* skip the newline to avoid extra lines */
+         } else {
+           cppReader_putCharQ (pfile, cppReader_getC (pfile)); 
+         }
+
          cppReader_nullTerminateQ (pfile);
          return token;
 
@@ -6659,6 +6669,8 @@ get_next:
 
         case '\\':
          c2 = cppReader_peekC (pfile);
+         //! allow other stuff here if a flag is set?
+         DPRINTF (("Got continuation!"));
          if (c2 != '\n')
            goto randomchar;
          token = CPP_HSPACE;
This page took 0.06961 seconds and 5 git commands to generate.