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'd like to write a ParseElem implementation that returns references to the original input - something like:
impl ParseElem<'input> for Vec<Token> {
type Element = &'input Token;
fn parse_elem(&'input self, pos: usize) -> RuleResult<Self::Element> {
match self.get(pos) {
Some(tok) => RuleResult::Matched(pos + 1, tok),
None => RuleResult::Failed,
}
}
}
But unfortunately with the current ParseElem definition I don't think this is possible. Is there any reason ParseElem doesn't have an explicit lifetime specifier (like ParseSlice does)? And if not, would you accept a PR to implement it?
The text was updated successfully, but these errors were encountered:
I'd like to write a
ParseElem
implementation that returns references to the original input - something like:But unfortunately with the current
ParseElem
definition I don't think this is possible. Is there any reasonParseElem
doesn't have an explicit lifetime specifier (likeParseSlice
does)? And if not, would you accept a PR to implement it?The text was updated successfully, but these errors were encountered: