On 09/04/15 09:26, Raul Miller wrote:
As a general rule, whenever a syntax error is not obvious, the real
error happened before that point...

But looking at my copy of `man pf.conf`, I don't see any mention of
backslash in the section on Grammar.

The only sentence using the word backslash is the one at the begining
which states "The current line can be extended over multiple lines
using a backslash (`\')." though reading down through example uses of
backslash it is also used with \n presumably to denote a newline
character for printf - all of which suggests that pf.conf inherits
backslash behavior from the C compiler tradition.

And, indeed, reading `man cc` and searching specifically for the word
"backslash" I get a more thorough treatment of the rules which are
probably relevant for pf.conf (or at least it explictly mentions
"backslash-newline" - it doesn't mention the \n convention either -
for that, I guess I'd go with `man printf`).

Thinking it over, perhaps `man pf.conf` should have that introductory
line changed to read "The current line can be extended over multiple
lines using a backslash-newline (`\')." Or, for real emphasis, the
parenthetical comment could be (`\' at the end of the line)."

In other words, for /usr/share/man/man5/pf.conf.5 either:

--- /usr/share/man/man5/pf.conf.5       Wed Mar  5 16:22:58 2014
+++ var1/man5/pf.conf.5 Thu Sep  3 16:19:21 2015
@@ -63,7 +63,7 @@ A method for detecting a host's operating system.
  Some example rulesets.
  .El
  .Pp
-The current line can be extended over multiple lines using a backslash
+The current line can be extended over multiple lines using a backslash-newline
  .Pq Sq \e .
  Comments can be put anywhere in the file using a hash mark
  .Pq Sq # ,
I would recommend:
The current line can be extended over multiple lines using a backslash without trailing white space.

I agree with later posts that nothing needs to be done to the parser. I have experienced the same error and wished it would give me the line number, but somehow I managed to find the mistake.

or

--- /usr/share/man/man5/pf.conf.5       Wed Mar  5 16:22:58 2014
+++ var2/man5/pf.conf.5 Thu Sep  3 16:33:39 2015
@@ -63,8 +63,8 @@ A method for detecting a host's operating system.
  Some example rulesets.
  .El
  .Pp
-The current line can be extended over multiple lines using a backslash
-.Pq Sq \e .
+The current line can be extended over multiple lines using a backslash-newline
+.Pq So \e Sc at the end of the line .
  Comments can be put anywhere in the file using a hash mark
  .Pq Sq # ,
  and extend to the end of the current line.

Or I guess you could use a real newline, something like this:

--- /usr/share/man/man5/pf.conf.5       Wed Mar  5 16:22:58 2014
+++ var3/man5/pf.conf.5 Thu Sep  3 16:36:27 2015
@@ -63,8 +63,10 @@ A method for detecting a host's operating system.
  Some example rulesets.
  .El
  .Pp
-The current line can be extended over multiple lines using a backslash
-.Pq Sq \e .
+The current line can be extended over multiple lines using a backslash-newline
+.Po So \e
+.br
+.Sc Pc .
  Comments can be put anywhere in the file using a hash mark
  .Pq Sq # ,
  and extend to the end of the current line.

(If you have set up the edited file like I have in my diffs, you can
see that last modified man page using man -M `pwd`/var3 pf.conf).

It's a bit of an odd concept, though, so maybe it is worth documenting.

Thanks,

Reply via email to