diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
commit | abd94a7f5a50f43c797a11b53549ae48fff667c3 (patch) | |
tree | ab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/babylon/lib/parser/location.js | |
parent | a0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff) |
add node_modules to address #4364
Diffstat (limited to 'node_modules/babylon/lib/parser/location.js')
-rw-r--r-- | node_modules/babylon/lib/parser/location.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/babylon/lib/parser/location.js b/node_modules/babylon/lib/parser/location.js new file mode 100644 index 000000000..61a9a27cc --- /dev/null +++ b/node_modules/babylon/lib/parser/location.js @@ -0,0 +1,26 @@ +"use strict"; + +var _location = require("../util/location"); + +var _index = require("./index"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var pp = _index2.default.prototype; + +// This function is used to raise exceptions on parse errors. It +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +pp.raise = function (pos, message) { + var loc = (0, _location.getLineInfo)(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + throw err; +};
\ No newline at end of file |