-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URI Parse: IndexError: list index out of range #31
Comments
You've hit an interesting case of nested empty parses. See unit test in the commit. There was a subtle bug triggered if nothing is matched in nested parses consisting of The Get the current def authority():
return Optional(userinfo, '@'), host, Optional(':', port), EOF |
I want to implement the full grammar of several RFCs so it's not possible to append EOF to authority. I also wondered how authority [1], host [2] and reg-name [3] are defined. Anyway, glad to see it's solved in the current master. Kind regards! [1] https://tools.ietf.org/html/rfc3986#section-3.2 |
Ah, right. def grammar(): return URI, EOF
def URI(): return .... Now, your real RFC grammar starts from |
I'm trying to implement (pastebin LhSuFXhL) the URI grammar (RFC 3986) but I get an IndexError exception whether I code the host rule as indicated in the RFC.
As far as I know it could be solved whether I introduce the following changes in the grammar but I would like to be as accurate as possible.
The text was updated successfully, but these errors were encountered: