| Summary: | [xbase] Allow fall-through in switch expression | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sebastian Zarnekow <sebastian.zarnekow> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | anton, jan, st.oehme, sven.efftinge |
| Version: | 2.4.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | v2.6 | ||
| Bug Depends on: | |||
| Bug Blocks: | 400096 | ||
|
Description
Sebastian Zarnekow
The idea is to allow to write something like this:
switch foo : someExpression {
MyType case foo.someOp()
OtherType case foo.other : someOtherExpression;
}
Where someOtherExpression is evaluated when either foo matches
MyType case foo.someOp()
or
OtherType case foo.other
We need some separator other than colon ':' as it'd cause ambiguities: // without separator B case A: foo; // same as // B case A: foo; // which is AND and not the expected OR // with colon as separator A case b: C case d: foo; // same as // A case b: C; // case d: foo; I propose to use comma ',' to separate the guards. pushed to review: https://git.eclipse.org/r/#/c/21517/ |