-
Notifications
You must be signed in to change notification settings - Fork 20
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
incomplete parsing when weekday is defined twice #28
Comments
I created a failing test case here: francois2metz@9f726b1 |
Thank you for your report! It seems quite complicated to fix... I'll take a look in the code ASAP, but I'm not sure it's currently possible to fix this without rewriting a consequent part of the parsing logic (something that I'd like to do, but I currently don't have time). |
I looked at the code and managed to fix the problem, while breaking all other features ;) I don't know if it's feasible to merge some rules when they have the same priority in the function |
Of course, it would be great, but it must be quite difficult to check compatibility of rules before merging. Theoretically, only rules separated by commas should be merged, and rules separated by semicolons should be mutually exclusive. It may be possible to make a patch, but I think a clear handling of that would require an important rewrite of the parsing logic. The grammar specifications are so complicated... Currently, the main reason the commas are supported is that they're massively wrongly used. They should be used only to merge opening hours of many days spanning over midnight, and many field use them as semicolons. Actually, the parser considers commas as synonyms of semicolons for this reason, because opening hours spanning over midnight are already supported with semicolons (because the parser does not care of the separator). Also, I think this problem is related with another: when a specific period in a day is defined as closed, the whole day is considered as closed. For example, with |
The opening_hours of this place are:
Mo-Fr 11:30-15:00, We-Mo 18:00-23:00
The plain text description goes like this:
whereas the expected is:
The text was updated successfully, but these errors were encountered: