aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/clean.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compilers/clean.js')
-rw-r--r--lib/compilers/clean.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/compilers/clean.js b/lib/compilers/clean.js
index e9f724954..704a55444 100644
--- a/lib/compilers/clean.js
+++ b/lib/compilers/clean.js
@@ -38,38 +38,38 @@ class CleanCompiler extends BaseCompiler {
}
getOutputFilename(dirPath) {
- return path.join(dirPath, "Clean System Files/example.s");
+ return path.join(dirPath, 'Clean System Files/example.s');
}
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;
+ 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 => {
let matches = line.match(errorRegex);
if (!matches) matches = line.match(typeeerrorRegex);
if (matches) {
- return "<source>:" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3];
+ return '<source>:' + matches[1] + ',0: error: (' + matches[2] + ') ' + matches[3];
}
matches = line.match(errorLineRegex);
if (matches) {
- return "<source>:" + matches[1] + ",0: error: " + matches[2];
+ return '<source>:' + matches[1] + ',0: error: ' + matches[2];
}
matches = line.match(parseerrorRegex);
if (matches) {
- if (matches[3] === "") {
- return "<source>:" + matches[1] + "," + matches[2] + ": error: " + matches[4];
+ if (matches[3] === '') {
+ return '<source>:' + matches[1] + ',' + matches[2] + ': error: ' + matches[4];
} else {
- return "<source>:" + matches[1] + "," + matches[2] + ": error: (" + matches[3] + ") " + matches[4];
+ return '<source>:' + matches[1] + ',' + matches[2] + ': error: (' + matches[3] + ') ' + matches[4];
}
}
return line;
- }).join("\n");
+ }).join('\n');
}
async runCompiler(compiler, options, inputFilename, execOptions) {
@@ -78,7 +78,7 @@ class CleanCompiler extends BaseCompiler {
const compilerPath = path.dirname(compiler);
execOptions = this.getDefaultExecOptions();
execOptions.customCwd = tmpDir;
- execOptions.env.CLEANLIB = path.join(compilerPath, "../exe");
+ execOptions.env.CLEANLIB = path.join(compilerPath, '../exe');
execOptions.env.CLEANPATH = this.compiler.libPath;
options.pop();
options.push(moduleName);
@@ -88,8 +88,8 @@ class CleanCompiler extends BaseCompiler {
result.stdout = utils.parseOutput(this.preprocessOutput(result.stdout), inputFilename);
result.stderr = utils.parseOutput(this.preprocessOutput(result.stderr), inputFilename);
- if (!options.includes("-S")) {
- const aOut = path.join(tmpDir, "a.out");
+ if (!options.includes('-S')) {
+ const aOut = path.join(tmpDir, 'a.out');
if (await fs.pathExists(aOut)) {
await fs.copyFile(aOut, this.getOutputFilename(tmpDir));
result.code = 0;