1
0
mirror of synced 2025-11-06 04:05:36 +08:00
This commit is contained in:
Andrey Gubanov (his digital copy)
2016-09-25 15:55:43 +03:00
parent 39f5c3dc89
commit 1d18f80902
5 changed files with 815 additions and 8 deletions

View File

@@ -53,7 +53,7 @@
prototype, push, r, t, text
*/
module.exports = (function () {
var ___dougJSONParse = (function () {
"use strict";
// This is a function that can parse a JSON text, producing a JavaScript
@@ -354,3 +354,7 @@ module.exports = (function () {
: result;
};
}());
if(typeof module === 'object' && module.exports) {
module.exports = ___dougJSONParse;
}

View File

@@ -1,7 +1,7 @@
/* Jison generated parser */
var jsonlint = (function(){
var dougJSONParse = require('./doug-json-parse');
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},
@@ -256,7 +256,6 @@ parseError:function parseError(str, hash) {
if (this.yy.parseError) {
this.yy.parseError(str, hash);
} else {
console.log(hash)
throw new Error(str);
}
},

View File

@@ -17,7 +17,7 @@
"bugs": {
"url": "http://github.com/zaach/jsonlint/issues"
},
"main": "lib/jsonlint.js",
"main": "web/jsonlint.js",
"bin": {
"jsonlint": "lib/cli.js"
},
@@ -34,7 +34,8 @@
"uglify-js": "*"
},
"scripts": {
"test": "node test/all-tests.js"
"test": "node test/all-tests.js",
"bundle": "node scripts/bundle > web/jsonlint.js"
},
"homepage": "http://zaach.github.com/jsonlint/",
"optionalDependencies": {}

View File

@@ -1,8 +1,8 @@
var fs = require('fs');
var source = "var jsonlint = (function(){var require=true,module=false;var exports={};" +
fs.readFileSync(__dirname+'/../lib/doug-json-parse.js', 'utf8') +
fs.readFileSync(__dirname+'/../lib/jsonlint.js', 'utf8') +
"return exports;})()";
"return exports;})();if(typeof module === 'object' && module.exports) module.exports = jsonlint;";
console.log(source);

File diff suppressed because one or more lines are too long