Skip to content

Commit 3fc12ef

Browse files
committed
Merge pull request #703 from sethkinast/peg-0.9
Upgrade to peg.js 0.9
2 parents c1d9e21 + 2310047 commit 3fc12ef

File tree

5 files changed

+678
-654
lines changed

5 files changed

+678
-654
lines changed

lib/compiler.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@
2525
try {
2626
var ast = filterAST(parse(source));
2727
return compile(ast, name);
28-
}
29-
catch (err)
30-
{
31-
if (!err.line || !err.column) {
28+
} catch (err) {
29+
if (!err.location) {
3230
throw err;
3331
}
34-
throw new SyntaxError(err.message + ' At line : ' + err.line + ', column : ' + err.column);
32+
throw new SyntaxError(err.message + ' [' + name + ':' + err.location.start.line + ':' + err.location.start.column + ']');
3533
}
3634
};
3735

0 commit comments

Comments
 (0)