It’ll be a lot easier if you pick some Rust operator to serve as your Lisp quote instead of putting it inside the identifier; @ is a reasonable choice because it’s unlikely to produce “local ambiguity” parse errors.
Can you expand more on how this "@" solution would work? It sounds like you have a solution, but I am not yet familiar enough with macro_rules! to put it together.
That sounds about right. This @ breaks out of the lisp parser temporarily and gets a rust value, which is pasted in as a syntax element. If you want to prevent lisp attempting to evaluate it, you’ll need to use (quote @rust_var) or the equivalent in your language. The macro wouldn’t be too hard to modify so that the value is always wrapped like this, if that’s the behavior you want.
Similarly, you could add a rule for @ $code:block $($rest:tt)* to allow arbitrary inline rust code instead of just a variable reference.
(I think) everything works now. Thanks for all your help. This is a very clever solution, the type of thing that is obvious-in-retrospect, but also not-obvious-if-possible until seeing the solution.