this is all very fascinating. Is it possible to contemplate a pre-filter that chomps out trailing whitespace and comments? Would this overly complicate the parsing process and introduce security issues?
I’m asking because this might improve readability, usability and security for less gifted users like me… > On 04 Sep 2015, at 19:37, Otto Moerbeek <o...@drijf.net> wrote: > > On Fri, Sep 04, 2015 at 05:51:54PM +0300, Kimmo Paasiala wrote: > >> On Fri, Sep 4, 2015 at 4:02 PM, Joseph A Borg <jacb...@mac.com> wrote: >>> maybe the syntax error should point to the line where there are extra >>> characters after the escape? >>> >>> >> >> That would require making the backslash a lexical token in the >> pf.conf(5) syntax. Now it's just a simple escape character that gets >> eaten and forgotten by the lexical analyzer that splits the input into >> tokens to be parsed by the syntax parser. >> >> -Kimmo > > It's a historical accident that the pf grammar is line oriented. I > once started a litttle project to modify the pf yacc grammer to treat > end-of-lines as regular whitespace and came a long way, but something > got in between and the diff got lost.... > > -Otto