use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegation in project xtext-core by eclipse.
the class RegionAccessTestLanguageSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == RegionaccesstestlanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case RegionaccesstestlanguagePackage.ACTION:
sequence_Fragment_Mixed(context, (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Action) semanticObject);
return;
case RegionaccesstestlanguagePackage.ADD:
sequence_Expression(context, (Add) semanticObject);
return;
case RegionaccesstestlanguagePackage.ASSIGNED_ACTION:
sequence_Mixed(context, (AssignedAction) semanticObject);
return;
case RegionaccesstestlanguagePackage.DELEGATE:
sequence_Delegate(context, (Delegate) semanticObject);
return;
case RegionaccesstestlanguagePackage.DELEGATION:
sequence_Delegation(context, (Delegation) semanticObject);
return;
case RegionaccesstestlanguagePackage.MIXED:
sequence_Mixed(context, (Mixed) semanticObject);
return;
case RegionaccesstestlanguagePackage.NAMED:
sequence_Primary(context, (Named) semanticObject);
return;
case RegionaccesstestlanguagePackage.PREFIXED_UNASSIGNED:
sequence_PrefixedUnassigned(context, (PrefixedUnassigned) semanticObject);
return;
case RegionaccesstestlanguagePackage.ROOT:
sequence_Root(context, (Root) semanticObject);
return;
case RegionaccesstestlanguagePackage.ROOT_ACTION:
sequence_Root(context, (RootAction) semanticObject);
return;
case RegionaccesstestlanguagePackage.SIMPLE:
sequence_Simple(context, (Simple) semanticObject);
return;
case RegionaccesstestlanguagePackage.VALUE_LIST:
sequence_ValueList(context, (ValueList) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegation in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testAssignedDelegate.
@Test
public void testAssignedDelegate() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("2 foo");
_builder.newLine();
String _trim = _builder.toString().trim();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("0 0 H");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B Delegation Root");
_builder_1.newLine();
_builder_1.append("0 1 S \"2\" Delegation:\'2\'");
_builder_1.newLine();
_builder_1.append("1 1 H \" \" Whitespace:TerminalRule\'WS\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B Delegate\'foo\' Delegation:delegate=Delegate path:Delegation/delegate");
_builder_1.newLine();
_builder_1.append("2 3 S \"foo\" Delegate:name=ID");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E Delegate\'foo\' Delegation:delegate=Delegate path:Delegation/delegate");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E Delegation Root");
_builder_1.newLine();
_builder_1.append("5 0 H");
_builder_1.newLine();
this.operator_tripleEquals(_trim, _builder_1);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegation in project xtext-core by eclipse.
the class RegionAccessDiffTest method testSerializeChildObject.
@Test
public void testSerializeChildObject() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("2 foo");
_builder.newLine();
final ITextRegionAccess access = this._regionAccessTestHelper.toTextRegionAccess(_builder);
final Procedure1<ITextRegionDiffBuilder> _function = (ITextRegionDiffBuilder it) -> {
EObject _semanticElement = access.regionForRootEObject().getSemanticElement();
final Delegate child = ((Delegation) _semanticElement).getDelegate();
final IEObjectRegion childRegion = access.regionForEObject(child);
child.setName("baaaz");
final ITextRegionAccess textRegions = this.serializer.serializeToRegions(child);
it.replace(childRegion.getPreviousHiddenRegion(), childRegion.getNextHiddenRegion(), textRegions);
};
ITextRegionAccess _modify = this._regionAccessTestHelper.modify(access, _function);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("0 0 H");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B Delegation Root");
_builder_1.newLine();
_builder_1.append("0 1 S \"2\" Delegation:\'2\'");
_builder_1.newLine();
_builder_1.append("1 1 1 H \" \" Whitespace:TerminalRule\'WS\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B Delegate\'baaaz\' Delegate path:Delegation/delegate");
_builder_1.newLine();
_builder_1.append("2 5 1 S \"baaaz\" Delegate:name=ID");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E Delegate\'baaaz\' Delegate path:Delegation/delegate");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E Delegation Root");
_builder_1.newLine();
_builder_1.append("7 0 1 H");
_builder_1.newLine();
_builder_1.append("------------ diff 1 ------------");
_builder_1.newLine();
_builder_1.append("1 1 H \" \" Whitespace:TerminalRule\'WS\'");
_builder_1.newLine();
_builder_1.append("2 3 S \"foo\" Delegate:name=ID");
_builder_1.newLine();
_builder_1.append("5 0 H");
_builder_1.newLine();
this._regionAccessTestHelper.operator_tripleEquals(_modify, _builder_1);
}
Aggregations