-
Notifications
You must be signed in to change notification settings - Fork 24
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
UnionMatcher doesn't add possible matches when throwing on ambiguity #3
Comments
Hugo how is the error message in the brand new Parsley v0.9.0 -- not great On Thu, May 31, 2012 at 6:31 PM, Hugo Duncan <
Professional: http://cgrand.net/ (fr) |
Looks like I get:
(def ambiguous-parser
(parser
:expr #{#"Abc" #"Ade"}))
(clojure.pprint/pprint (ambiguous-parser "A")) Edit: Not sure what I was testing above... |
0.9.0 reports the matcher functions that give ambiguous matches - is this what you intended? I was expecting to see something like |
I reverted my modification and push a 0.9.1 out of the door (I should never commit in a hurry, even if I have to get off the train :-)) I don't know how to make the message more informative without more widespread changes: a successful matcher returns: the number of characters matched and the (usually) numerical id of the original matcher which are not that helpful when you have two conflicting regexes. Am I overlooking something there? |
When the UnionMatcher throws due to ambiguous match, the possible matches are not added to the exception, which makes it harder than necessary to debug parsers for this case.
The text was updated successfully, but these errors were encountered: