Search in sources :

Example 6 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testFragmentRecursionChild.

@Test
public void testFragmentRecursionChild() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("6 (fragment recursion child ())");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0 0 H");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("B Action     Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0 1  S \"6\"        Root:\'6\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2 1  S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 0  H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 8  S \"fragment\" Mixed:\'fragment\'");
    _builder_1.newLine();
    _builder_1.append("11 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("12 9  S \"recur...\" Fragment:\'recursion\'");
    _builder_1.newLine();
    _builder_1.append("21 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("22 5  S \"child\"    Fragment:\'child\'");
    _builder_1.newLine();
    _builder_1.append("27 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Action     Fragment:mixed=Mixed path:Action/mixed");
    _builder_1.newLine();
    _builder_1.append("28 1   S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append("29 0   H");
    _builder_1.newLine();
    _builder_1.append("29 1   S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Action     Fragment:mixed=Mixed path:Action/mixed");
    _builder_1.newLine();
    _builder_1.append("30 0  H");
    _builder_1.newLine();
    _builder_1.append("30 1  S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("E Action     Root");
    _builder_1.newLine();
    _builder_1.append("31 0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Example 7 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testRef.

@Test
public void testRef() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("6 (foo) action (ref foo) end");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0 0 H");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("B AssignedAction Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0 1  S \"6\"        Root:\'6\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Mixed\'foo\' Mixed:{AssignedAction.child=} path:AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2 1   S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 0   H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 3   S \"foo\"      Mixed:name=ID");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("6 0   H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("6 1   S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Mixed\'foo\' Mixed:{AssignedAction.child=} path:AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("7 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("8 6  S \"action\"   Mixed:\'action\'");
    _builder_1.newLine();
    _builder_1.append("14 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Mixed      Mixed:body=Mixed path:AssignedAction/body");
    _builder_1.newLine();
    _builder_1.append("15 1   S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append("16 0   H");
    _builder_1.newLine();
    _builder_1.append("16 3   S \"ref\"      Mixed:\'ref\'");
    _builder_1.newLine();
    _builder_1.append("19 1   H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("20 3   S \"foo\"      Mixed:ref=[Mixed|ID]");
    _builder_1.newLine();
    _builder_1.append("23 0   H");
    _builder_1.newLine();
    _builder_1.append("23 1   S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Mixed      Mixed:body=Mixed path:AssignedAction/body");
    _builder_1.newLine();
    _builder_1.append("24 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("25 3  S \"end\"      Mixed:\'end\'");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("E AssignedAction Root");
    _builder_1.newLine();
    _builder_1.append("28 0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Example 8 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testMixedRootAction.

@Test
public void testMixedRootAction() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("7 action (foo)");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0 0 H");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("B RootAction Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0 1  S \"7\"        Root:\'7\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2 6  S \"action\"   Root:\'action\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("8 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Mixed\'foo\' Root:mixed=Mixed path:RootAction/mixed");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("9 1   S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append("10 0   H");
    _builder_1.newLine();
    _builder_1.append("10 3   S \"foo\"      Mixed:name=ID");
    _builder_1.newLine();
    _builder_1.append("13 0   H");
    _builder_1.newLine();
    _builder_1.append("13 1   S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Mixed\'foo\' Root:mixed=Mixed path:RootAction/mixed");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("E RootAction Root");
    _builder_1.newLine();
    _builder_1.append("14 0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Example 9 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testAssignmentAction.

@Test
public void testAssignmentAction() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("6 (foo) action");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0 0 H");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("B AssignedAction Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0 1  S \"6\"        Root:\'6\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Mixed\'foo\' Mixed:{AssignedAction.child=} path:AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2 1   S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 0   H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 3   S \"foo\"      Mixed:name=ID");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("6 0   H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("6 1   S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Mixed\'foo\' Mixed:{AssignedAction.child=} path:AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("7 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("8 6  S \"action\"   Mixed:\'action\'");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("E AssignedAction Root");
    _builder_1.newLine();
    _builder_1.append("14 0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Example 10 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testAssignmentActionAction.

@Test
public void testAssignmentActionAction() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("6 (foo) action action");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0 0 H");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("B AssignedAction Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0 1  S \"6\"        Root:\'6\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B AssignedAction Mixed:{AssignedAction.child=} path:AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append("       ");
    _builder_1.append("B Mixed\'foo\' Mixed:{AssignedAction.child=} path:AssignedAction/child=AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2 1    S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 0    H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 3    S \"foo\"      Mixed:name=ID");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("6 0    H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("6 1    S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("       ");
    _builder_1.append("E Mixed\'foo\' Mixed:{AssignedAction.child=} path:AssignedAction/child=AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("7 1   H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("8 6   S \"action\"   Mixed:\'action\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E AssignedAction Mixed:{AssignedAction.child=} path:AssignedAction/child");
    _builder_1.newLine();
    _builder_1.append("14 1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("15 6  S \"action\"   Mixed:\'action\'");
    _builder_1.newLine();
    _builder_1.append("     ");
    _builder_1.append("E AssignedAction Root");
    _builder_1.newLine();
    _builder_1.append("21 0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)40 Test (org.junit.Test)40 TextRegionAccessToString (org.eclipse.xtext.formatting2.debug.TextRegionAccessToString)21 Mixed (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed)20 ISemanticRegionsFinder (org.eclipse.xtext.formatting2.regionaccess.ISemanticRegionsFinder)18 ISemanticRegion (org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion)16 AssignedAction (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.AssignedAction)6 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)5 EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 IEObjectRegion (org.eclipse.xtext.formatting2.regionaccess.IEObjectRegion)1 Add (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Add)1 Delegate (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegate)1 Delegation (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegation)1 Named (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Named)1 PrefixedUnassigned (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedUnassigned)1 Root (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root)1 RootAction (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.RootAction)1