| Summary: | [ConcreteSyntaxValidator] False Positive | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Moritz Eysholdt <moritz.eysholdt> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | christian.dietrich.opensource |
| Version: | 1.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
| Bug Depends on: | 333986, 333976 | ||
| Bug Blocks: | |||
|
Description
Moritz Eysholdt
as of bug 333976, this use case will be handled by the sequencer and render this report obsolete. The new serializer still invokes the ConcreteSyntaxValdiator (1) because the new serializer still uses local backtracking and there are cases where the ConcreteSyntaxValidator's error messages are more precise then the serialier's. 1: org.eclipse.xtext.serializer.impl.Serializer.serialize(EObject, ITokenStream, SaveOptions) we are affected by this bug
Here is our pretty simple grammar
Model:
things+=Thing*
aktionen+=ThingPruefung*;
Thing:
"thing" name=ID;
ThingPruefung:
{ThingPruefung} "pruefe" "thing" meldung=[Thing] (("vorhanden" "=" ((vorhanden?="ja") | "nein")) |
"=" thingText=TestdatenAusdruck);
TestdatenAusdruck:
STRING;
And Test
@RunWith(XtextRunner)
@InjectWith(MyDslInjectorProvider)
class BugTest {
@Inject extension ParseHelper<Model>
@Test
def void testIt() {
val model = '''
thing a
thing b
pruefe thing a vorhanden = nein
'''.parse
val r = model.eResource
println(r.errors)
val s = new ByteArrayOutputStream
try {
r.save(s, null)
println(new String(s.toByteArray))
} catch (Exception e) {
e.printStackTrace
}
}
}
Workaround: Change the grammar to 3 ors
won't fix because of https://github.com/eclipse/xtext-core/issues/48 |