diff options
author | Partouf <partouf@gmail.com> | 2018-11-01 03:23:13 +0100 |
---|---|---|
committer | Partouf <partouf@gmail.com> | 2018-11-01 03:23:13 +0100 |
commit | 2fb8e8db85867a1ba520af189827a61da1646eb3 (patch) | |
tree | c74a5f8c18e3b9cfc7002c95eb89a5452e996e77 /lib/compilers | |
parent | 75b55389cc1007f16e4fb4f99a26ff6925eec519 (diff) | |
download | compiler-explorer-2fb8e8db85867a1ba520af189827a61da1646eb3.tar.gz compiler-explorer-2fb8e8db85867a1ba520af189827a61da1646eb3.zip |
golang: extract logging from asm stdout
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); } |