aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>2019-03-04 17:48:28 +0100
committerCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>2019-03-04 18:15:33 +0100
commit9c781cacd60692af960d9734983346ecc9481a62 (patch)
tree416c2934f18a43b61c5694a1a6c175e0f121dc9b /src
parentcb94750aafc73f93a2b7056517cd94a30a5149d7 (diff)
downloadpurs-loader-9c781cacd60692af960d9734983346ecc9481a62.tar.gz
purs-loader-9c781cacd60692af960d9734983346ecc9481a62.tar.zst
purs-loader-9c781cacd60692af960d9734983346ecc9481a62.zip
Extract err locations from the format introduced in `purescript@0.12.2`
See https://github.com/purescript/purescript/pull/3473.
Diffstat (limited to 'src')
-rw-r--r--src/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js
index 8a2e468..28246e3 100644
--- a/src/index.js
+++ b/src/index.js
@@ -195,7 +195,7 @@ module.exports = function purescriptLoader(source, map) {
195 const matchErrorsSeparator = /\n(?=Error)/; 195 const matchErrorsSeparator = /\n(?=Error)/;
196 const errors = pscMessage.split(matchErrorsSeparator); 196 const errors = pscMessage.split(matchErrorsSeparator);
197 for (const error of errors) { 197 for (const error of errors) {
198 const matchErrLocation = /at (.+\.purs) line (\d+), column (\d+) - line (\d+), column (\d+)/; 198 const matchErrLocation = /at (.+\.purs):(\d+):(\d+) - (\d+):(\d+) \(line \2, column \3 - line \4, column \5\)/;
199 const [, filename] = matchErrLocation.exec(error) || []; 199 const [, filename] = matchErrLocation.exec(error) || [];
200 if (!filename) continue; 200 if (!filename) continue;
201 201