]> git.immae.eu Git - github/fretlink/purs-loader.git/commitdiff
Extract err locations from the format introduced in `purescript@0.12.2`
authorCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>
Mon, 4 Mar 2019 16:48:28 +0000 (17:48 +0100)
committerCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>
Mon, 4 Mar 2019 17:15:33 +0000 (18:15 +0100)
See https://github.com/purescript/purescript/pull/3473.

package.json
src/index.js

index f2b95af9254a546ce8966b272c848c5a28c76036..ae8d7eb94b7a38e067da340620e279f8c4a7dec4 100644 (file)
@@ -50,5 +50,8 @@
   "devDependencies": {
     "babel-cli": "^6.8.0",
     "babel-preset-es2015": "^6.6.0"
+  },
+  "peerDependencies": {
+    "purescript": ">=0.12.2"
   }
 }
index 8a2e468229d95b405bd740189044bc04fc16c1d9..28246e39d949d0eeb5b9d2e6a6aca3fd7a4bd7a2 100644 (file)
@@ -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;