From 2fb8e8db85867a1ba520af189827a61da1646eb3 Mon Sep 17 00:00:00 2001 From: Partouf Date: Thu, 1 Nov 2018 03:23:13 +0100 Subject: golang: extract logging from asm stdout --- lib/compilers/golang.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/compilers/golang.js') diff --git a/lib/compilers/golang.js b/lib/compilers/golang.js index 94e838ef5..ca47d316f 100644 --- a/lib/compilers/golang.js +++ b/lib/compilers/golang.js @@ -23,7 +23,8 @@ // POSSIBILITY OF SUCH DAMAGE. const BaseCompiler = require('../base-compiler'), - _ = require('underscore'); + _ = require('underscore'), + utils = require('../utils'); class GolangCompiler extends BaseCompiler { convertNewGoL(code) { @@ -59,9 +60,17 @@ class GolangCompiler extends BaseCompiler { })).join("\n"); } + extractLogging(stdout) { + const reLogging = /^\/(.*):([0-9]*):([0-9]*):\s(.*)/i; + return stdout.filter(obj => obj.text.match(reLogging)). + map(obj => obj.text). + join('\n'); + } + postProcess(result) { + const logging = this.extractLogging(result.stdout); result.asm = this.convertNewGoL(result.stdout); - result.stdout = []; + result.stdout = utils.parseOutput(logging, result.inputFilename); return Promise.resolve(result); } -- cgit v1.2.3