mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-15 20:25:46 +02:00
Check for the occurenc of column.
This commit is contained in:
parent
60a60db5dd
commit
bcb903febb
1 changed files with 16 additions and 3 deletions
|
@ -13,7 +13,7 @@ import org.eclipse.core.resources.IFile;
|
||||||
public class GCCErrorParser implements IErrorParser {
|
public class GCCErrorParser implements IErrorParser {
|
||||||
|
|
||||||
public boolean processLine(String line, ErrorParserManager eoParser) {
|
public boolean processLine(String line, ErrorParserManager eoParser) {
|
||||||
// gcc: "filename:linenumber: error_desc"
|
// gcc: "filename:linenumber:column: error_desc"
|
||||||
int firstColon = line.indexOf(':');
|
int firstColon = line.indexOf(':');
|
||||||
|
|
||||||
/* Guard against drive in Windows platform. */
|
/* Guard against drive in Windows platform. */
|
||||||
|
@ -41,14 +41,15 @@ public class GCCErrorParser implements IErrorParser {
|
||||||
String varName = null;
|
String varName = null;
|
||||||
String desc = line.substring(secondColon + 1).trim();
|
String desc = line.substring(secondColon + 1).trim();
|
||||||
int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
|
int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
|
||||||
int num = 0;
|
int num = -1;
|
||||||
|
int col = -1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
num = Integer.parseInt(lineNumber);
|
num = Integer.parseInt(lineNumber);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num == 0) {
|
if (num == -1) {
|
||||||
// Maybe a bad option error or cc1(plus) error
|
// Maybe a bad option error or cc1(plus) error
|
||||||
if (fileName.startsWith("cc") || fileName.startsWith("gcc")
|
if (fileName.startsWith("cc") || fileName.startsWith("gcc")
|
||||||
|| fileName.startsWith("qcc") || fileName.startsWith("QCC")) {
|
|| fileName.startsWith("qcc") || fileName.startsWith("QCC")) {
|
||||||
|
@ -59,6 +60,18 @@ public class GCCErrorParser implements IErrorParser {
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* Then check for the column */
|
||||||
|
int thirdColon= line.indexOf(':', secondColon + 1);
|
||||||
|
if (thirdColon != -1) {
|
||||||
|
try {
|
||||||
|
col = Integer.parseInt(lineNumber);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (col != -1) {
|
||||||
|
desc = line.substring(thirdColon + 1).trim();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// gnu c: filename:no: (Each undeclared identifier is reported
|
// gnu c: filename:no: (Each undeclared identifier is reported
|
||||||
|
|
Loading…
Add table
Reference in a new issue