2015-06-08 20:21:19 +02:00
|
|
|
"use strict";
|
|
|
|
|
2014-05-08 11:48:56 +02:00
|
|
|
var classes = require("./utils/classes");
|
2012-11-10 09:47:22 +01:00
|
|
|
|
|
|
|
/* Thrown when the grammar contains an error. */
|
2015-04-06 10:34:07 +02:00
|
|
|
function GrammarError(message, location) {
|
2012-11-10 09:47:22 +01:00
|
|
|
this.name = "GrammarError";
|
|
|
|
this.message = message;
|
2015-04-06 10:34:07 +02:00
|
|
|
this.location = location;
|
2015-06-18 10:15:10 +02:00
|
|
|
|
|
|
|
if (typeof Error.captureStackTrace === "function") {
|
|
|
|
Error.captureStackTrace(this, GrammarError);
|
|
|
|
}
|
2014-05-04 14:11:44 +02:00
|
|
|
}
|
2012-11-10 09:47:22 +01:00
|
|
|
|
2014-05-08 11:48:56 +02:00
|
|
|
classes.subclass(GrammarError, Error);
|
2014-05-04 14:11:44 +02:00
|
|
|
|
|
|
|
module.exports = GrammarError;
|