You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I already attempted to try to use proc-macro-hack instead, but it failed to work, likely because of they weird (and honestly, probably bad) construction it builds to allow the user to use the . operator to access the different sub-parsers / non-terminals:
// user code
let parser = grammar! {
something = ...
something_else = ...
}
An alternative way to (hopefully) circumvent the use of the currently unstable #![feature(proc_macro_hygiene)] could be to do something like this instead:
// user code
mod parser {
grammar! {
something = ...
something_else = ...
}
}
and then expand to this, without the weird struct/impl construction:
I already attempted to try to use
proc-macro-hack
instead, but it failed to work, likely because of they weird (and honestly, probably bad) construction it builds to allow the user to use the.
operator to access the different sub-parsers / non-terminals:would essentially expand to this:
and then it can be used like this:
An alternative way to (hopefully) circumvent the use of the currently unstable
#![feature(proc_macro_hygiene)]
could be to do something like this instead:and then expand to this, without the weird
struct
/impl
construction:and the use would be slightly different, but not much:
This should "just work" on stable rust AFAIK, and in the worst case it should definitely work using
proc-macro-hack
.(Note: wrapping the
grammar!
invocation in amod
is simply to avoid namespace pollution, it could technically be left out if the user wants that.)The text was updated successfully, but these errors were encountered: