Skip to content

Clarification for CaseStmt and DefaultStmt #4

Description

@Holt59

Me, again....

The specification+ for the SelectOne / SelectMany + Case / Default is not clear for me.

Is each Case / Default followed by exactly one Break? For instance, is this valid (like in many language):

SelectOne ...

Case A
Case B
Break
  • If it is valid, what is the expected behavior? In particular for SelectMany? Case A implies A + B?

  • If it is not valid, then I think it would be a good idea to explicitly add the 'Break' in the grammar in the selectCaseList rule.

Also, is Default allowed to not be the last case? And is Default allowed in SelectMany, in which case, is it run when nothing is selected?

Edit: Well, actually, what is the purpose of Default? I assume with SelectOne, the user has to select an option, so no default, and for SelectMany... If none of the option was selected?

None of the test wizards in tests/ have Default and all uses a Break after Case, so having this kind of rule:

selectCaseList: (caseStmt 'Break')* (defaultStmt 'Break')?;

Would be very nice to write an interpreter :D


+ I am assuming this is the official specification : https://wrye-bash.github.io/docs/Wrye%20Bash%20Technical%20Readme.html, let me know if it's not !

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