r.setLine(r.getLine() + lineOffset);
r.setEndLine(r.getEndLine() + lineOffset);
}
if (apiFormat) {
final RuleAsXmlSerializer serializer = new RuleAsXmlSerializer();
final String xml = serializer.ruleMatchesToXml(ruleMatches, contents,
contextSize, lt.getLanguage());
final PrintStream out = new PrintStream(System.out, true, "UTF-8");
out.print(xml);
} else {
printMatches(ruleMatches, prevMatches, contents, contextSize);