Closed lukego closed 9 years ago
Tx for the report. @kbara, would you mind having a look once you've finished that makefile patch? Thanks :)
Gladly, @andywingo . I was bothered by that too when looking into https://github.com/Igalia/pflua/issues/137 and https://github.com/Igalia/pflua/pull/138 ; Luke's absolutely right that it should be improved.
@lukego It's been addressed now: % ./pflua-compile "ip and tcp and garbage" luajit: ../src/pf/parse.lua:289: Pflua parse error: In expression "ip and tcp and garbage" ^ garbage is not a recognized keyword. Likely causes: a) garbage is a typo, invalid keyword, or similar error. b) You're trying to implicitly repeat the previous clause's keyword. Instead of libpcap-style elision, explicitly use keywords in each clause: ie, "host a and host b", not "host a and b".
This was previously partly-explained by a comment, but not the error message:
-- At this point the official pcap grammar is squirrely. It says:
-- "If an identifier is given without a keyword, the most recent
-- keyword is assumed. For example, not host vs and ace' is -- short for
not host vs and host aceand which should not be -- confused with
not (host vs or ace)`." For now we punt on this
-- part of the grammar.
Are you happy with the clarity of the current message? If you are, I'll close this. (I'm also taking a look at how involved implementing keyword elision would be; that would allow this message to be greatly simplified).
I'll close this now; please re-open it or file a new bug if you have further related problems. :)
The error message for illegal keywords could be mistaken for a compiler NYI instead of a user error: