Closed tcr closed 7 years ago
As of #22 the reduce! macro is very straightforward, and could be converted to run on stable (or really, removed entirely by inlining the code into the alex/happy forks).
Indeed, I've moved the generation into Happy now.
In the rush to get this compiling, there's some regex(!) hacks used in the parser-c-macro crate to get code compiling.
https://github.com/tcr/parser-c/blob/master/parser-c-macro/src/lib.rs#L18-L56
These regexes should be run against and directly committed into the code that uses the
reduce!()
macro. Then thereduce!()
macro can focus exclusively on converting a pattern-matching function likefn test (Some(value): Option<i32>) { .. }
into its deconstructed functionfn test (_0: Option<i32>) { match _0 { Some(value) => { .. }, _ => panic!("Irrefutable pattern in Rust"); }
.This also would allow it to be rewritten as a procedural macro and compiled on normal rust (see #7).