tag: tablerow

This commit is contained in:
harttle
2016-06-17 14:59:30 +08:00
parent 0b7da2abf7
commit b478c798fd
10 changed files with 234 additions and 38 deletions
+19 -9
View File
@@ -1,11 +1,21 @@
function factory(msg, token){
var err = new Error(msg || 'unkown error');
if(token){
err.token = token.raw;
err.line = token.line;
}
throw err;
function TokenizationError(message, input, line, stack) {
this.name = "TokenizationError";
this.message = (message || "");
this.input = input;
this.line = line;
if(stack) this.stack = stack;
}
TokenizationError.prototype = Error.prototype;
module.exports = factory;
function ParseError(message, input, line, stack) {
this.name = "ParseError";
this.message = (message || "");
this.input = input;
this.line = line;
if(stack) this.stack = stack;
}
ParseError.prototype = Error.prototype;
module.exports = {
TokenizationError, ParseError
};