Skip to content

infinite loop on SUNDAY 2.30 #4

@bethard

Description

@bethard

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions