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
The generated parser code calls the len() method on the grammar input, but the Parse trait doesn't contain such a function. This limits the types that can be used as input for the parser. I can think of two ways to fix this:
Add a len() function to the Parse trait.
I believe there are only two places where len() is called on the input, and both are conditions in the form of __pos == __input.len(). So instead of adding a len() trait function, I suggest fn is_eof(&self, p: usize) -> bool, which can easily be implemented for any type that already has a len() method.
What do you think? I'd be happy to provide a pull request, if desired.
The text was updated successfully, but these errors were encountered:
The generated parser code calls the
len()
method on the grammar input, but theParse
trait doesn't contain such a function. This limits the types that can be used as input for the parser. I can think of two ways to fix this:len()
function to theParse
trait.len()
is called on the input, and both are conditions in the form of__pos == __input.len()
. So instead of adding alen()
trait function, I suggestfn is_eof(&self, p: usize) -> bool
, which can easily be implemented for any type that already has alen()
method.What do you think? I'd be happy to provide a pull request, if desired.
The text was updated successfully, but these errors were encountered: