From 74920dfe7a8cc8404b601f4da4dafc634858e879 Mon Sep 17 00:00:00 2001 From: charliva Date: Fri, 8 Feb 2019 18:24:39 +0100 Subject: [PATCH] Fix issue #307, improve regular expression to parse error messages from YOSIS --- app/scripts/services/tools.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/scripts/services/tools.js b/app/scripts/services/tools.js index a54fb3b3f..cd1b9ac90 100644 --- a/app/scripts/services/tools.js +++ b/app/scripts/services/tools.js @@ -469,14 +469,13 @@ angular.module('icestudio') // - Yosys syntax errors // - main.v:31: ERROR: #... - re = /\smain\.v:([0-9]+):\s(.*?)(ERROR):\s(.*?), (.*?)[\r|\n]/g; + re = /\smain\.v:([0-9]+):\s(.*?)(ERROR):\s(.*?)[\r|\n]/g; while (matchError = re.exec(stdout)) { var msg = ''; var line = parseInt(matchError[1]); var type = matchError[3].toLowerCase(); - var preContent = matchError[5]; - var postContent = matchError[4]; + var preContent = matchError[4]; // If the error is about an unexpected token, the error is not // deterministic, therefore we indicate that "the error @@ -484,7 +483,7 @@ angular.module('icestudio') if (preContent.indexOf('unexpected TOK_')>=0) { msg = 'Syntax error arround this line'; }else{ - msg = preContent+': '+postContent; + msg = preContent; } codeErrors.push( { line: line,