Replies: 2 comments
-
let function_call = ident
.then(arg.repeated().collect().map(|args, e| (args, e.span())
.delimited_by(lparen, rparen));
function_call.parse("foo()"); What span should the arguments receive? It would not be correct to have the span select the parentheses, since they surround the arguments but are themselves not the arguments. The correct span is a zero-width one that fits between the parentheses. |
Beta Was this translation helpful? Give feedback.
-
I though this could be something like |
Beta Was this translation helpful? Give feedback.
-
Would it be more appropriate for
end
filed of theSimpleSpan
be non-zero, so something like:By definition, on the docs, the end is exclusive, so (0,0) values should not be valid.
This will have the added benefit, of
Option<SimpleSpan>
, not requiring an extra byte.(https://play.rust-lang.org/?gist=63b58e61f659c6613cf1bba8035def00)
Beta Was this translation helpful? Give feedback.
All reactions