From 6d02c842eb739056d9fd8b11b28d3bfd6fe5a4d8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 22 Apr 2022 07:16:10 -0700 Subject: man page: note issue with backslash continuation. --- cppawk.1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cppawk.1 b/cppawk.1 index 5be963c..91ccb3f 100644 --- a/cppawk.1 +++ b/cppawk.1 @@ -285,6 +285,29 @@ to encode the quote: /abc\e042/ +Another area of an incompatibility is that newlines are significant in +the Awk grammar, and some Awk programs use backslash-newline escape +sequences in order to turn significant newlines into insignificant +newlines. Though the C preprocessor recognizes and consumes backslash-newline +sequences it may, unfortunately, replace them with an unescaped newlines. So +the backslash line continuation technique is not reliably available to +.B cppawk +programs. A clumsy workaround which works with GNU +.I cpp +is this: + +.ft B + #define BS \e\e + /pattern/ BS + { action } +.ft R + +Some Awk code uses backslash continuations in order to turn +These are significant Awk has significant newlines +in numerous places in the grammar which can change the meaning of the +code or introduce a syntax error, unless they are escaped with a backslash. +This backlash escaping is + Awk implementations reports errors against lines an anonymous filename associated with the preprocessed stream, rather than the original lines in the original file. Although the preprocessed output indicates source file and line -- cgit v1.2.3