aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/clean.js
diff options
context:
space:
mode:
authorPartouf <partouf@gmail.com>2018-10-14 01:55:22 +0200
committerPartouf <partouf@gmail.com>2018-10-14 01:55:22 +0200
commit349d414d865ac12f8bdf7c61b82015d481a0af4f (patch)
treef0a1e0e31e7059ff6325defe4f7c71ce4fc08c69 /lib/compilers/clean.js
parentfe39bdab7033255fbac1e63c721819ef46b631ed (diff)
downloadcompiler-explorer-349d414d865ac12f8bdf7c61b82015d481a0af4f.tar.gz
compiler-explorer-349d414d865ac12f8bdf7c61b82015d481a0af4f.zip
detect more type of errors
Diffstat (limited to 'lib/compilers/clean.js')
-rw-r--r--lib/compilers/clean.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/compilers/clean.js b/lib/compilers/clean.js
index 93df211f3..30456963d 100644
--- a/lib/compilers/clean.js
+++ b/lib/compilers/clean.js
@@ -43,6 +43,7 @@ class CleanCompiler extends BaseCompiler {
preprocessOutput(output) {
const errorRegex = /^Error \[.*,(\d*),(.*)\]:\s(.*)/i;
+ const errorLineRegex = /^Error \[.*,(\d*)\]:\s(.*)/i;
const parseerrorRegex = /^Parse error \[.*,(\d*);(\d*),(.*)\]:\s(.*)/i;
const typeeerrorRegex = /^Type error \[.*,(\d*),(.*)\]:\s(.*)/i;
return utils.splitLines(output).map(line => {
@@ -50,15 +51,20 @@ class CleanCompiler extends BaseCompiler {
if (matches) {
return "<source>:" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3];
} else {
- matches = line.match(parseerrorRegex);
+ matches = line.match(errorLineRegex);
if (matches) {
- return "<source>:" + matches[1] + "," + matches[2] + ": error: (" + matches[3] + ") " + matches[3];
+ return "<source>:" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3];
} else {
- matches = line.match(typeeerrorRegex);
+ matches = line.match(parseerrorRegex);
if (matches) {
- return "<source>:" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3];
+ return "<source>:" + matches[1] + "," + matches[2] + ": error: (" + matches[3] + ") " + matches[3];
} else {
- return line;
+ matches = line.match(typeeerrorRegex);
+ if (matches) {
+ return "<source>:" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3];
+ } else {
+ return line;
+ }
}
}
}