Multi-token names are broken on subsequent expansions when nested in delimiters
Created by: natefaubion
macro (->) {
rule infix { $a:ident | $b:expr } => {
function($a) { return $b }
}
}
a = x -> [y -> y]
The ->
inside the array is not recognize as a macro name, and dropped due to how binary ops are combined (non-expr lhs drops the operator and lhs), resulting in an obscure error. I believe it isn't recognized as a macro because of how takeLine
handles delimiters. It copies the same range
to all of its children. The -
and >
tokens thus get the exact same range (not adjacent) and getName
does not recognize it as a compound name.