use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Expression in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForKeywordPairs2.
@Test
public void regionForKeywordPairs2() {
@Extension final RegionAccessTestLanguageGrammarAccess.ParenthesizedElements rule = this._regionAccessTestLanguageGrammarAccess.getParenthesizedAccess();
StringConcatenation _builder = new StringConcatenation();
_builder.append("5 (a + ((b) + c) + d)");
final Expression expr = this.<Expression>parseAs(_builder, Expression.class);
final ISemanticRegionsFinder finder = this.toAccess(expr).regionForRootEObject().getAllRegionsFor();
final String actual1 = this.pairsToString(finder.keywordPairs("(", ")"));
final String actual2 = this.pairsToString(finder.keywordPairs(rule.getLeftParenthesisKeyword_0(), rule.getRightParenthesisKeyword_2()));
final String expected = "(b); ((b) + c); (a + ((b) + c) + d)";
Assert.assertEquals(expected, actual1);
Assert.assertEquals(expected, actual2);
}
Aggregations