Small change to getopt stuff
[enscript.git] / states / hl / c_ppline.st
index 2bde859..b3678df 100644 (file)
@@ -3,16 +3,15 @@
  * Objective-C highlighting rules.
  */
 
+require_state (c);
+
 state c_ppline extends CHighlight
 {
-  BEGIN {
-    require_state (c);
-  }
   /* Comments within a pre-processor line. */
   /\/\*/ {
     comment_face (true);
     language_print ($0);
-    call (c_comment);
+    call (c_ppline_comment);
     comment_face (false);
   }
   /* Include line. */
@@ -51,6 +50,9 @@ state c_ppline extends CHighlight
     call (c_ppline_tokensequence);
     return;
   }
+  /\\\\\n/ {
+    language_print ($0);
+  }
   /\n/ {
     language_print ($0);
     return;
@@ -81,6 +83,9 @@ state c_ppline_include extends CHighlight
     call (c_ppline_comments_strings_chars);
     return;
   }
+  /\\\\\n/ {
+    language_print ($0);
+  }
   /\n/ {
     language_print ($0);
     return;
@@ -106,6 +111,9 @@ state c_ppline_define extends CHighlight
     call (c_ppline_comments_strings_chars);
     return;
   }
+  /\\\\\n/ {
+    language_print ($0);
+  }
   /\n/ {
     language_print ($0);
     return;
@@ -118,7 +126,7 @@ state c_ppline_comments_strings_chars extends CHighlight
   /\/\*/ {
     comment_face (true);
     language_print ($0);
-    call (c_comment);
+    call (c_ppline_comment);
     comment_face (false);
   }
   /* String constants. */
@@ -134,6 +142,9 @@ state c_ppline_comments_strings_chars extends CHighlight
     language_print ($0);
     string_face (false);
   }
+  /\\\\\n/ {
+    language_print ($0);
+  }
   /\n/ {
     language_print ($0);
     return;
@@ -146,7 +157,7 @@ state c_ppline_tokensequence extends CHighlight
   /\/\*/ {
     comment_face (true);
     language_print ($0);
-    call (c_comment);
+    call (c_ppline_comment);
     comment_face (false);
   }
   /* String constants. */
@@ -181,6 +192,20 @@ state c_ppline_tokensequence extends CHighlight
     language_print ($0);
     variable_name_face (false);
   }
+  /\\\\\n/ {
+    language_print ($0);
+  }
+  /\n/ {
+    language_print ($0);
+    return;
+  }
+}
+
+/* Comments within pre-processor directives need escaped newlines. */
+state c_ppline_comment extends c_comment {
+  /\\\\\n/ {
+    language_print ($0);
+  }
   /\n/ {
     language_print ($0);
     return;