simonpoole / OpeningHoursParser

Parser for string values according to the OSM opening hours specification
MIT License
32 stars 12 forks source link

Improved time parsing #54

Closed simonpoole closed 3 years ago

simonpoole commented 3 years ago

This addresses https://github.com/simonpoole/OpeningHoursParser/issues/50

The changes seem to have no real negative effect out side of being substantially more tolerant of whitespace in the time specifications and one clear regression parsing 24.7 as hours:minutes which needs to be addressed.

Tests are currently expected to fail because of the differences.

diff.txt diff-strict.txt

Format: original result - new result - input string As the tests typically generated a parse exception before, the original result is typically a "1".

simonpoole commented 3 years ago

https://github.com/simonpoole/OpeningHoursParser/pull/54/commits/083f7c8d35dec9c1fed63d3aa5e1b23c53c07398 reduces the differences in strict mode to 103:

diff-strict.txt