Skip to content

Commit 32c6f3c

Browse files
committed
Improve parse output
1 parent 03f255d commit 32c6f3c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/duy/ccppcompiler/compiler/shell/OutputParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838

3939
public class OutputParser {
4040
private static final Pattern FILE_LINE_COL_TYPE_MESSAGE_PATTERN
41-
= Pattern.compile("(\\S+):([0-9]+):([0-9]+):(\\s+.*:\\s+)(.*)");
41+
= Pattern.compile("^(\\S+):([0-9]+):([0-9]+):(\\s+.*:\\s+)(.*)");
4242
private static final Pattern FILE_LINE_COL_MESSAGE_PATTERN
43-
= Pattern.compile("(\\S+):([0-9]+):([0-9]+)(.*)");
43+
= Pattern.compile("^(\\S+):([0-9]+):([0-9]+)(.*)");
4444
private static final Pattern FILE_LINE_MESSAGE_PATTERN
45-
= Pattern.compile("(\\S+):([0-9]+):(.*)");
45+
= Pattern.compile("^(\\S+):([0-9]+):(.*)");
4646

4747
private DiagnosticsCollector diagnosticsCollector;
4848

editor-view/src/main/java/com/duy/ide/DiagnosticPresenter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private boolean isSystemFile(File file) {
165165
try {
166166
//data dir
167167
File systemDir = mActivity.getFilesDir().getParentFile();
168-
return systemDir.getCanonicalPath().startsWith(file.getCanonicalPath());
168+
return file.getCanonicalPath().startsWith(systemDir.getCanonicalPath());
169169
} catch (IOException e) {
170170
e.printStackTrace();
171171
return false;

0 commit comments

Comments
 (0)