wirefilter icon indicating copy to clipboard operation
wirefilter copied to clipboard

Compilation error in wirefilter-parser

Open bluebear94 opened this issue 3 years ago • 4 comments

I’m trying to run the tests for this crate, but it doesn’t compile on a current Rust version.

$ cargo test --workspace
(other output...)
error: expected `;`
   --> wirefilter-parser/src/lib.rs:55:18
    |
55  |             $node.children();
    |                  ^
...
125 |         parse_range!(node, int_lit)
    |         --------------------------- in this macro invocation
    |
    = note: this error originates in the macro `proc_macro_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected `;`
   --> wirefilter-parser/src/lib.rs:55:18
    |
55  |             $node.children();
    |                  ^
...
150 |         parse_range!(node, ipv4_lit)
    |         ---------------------------- in this macro invocation
    |
    = note: this error originates in the macro `proc_macro_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected `;`
   --> wirefilter-parser/src/lib.rs:55:18
    |
55  |             $node.children();
    |                  ^
...
155 |         parse_range!(node, ipv6_lit)
    |         ---------------------------- in this macro invocation
    |
    = note: this error originates in the macro `proc_macro_call` (in Nightly builds, run with -Z macro-backtrace for more info)

rustc version: rustc 1.62.1 (e092d0b6b 2022-07-16)
wirefilter version: commit 1fea9c94

bluebear94 avatar Aug 11 '22 03:08 bluebear94

I know literally nothing about rust but am interested in this project. I also ran into the same errors. The errors went away after I did cargo update which updated dependency versions I think. After that, just saw test failures which are easy to fix.

rustup 1.26.0 (2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.70.0 (90c541806 2023-05-31)`

cch0 avatar Jun 01 '23 23:06 cch0

The wirefilter library in the engine crate no longer uses the pest based parser in the wirefilter-parser crate, there is a handwritten parser in the wirefilter crate which is a lot better, more performant and with better errors for the wirefilter syntax.

veeshi avatar Jun 08 '23 09:06 veeshi

@cch0 what did you do to fix the tests?

sighup1 avatar Feb 08 '24 23:02 sighup1

@cch0 I spoke too soon I understand now.

sighup1 avatar Feb 08 '24 23:02 sighup1