From 9c781cacd60692af960d9734983346ecc9481a62 Mon Sep 17 00:00:00 2001 From: Cyril Sobierajewicz Date: Mon, 4 Mar 2019 17:48:28 +0100 Subject: Extract err locations from the format introduced in `purescript@0.12.2` See https://github.com/purescript/purescript/pull/3473. --- package.json | 3 +++ src/index.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f2b95af..ae8d7eb 100644 --- a/package.json +++ b/package.json @@ -50,5 +50,8 @@ "devDependencies": { "babel-cli": "^6.8.0", "babel-preset-es2015": "^6.6.0" + }, + "peerDependencies": { + "purescript": ">=0.12.2" } } 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) { const matchErrorsSeparator = /\n(?=Error)/; const errors = pscMessage.split(matchErrorsSeparator); for (const error of errors) { - const matchErrLocation = /at (.+\.purs) line (\d+), column (\d+) - line (\d+), column (\d+)/; + const matchErrLocation = /at (.+\.purs):(\d+):(\d+) - (\d+):(\d+) \(line \2, column \3 - line \4, column \5\)/; const [, filename] = matchErrLocation.exec(error) || []; if (!filename) continue; -- cgit v1.2.3