diff options
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/golang.js | 13 |
1 files changed, 11 insertions, 2 deletions
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); } |