protected void markParseErrors(List<DroolsBuildMarker> markers,
List<DroolsError> parserErrors) {
for ( Iterator<DroolsError> iter = parserErrors.iterator(); iter.hasNext(); ) {
Object error = iter.next();
if ( error instanceof ParserError ) {
ParserError err = (ParserError) error;
markers.add( new DroolsBuildMarker( err.getMessage(),
err.getRow() ) );
} else if ( error instanceof KnowledgeBuilderResult ) {
KnowledgeBuilderResult res = (KnowledgeBuilderResult) error;
int[] errorLines = res.getLines();
markers.add( new DroolsBuildMarker( res.getMessage(),
errorLines != null && errorLines.length > 0 ? errorLines[0] : -1 ) );