1
0
mirror of synced 2025-12-08 22:48:06 +08:00

bug fixes

This commit is contained in:
Andrey Gubanov (his digital copy)
2016-09-25 16:07:40 +03:00
parent 1d18f80902
commit 091450f3a2
2 changed files with 37 additions and 22 deletions

View File

@@ -1,7 +1,5 @@
/* Jison generated parser */
var jsonlint = (function(){
var dougJSONParse = typeof ___dougJSONParse === 'undefined' ? require('./doug-json-parse') : ___dougJSONParse;
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
@@ -69,15 +67,6 @@ parse: function parse(input) {
TERROR = 2,
EOF = 1;
try {
dougJSONParse(input);
} catch(e) {
if(/Bad string|Duplicate key/.test(e.message)) {
var lineNumber = input.substring(0, e.at).split('\n').length;
throw SyntaxError(e.message + ' on line ' + lineNumber);
}
}
//this.reductionCount = this.shiftCount = 0;
this.lexer.setInput(input);
@@ -423,6 +412,24 @@ return lexer;})()
parser.lexer = lexer;
return parser;
})();
var origParse = jsonlint.parse;
jsonlint.parse = function(input) {
var result = origParse.call(jsonlint, input);
var dougJSONParse = typeof ___dougJSONParse === 'undefined' ? require('./doug-json-parse') : ___dougJSONParse;
try {
dougJSONParse(input);
} catch(e) {
if(/Duplicate key|Bad string/.test(e.message)) {
var lineNumber = input.substring(0, e.at).split('\n').length;
throw SyntaxError(e.message + ' on line ' + lineNumber);
}
}
return result;
}
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
exports.parser = jsonlint;
exports.parse = function () { return jsonlint.parse.apply(jsonlint, arguments); }

View File

@@ -359,9 +359,7 @@ if(typeof module === 'object' && module.exports) {
module.exports = ___dougJSONParse;
}
/* Jison generated parser */
var jsonlint = (function(){
var dougJSONParse = typeof ___dougJSONParse === 'undefined' ? require('./doug-json-parse') : ___dougJSONParse;
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
@@ -429,15 +427,6 @@ parse: function parse(input) {
TERROR = 2,
EOF = 1;
try {
dougJSONParse(input);
} catch(e) {
if(/Bad string|Duplicate key/.test(e.message)) {
var lineNumber = input.substring(0, e.at).split('\n').length;
throw SyntaxError(e.message + ' on line ' + lineNumber);
}
}
//this.reductionCount = this.shiftCount = 0;
this.lexer.setInput(input);
@@ -783,6 +772,25 @@ return lexer;})()
parser.lexer = lexer;
return parser;
})();
var origParse = jsonlint.parse;
jsonlint.parse = function(input) {
var result = origParse.call(jsonlint, input);
var dougJSONParse = typeof ___dougJSONParse === 'undefined' ? require('./doug-json-parse') : ___dougJSONParse;
try {
dougJSONParse(input);
} catch(e) {
console.log(e.message);
if(/Duplicate key|Bad string/.test(e.message)) {
var lineNumber = input.substring(0, e.at).split('\n').length;
throw SyntaxError(e.message + ' on line ' + lineNumber);
}
}
return result;
}
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
exports.parser = jsonlint;
exports.parse = function () { return jsonlint.parse.apply(jsonlint, arguments); }