Closed
Description
Currently, the following macro argument grammar will not successfully parse anything, complaining of a "local ambiguity":
$( $t:ty )* #
The problem is that if it were to use the Rust parser to try to parse a type and fail, the whole task would be killed. This is easy to fix after that problem is resolved. There are two options:
- Break parsing into a separate task, and see whether it survives. However, parse.rs requires a
parse_sess
, which is mutable state, and can't be shared. So the second option is probably more doable: - Allow the parser to safely return instead of killing the task. This works much like the Error monad. Ordinarily, this would require a lot of tedious wrapping and unwrapping, but we have a macro system! It should be relatively easy to make a notation like Haskell's
do
, and the parser would be able to stay in the standard imperative style.