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 # , 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, -- Raul On Fri, Sep 4, 2015 at 9:02 AM, Joseph A Borg <jacb...@mac.com> wrote: > maybe the syntax error should point to the line where there are extra > characters after the escape? > > >> On 04 Sep 2015, at 14:53, Peter Hessler <phess...@theapt.org> wrote: >> >> Backslash says "ignore the following charecter". You are using it to >> ignore the newline. >> >> If you ignore the space instead, the newline then matters. >> >> This is not a bug, this is 100% by design. >> >> You'll need to ensure there are no trailing spaces after a backslash >> (and we do recommend removing trailing spaces in general, but those are >> not as damaging) >> >> >> On 2015 Sep 04 (Fri) at 14:30:05 +0200 (+0200), Joseph A Borg wrote: >> :I have something like this in pf.conf: >> : >> :services = "{ >> : ssh, >> \ >> : http, https, 8000, >> 8080, 8088, \ >> : smtp, pop3, pop3s, >> imap, imaps, \ >> : submission, 465, >> \ >> : domain, ntp >> \ >> : }" >> : >> :if there???s white space after the back slash the parser barfs by not >> creating the macro and then raising an error when it???s first used. >> : >> :I would assume this to be an inconvenience for the user as it???s not >> always possible to check whitespace after the backslash >> : >> :regards >> : >> >> -- >> "First things first -- but not necessarily in that order" >> -- The Doctor, "Doctor Who"