Skip to content
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

infinite loop on SUNDAY 2.30 #4

Open
bethard opened this issue Sep 26, 2014 · 0 comments
Open

infinite loop on SUNDAY 2.30 #4

bethard opened this issue Sep 26, 2014 · 0 comments

Comments

@bethard
Copy link
Collaborator

bethard commented Sep 26, 2014

The code goes into an infinite loop when trying to parse "SUNDAY 2.30".

The problem is that this is getting parsed as:

FindLater(Present,Map(DayOfWeek -> 7, MonthOfYear -> 2, DayOfMonth -> 30))

That is, Sunday, the 30th of February. It then goes into an infinite loop trying to search for an impossible day. You can get a failure instead of an infinite loop by deleting this line from the grammar:

[Nil] ||| . ||| ||| 1.0

Avoiding this infinite loop would require somehow recognizing that the field values MonthOfYear -> 2 and DayOfMonth -> 30 cannot be combined. I'm not sure how to detect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant