DeeParserResult result = parseUsingRule(deeParser);
if(result == null)
return;
String parsedSource = checkParsedSource(expectedRemainingSource, deeParser);
ASTNode mainNode = result.node; // a null result may make sense in some tests
if(mainNode != null) {
checkBasicStructureContracts(mainNode);
}
checkExpectedStructure(mainNode, expectedStructure);
if(expectedErrors != null) {
checkParserErrors(result.getErrors(), expectedErrors);
}
if(expectedPrintedSource != null) {
assertTrue(result.errors.size() == 0 ? parsedSource.equals(expectedPrintedSource) : true);
String nodePrintedSource = mainNode == null ? "" : mainNode.toStringAsCode();
SourceEquivalenceChecker.assertCheck(nodePrintedSource, expectedPrintedSource);
}
// Check consistency of source ranges (no overlapping ranges)
if(mainNode != null) {