Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2512

Unordered sequences with initiated content or discriminators do not parse correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 3.2.0
    • Back End
    • None

    Description

      Parsing of unordered sequences uses the ChoiceParser to handle parsing the different alternatives. This causes issues because the SequenceParser that orchestrates the ChoiceParser needs to know why a ChoiceParser fails and react differently. If the ChoiceParser fails because all branches speculatively failed, then we need to simply ignore the failure and it signifies the end of the sequence. But if the ChoiceParser fails because a discriminated branch failed, then it signifies the unordered seuence failed, and the error must propogate upwards.

      This suggests that we cannot use the ChoiceParser when parsing an unordred sequence because we cannot know the reason for failure once it completes–all we know is it failed. Instead, the SequenceParser must create and manage points of uncertainty attempt to parse each branch of the unordered sequence individually, much like the ChoiceParser does. This way, it can know if a branch was discriminated and failed, or if all branches were tried and they all failed, and react appropriately.

      Attachments

        Activity

          People

            slawrence Steve Lawrence
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: