use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testExpression1.
@Test
public void testExpression1() throws Exception {
String model = "5 a + b\n".trim();
String expectation = "0 0 H\n" + " B Add Root\n" + "0 1 S \"5\" Root:'5'\n" + "1 1 H \" \" Whitespace:TerminalRule'WS'\n" + " B Named'a' Expression:{Add.left=} path:Add/left\n" + "2 1 S \"a\" Primary:name=ID\n" + " E Named'a' Expression:{Add.left=} path:Add/left\n" + "3 1 H \" \" Whitespace:TerminalRule'WS'\n" + "4 1 S \"+\" Expression:'+'\n" + "5 1 H \" \" Whitespace:TerminalRule'WS'\n" + " B Named'b' Expression:right=Primary path:Add/right\n" + "6 1 S \"b\" Primary:name=ID\n" + " E Named'b' Expression:right=Primary path:Add/right\n" + " E Add Root\n" + "7 0 H\n";
assertRegions(model, expectation);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testMixedUnassignedDatatype2.
@Test
public void testMixedUnassignedDatatype2() throws Exception {
String model = "6 (unassigned datatype datatype foo)\n".trim();
String expectation = " 0 0 H\n" + " B Action Root\n" + " 0 1 S \"6\" Root:'6'\n" + " 1 1 H \" \" Whitespace:TerminalRule'WS'\n" + " 2 1 S \"(\" Mixed:'('\n" + " 3 0 H\n" + " 3 10 S \"unass...\" Mixed:'unassigned'\n" + "13 1 H \" \" Whitespace:TerminalRule'WS'\n" + "14 21 S \"datat...\" Mixed:Datatype\n" + "35 0 H\n" + "35 1 S \")\" Mixed:')'\n" + " E Action Root\n" + "36 0 H\n";
assertRegions(model, expectation);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testMixedUnassignedTerminal.
@Test
public void testMixedUnassignedTerminal() throws Exception {
String model = "6 (unassigned foo)\n".trim();
String expectation = " 0 0 H\n" + " B Action Root\n" + " 0 1 S \"6\" Root:'6'\n" + " 1 1 H \" \" Whitespace:TerminalRule'WS'\n" + " 2 1 S \"(\" Mixed:'('\n" + " 3 0 H\n" + " 3 10 S \"unass...\" Mixed:'unassigned'\n" + "13 1 H \" \" Whitespace:TerminalRule'WS'\n" + "14 3 S \"foo\" Mixed:ID\n" + "17 0 H\n" + "17 1 S \")\" Mixed:')'\n" + " E Action Root\n" + "18 0 H\n";
assertRegions(model, expectation);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testRef.
@Test
public void testRef() throws Exception {
String model = "6 (foo) action (ref foo) end\n".trim();
String expectation = " 0 0 H\n" + " B AssignedAction Root\n" + " 0 1 S \"6\" Root:'6'\n" + " 1 1 H \" \" Whitespace:TerminalRule'WS'\n" + " B Mixed'foo' Mixed:{AssignedAction.child=} path:AssignedAction/child\n" + " 2 1 S \"(\" Mixed:'('\n" + " 3 0 H\n" + " 3 3 S \"foo\" Mixed:name=ID\n" + " 6 0 H\n" + " 6 1 S \")\" Mixed:')'\n" + " E Mixed'foo' Mixed:{AssignedAction.child=} path:AssignedAction/child\n" + " 7 1 H \" \" Whitespace:TerminalRule'WS'\n" + " 8 6 S \"action\" Mixed:'action'\n" + "14 1 H \" \" Whitespace:TerminalRule'WS'\n" + " B Mixed Mixed:body=Mixed path:AssignedAction/body\n" + "15 1 S \"(\" Mixed:'('\n" + "16 0 H\n" + "16 3 S \"ref\" Mixed:'ref'\n" + "19 1 H \" \" Whitespace:TerminalRule'WS'\n" + "20 3 S \"foo\" Mixed:ref=[Mixed|ID]\n" + "23 0 H\n" + "23 1 S \")\" Mixed:')'\n" + " E Mixed Mixed:body=Mixed path:AssignedAction/body\n" + "24 1 H \" \" Whitespace:TerminalRule'WS'\n" + "25 3 S \"end\" Mixed:'end'\n" + " E AssignedAction Root\n" + "28 0 H\n";
assertRegions(model, expectation);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testSimple.
@Test
public void testSimple() throws Exception {
String model = "1 foo\n".trim();
String expectation = "0 0 H\n" + " B Simple'foo' Root\n" + "0 1 S \"1\" Simple:'1'\n" + "1 1 H \" \" Whitespace:TerminalRule'WS'\n" + "2 3 S \"foo\" Simple:name=ID\n" + " E Simple'foo' Root\n" + "5 0 H\n";
assertRegions(model, expectation);
}
Aggregations