|
|
|
@ -18,16 +18,20 @@ function maybeTrim(value) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseLocation(locationString) {
|
|
|
|
|
let match = positionRegex.exec(locationString);
|
|
|
|
|
|
|
|
|
|
if (match != null) {
|
|
|
|
|
return {
|
|
|
|
|
path: match[1],
|
|
|
|
|
line: parseInt(match[2]),
|
|
|
|
|
column: parseInt(match[3])
|
|
|
|
|
};
|
|
|
|
|
if (locationString === "<anonymous>") {
|
|
|
|
|
return { anonymous: true };
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(`Could not parse location from string: ${locationString}`);
|
|
|
|
|
let match = positionRegex.exec(locationString);
|
|
|
|
|
|
|
|
|
|
if (match != null) {
|
|
|
|
|
return {
|
|
|
|
|
path: match[1],
|
|
|
|
|
line: parseInt(match[2]),
|
|
|
|
|
column: parseInt(match[3])
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(`Could not parse location from string: ${locationString}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|