use of org.eclipse.xtend.core.tests.compiler.RootTraceRegionForTesting in project xtext-xtend by eclipse.
the class CompilerTraceTest method merge.
public AbstractTraceRegion merge(final List<AbstractTraceRegion> regions) {
boolean _isEmpty = regions.isEmpty();
boolean _not = (!_isEmpty);
Assert.assertTrue(_not);
int _size = regions.size();
boolean _greaterThan = (_size > 1);
if (_greaterThan) {
ITextRegionWithLineInformation rootLocation = ITextRegionWithLineInformation.EMPTY_REGION;
ITextRegionWithLineInformation associated = ITextRegionWithLineInformation.EMPTY_REGION;
for (final AbstractTraceRegion child : regions) {
{
int _myOffset = child.getMyOffset();
int _myLength = child.getMyLength();
int _myLineNumber = child.getMyLineNumber();
int _myEndLineNumber = child.getMyEndLineNumber();
TextRegionWithLineInformation _textRegionWithLineInformation = new TextRegionWithLineInformation(_myOffset, _myLength, _myLineNumber, _myEndLineNumber);
rootLocation = rootLocation.merge(_textRegionWithLineInformation);
ILocationData childAssociation = child.getMergedAssociatedLocation();
if ((childAssociation != null)) {
associated = associated.merge(childAssociation);
}
}
}
final RootTraceRegionForTesting root = new RootTraceRegionForTesting(rootLocation, associated);
for (final AbstractTraceRegion child_1 : regions) {
child_1.setParent(root);
}
return root;
} else {
return IterableExtensions.<AbstractTraceRegion>head(regions);
}
}
Aggregations