use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForRuleCallToCrossReference.
@Test
public void regionForRuleCallToCrossReference() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (ref foo) action (foo) end");
final AssignedAction mixed = this.<AssignedAction>parseAs(_builder, AssignedAction.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed.getChild()).getRegionFor();
final ISemanticRegion actual = finder.ruleCallTo(this._regionAccessTestLanguageGrammarAccess.getIDRule());
final List<ISemanticRegion> actuals = finder.ruleCallsTo(this._regionAccessTestLanguageGrammarAccess.getIDRule());
this.assertEquals("foo", actual, actuals);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForRuleCallToEObjectParserRule.
@Test
public void regionForRuleCallToEObjectParserRule() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (child (foo))");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
try {
finder.ruleCallTo(this._regionAccessTestLanguageGrammarAccess.getMixedRule());
Assert.fail();
} catch (final Throwable _t) {
if (_t instanceof IllegalStateException) {
} else {
throw Exceptions.sneakyThrow(_t);
}
}
try {
finder.ruleCallsTo(this._regionAccessTestLanguageGrammarAccess.getMixedRule());
Assert.fail();
} catch (final Throwable _t_1) {
if (_t_1 instanceof IllegalStateException) {
} else {
throw Exceptions.sneakyThrow(_t_1);
}
}
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForFeatureContainmentReference.
@Test
public void regionForFeatureContainmentReference() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (foo) action");
final AssignedAction mixed = this.<AssignedAction>parseAs(_builder, AssignedAction.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
try {
finder.feature(RegionaccesstestlanguagePackage.Literals.ASSIGNED_ACTION__CHILD);
Assert.fail();
} catch (final Throwable _t) {
if (_t instanceof IllegalStateException) {
} else {
throw Exceptions.sneakyThrow(_t);
}
}
try {
finder.features(RegionaccesstestlanguagePackage.Literals.ASSIGNED_ACTION__CHILD);
Assert.fail();
} catch (final Throwable _t_1) {
if (_t_1 instanceof IllegalStateException) {
} else {
throw Exceptions.sneakyThrow(_t_1);
}
}
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForRuleCallUnassignedTerminal.
@Test
public void regionForRuleCallUnassignedTerminal() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (unassigned foo)");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
final ISemanticRegion actual = finder.ruleCall(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getIDTerminalRuleCall_1_1_0());
final List<ISemanticRegion> actuals = finder.ruleCalls(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getIDTerminalRuleCall_1_1_0());
this.assertEquals("foo", actual, actuals);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForRuleCallEObjectParserRule.
@Test
public void regionForRuleCallEObjectParserRule() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (child (foo))");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
try {
finder.ruleCall(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getEobjMixedParserRuleCall_2_2_1_1_0());
Assert.fail();
} catch (final Throwable _t) {
if (_t instanceof IllegalStateException) {
} else {
throw Exceptions.sneakyThrow(_t);
}
}
try {
finder.ruleCalls(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getEobjMixedParserRuleCall_2_2_1_1_0());
Assert.fail();
} catch (final Throwable _t_1) {
if (_t_1 instanceof IllegalStateException) {
} else {
throw Exceptions.sneakyThrow(_t_1);
}
}
}
Aggregations