Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub (part 8)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +5 -0
- node_modules/@mapbox/geojson-types/generate-fixtures.js +13 -0
- node_modules/@mapbox/geojson-types/index.js +41 -0
- node_modules/@mapbox/geojson-types/package.json +17 -0
- node_modules/@mapbox/geojson-types/test.js +25 -0
- node_modules/@mapbox/jsonlint-lines-primitives/.npmignore +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/Makefile +17 -0
- node_modules/@mapbox/jsonlint-lines-primitives/README.md +7 -0
- node_modules/@mapbox/jsonlint-lines-primitives/lib/formatter.js +92 -0
- node_modules/@mapbox/jsonlint-lines-primitives/lib/jsonlint.js +681 -0
- node_modules/@mapbox/jsonlint-lines-primitives/package.json +34 -0
- node_modules/@mapbox/jsonlint-lines-primitives/scripts/bundle.js +8 -0
- node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.l +24 -0
- node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.y +110 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/all-tests.js +210 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/10.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/11.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/12.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/13.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/14.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/15.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/16.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/17.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/19.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/2.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/20.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/21.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/22.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/23.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/24.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/25.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/26.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/27.json +2 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/28.json +2 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/29.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/3.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/30.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/31.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/32.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/33.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/34.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/4.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/5.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/6.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/7.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/8.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/fails/9.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/passes/1.json +58 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/passes/2.json +1 -0
- node_modules/@mapbox/jsonlint-lines-primitives/test/passes/3.json +6 -0
.gitattributes
CHANGED
|
@@ -35,3 +35,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
node_modules/.bin/esbuild filter=lfs diff=lfs merge=lfs -text
|
| 37 |
node_modules/@esbuild/linux-x64/bin/esbuild filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
node_modules/.bin/esbuild filter=lfs diff=lfs merge=lfs -text
|
| 37 |
node_modules/@esbuild/linux-x64/bin/esbuild filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
node_modules/@mapbox/vector-tile/test/fixtures/14-8801-5371.vector.pbf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
node_modules/@plotly/d3-sankey/img/align-center.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
node_modules/@plotly/d3-sankey/img/align-left.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
node_modules/@plotly/d3-sankey/img/align-right.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
node_modules/@plotly/d3-sankey/img/energy.png filter=lfs diff=lfs merge=lfs -text
|
node_modules/@mapbox/geojson-types/generate-fixtures.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const fs = require('fs');
|
| 2 |
+
const fixtures = require('@mapbox/geojson-fixtures');
|
| 3 |
+
|
| 4 |
+
for (let key in fixtures.geometry) {
|
| 5 |
+
fs.writeFileSync(`${__dirname}/fixtures/valid/${key}.js.flow`, `// @flow
|
| 6 |
+
// This file was generated by generate-fixtures.js. Do not edit!
|
| 7 |
+
import type {
|
| 8 |
+
GeoJSONGeometry
|
| 9 |
+
} from '../../index';
|
| 10 |
+
|
| 11 |
+
const geojson: GeoJSONGeometry = ${JSON.stringify(fixtures.geometry[key], null, 2)}
|
| 12 |
+
`);
|
| 13 |
+
}
|
node_modules/@mapbox/geojson-types/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow strict
|
| 2 |
+
|
| 3 |
+
type GeoJSONPosition = [number, number] | [number, number, number];
|
| 4 |
+
type Geometry<T, C> = { type: T, coordinates: C }
|
| 5 |
+
|
| 6 |
+
export type GeoJSONPoint = Geometry< 'Point', GeoJSONPosition>;
|
| 7 |
+
export type GeoJSONMultiPoint = Geometry<'MultiPoint', Array<GeoJSONPosition>>;
|
| 8 |
+
|
| 9 |
+
export type GeoJSONLineString = Geometry< 'LineString', Array<GeoJSONPosition>>;
|
| 10 |
+
export type GeoJSONMultiLineString = Geometry<'MultiLineString', Array<Array<GeoJSONPosition>>>;
|
| 11 |
+
|
| 12 |
+
export type GeoJSONPolygon = Geometry< 'Polygon', Array<Array<GeoJSONPosition>>>;
|
| 13 |
+
export type GeoJSONMultiPolygon = Geometry<'MultiPolygon', Array<Array<Array<GeoJSONPosition>>>>;
|
| 14 |
+
|
| 15 |
+
export type GeoJSONGeometry =
|
| 16 |
+
| GeoJSONPoint
|
| 17 |
+
| GeoJSONMultiPoint
|
| 18 |
+
| GeoJSONLineString
|
| 19 |
+
| GeoJSONMultiLineString
|
| 20 |
+
| GeoJSONPolygon
|
| 21 |
+
| GeoJSONMultiPolygon
|
| 22 |
+
| GeoJSONGeometryCollection;
|
| 23 |
+
|
| 24 |
+
export type GeoJSONGeometryCollection = {
|
| 25 |
+
type: 'GeometryCollection',
|
| 26 |
+
geometries: Array<GeoJSONGeometry>
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
export type GeoJSONFeature = {
|
| 30 |
+
type: 'Feature',
|
| 31 |
+
geometry: ?GeoJSONGeometry,
|
| 32 |
+
properties: ?{},
|
| 33 |
+
id?: number | string
|
| 34 |
+
};
|
| 35 |
+
|
| 36 |
+
export type GeoJSONFeatureCollection = {
|
| 37 |
+
type: 'FeatureCollection',
|
| 38 |
+
features: Array<GeoJSONFeature>
|
| 39 |
+
};
|
| 40 |
+
|
| 41 |
+
export type GeoJSON = GeoJSONGeometry | GeoJSONFeature | GeoJSONFeatureCollection;
|
node_modules/@mapbox/geojson-types/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@mapbox/geojson-types",
|
| 3 |
+
"version": "1.0.2",
|
| 4 |
+
"description": "",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"scripts": {
|
| 7 |
+
"test": "tape test.js"
|
| 8 |
+
},
|
| 9 |
+
"keywords": [],
|
| 10 |
+
"author": "",
|
| 11 |
+
"license": "ISC",
|
| 12 |
+
"devDependencies": {
|
| 13 |
+
"@mapbox/geojson-fixtures": "^1.0.0",
|
| 14 |
+
"flow-bin": "^0.77.0",
|
| 15 |
+
"tape": "^4.9.1"
|
| 16 |
+
}
|
| 17 |
+
}
|
node_modules/@mapbox/geojson-types/test.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const fs = require('fs');
|
| 2 |
+
const tape = require('tape');
|
| 3 |
+
const exec = require('child_process').exec;
|
| 4 |
+
|
| 5 |
+
tape('valid', (t) => {
|
| 6 |
+
exec(`npx flow focus-check ${__dirname}/fixtures/valid/*.js.flow`, (err) => {
|
| 7 |
+
t.error(err);
|
| 8 |
+
t.end();
|
| 9 |
+
});
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
tape('invalid', (t) => {
|
| 13 |
+
const fixtures = fs.readdirSync(`${__dirname}/fixtures/invalid`);
|
| 14 |
+
for (const file of fixtures) {
|
| 15 |
+
t.test(file, (t) => {
|
| 16 |
+
exec(`npx flow focus-check ${__dirname}/fixtures/invalid/${file}`, (err) => {
|
| 17 |
+
t.ok(err, 'nonzero exit for invalid fixture');
|
| 18 |
+
t.end();
|
| 19 |
+
});
|
| 20 |
+
});
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
t.end();
|
| 24 |
+
});
|
| 25 |
+
|
node_modules/@mapbox/jsonlint-lines-primitives/.npmignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
node_modules
|
node_modules/@mapbox/jsonlint-lines-primitives/Makefile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
all: build test site
|
| 3 |
+
|
| 4 |
+
build:
|
| 5 |
+
./node_modules/jison/lib/cli.js src/jsonlint.y src/jsonlint.l
|
| 6 |
+
mv jsonlint.js lib/jsonlint.js
|
| 7 |
+
node scripts/bundle.js | ./node_modules/uglify-js/bin/uglifyjs > web/jsonlint.js
|
| 8 |
+
|
| 9 |
+
site:
|
| 10 |
+
cp web/jsonlint.js ../jsonlint-pages/jsonlint.js
|
| 11 |
+
|
| 12 |
+
deploy: site
|
| 13 |
+
cd ../jsonlint-pages && git commit -a -m 'deploy site updates' && git push origin gh-pages
|
| 14 |
+
|
| 15 |
+
test: lib/jsonlint.js test/all-tests.js
|
| 16 |
+
node test/all-tests.js
|
| 17 |
+
|
node_modules/@mapbox/jsonlint-lines-primitives/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
JSON Lint
|
| 2 |
+
=========
|
| 3 |
+
|
| 4 |
+
A fork of the `lines-primitive` branch of [tmcw/jsonlint](https://github.com/tmcw/jsonlint), which is a fork of [zaach/jsonlint](https://github.com/zaach/jsonlint) that adds line number annotations to the parsed JSON.
|
| 5 |
+
|
| 6 |
+
This fork is used by Mapbox GL JS, specifically for providing helpful error messages when validating Mapbox GL style JSON documents.
|
| 7 |
+
|
node_modules/@mapbox/jsonlint-lines-primitives/lib/formatter.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Manual formatter taken straight from https://github.com/umbrae/jsonlintdotcom
|
| 5 |
+
**/
|
| 6 |
+
|
| 7 |
+
/*jslint white: true, devel: true, onevar: true, browser: true, undef: true, nomen: true, regexp: true, plusplus: false, bitwise: true, newcap: true, maxerr: 50, indent: 4 */
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* jsl.format - Provide json reformatting in a character-by-character approach, so that even invalid JSON may be reformatted (to the best of its ability).
|
| 11 |
+
*
|
| 12 |
+
**/
|
| 13 |
+
var formatter = (function () {
|
| 14 |
+
|
| 15 |
+
function repeat(s, count) {
|
| 16 |
+
return new Array(count + 1).join(s);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
function formatJson(json, indentChars) {
|
| 20 |
+
var i = 0,
|
| 21 |
+
il = 0,
|
| 22 |
+
tab = (typeof indentChars !== "undefined") ? indentChars : " ",
|
| 23 |
+
newJson = "",
|
| 24 |
+
indentLevel = 0,
|
| 25 |
+
inString = false,
|
| 26 |
+
currentChar = null;
|
| 27 |
+
|
| 28 |
+
for (i = 0, il = json.length; i < il; i += 1) {
|
| 29 |
+
currentChar = json.charAt(i);
|
| 30 |
+
|
| 31 |
+
switch (currentChar) {
|
| 32 |
+
case '{':
|
| 33 |
+
case '[':
|
| 34 |
+
if (!inString) {
|
| 35 |
+
newJson += currentChar + "\n" + repeat(tab, indentLevel + 1);
|
| 36 |
+
indentLevel += 1;
|
| 37 |
+
} else {
|
| 38 |
+
newJson += currentChar;
|
| 39 |
+
}
|
| 40 |
+
break;
|
| 41 |
+
case '}':
|
| 42 |
+
case ']':
|
| 43 |
+
if (!inString) {
|
| 44 |
+
indentLevel -= 1;
|
| 45 |
+
newJson += "\n" + repeat(tab, indentLevel) + currentChar;
|
| 46 |
+
} else {
|
| 47 |
+
newJson += currentChar;
|
| 48 |
+
}
|
| 49 |
+
break;
|
| 50 |
+
case ',':
|
| 51 |
+
if (!inString) {
|
| 52 |
+
newJson += ",\n" + repeat(tab, indentLevel);
|
| 53 |
+
} else {
|
| 54 |
+
newJson += currentChar;
|
| 55 |
+
}
|
| 56 |
+
break;
|
| 57 |
+
case ':':
|
| 58 |
+
if (!inString) {
|
| 59 |
+
newJson += ": ";
|
| 60 |
+
} else {
|
| 61 |
+
newJson += currentChar;
|
| 62 |
+
}
|
| 63 |
+
break;
|
| 64 |
+
case ' ':
|
| 65 |
+
case "\n":
|
| 66 |
+
case "\t":
|
| 67 |
+
if (inString) {
|
| 68 |
+
newJson += currentChar;
|
| 69 |
+
}
|
| 70 |
+
break;
|
| 71 |
+
case '"':
|
| 72 |
+
if (i > 0 && json.charAt(i - 1) !== '\\') {
|
| 73 |
+
inString = !inString;
|
| 74 |
+
}
|
| 75 |
+
newJson += currentChar;
|
| 76 |
+
break;
|
| 77 |
+
default:
|
| 78 |
+
newJson += currentChar;
|
| 79 |
+
break;
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
return newJson;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
return { "formatJson": formatJson };
|
| 87 |
+
|
| 88 |
+
}());
|
| 89 |
+
|
| 90 |
+
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
|
| 91 |
+
exports.formatter = formatter;
|
| 92 |
+
}
|
node_modules/@mapbox/jsonlint-lines-primitives/lib/jsonlint.js
ADDED
|
@@ -0,0 +1,681 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* parser generated by jison 0.4.15 */
|
| 2 |
+
/*
|
| 3 |
+
Returns a Parser object of the following structure:
|
| 4 |
+
|
| 5 |
+
Parser: {
|
| 6 |
+
yy: {}
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
Parser.prototype: {
|
| 10 |
+
yy: {},
|
| 11 |
+
trace: function(),
|
| 12 |
+
symbols_: {associative list: name ==> number},
|
| 13 |
+
terminals_: {associative list: number ==> name},
|
| 14 |
+
productions_: [...],
|
| 15 |
+
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
|
| 16 |
+
table: [...],
|
| 17 |
+
defaultActions: {...},
|
| 18 |
+
parseError: function(str, hash),
|
| 19 |
+
parse: function(input),
|
| 20 |
+
|
| 21 |
+
lexer: {
|
| 22 |
+
EOF: 1,
|
| 23 |
+
parseError: function(str, hash),
|
| 24 |
+
setInput: function(input),
|
| 25 |
+
input: function(),
|
| 26 |
+
unput: function(str),
|
| 27 |
+
more: function(),
|
| 28 |
+
less: function(n),
|
| 29 |
+
pastInput: function(),
|
| 30 |
+
upcomingInput: function(),
|
| 31 |
+
showPosition: function(),
|
| 32 |
+
test_match: function(regex_match_array, rule_index),
|
| 33 |
+
next: function(),
|
| 34 |
+
lex: function(),
|
| 35 |
+
begin: function(condition),
|
| 36 |
+
popState: function(),
|
| 37 |
+
_currentRules: function(),
|
| 38 |
+
topState: function(),
|
| 39 |
+
pushState: function(condition),
|
| 40 |
+
|
| 41 |
+
options: {
|
| 42 |
+
ranges: boolean (optional: true ==> token location info will include a .range[] member)
|
| 43 |
+
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
|
| 44 |
+
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
|
| 45 |
+
},
|
| 46 |
+
|
| 47 |
+
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
|
| 48 |
+
rules: [...],
|
| 49 |
+
conditions: {associative list: name ==> set},
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
token location info (@$, _$, etc.): {
|
| 55 |
+
first_line: n,
|
| 56 |
+
last_line: n,
|
| 57 |
+
first_column: n,
|
| 58 |
+
last_column: n,
|
| 59 |
+
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
|
| 64 |
+
text: (matched text)
|
| 65 |
+
token: (the produced terminal token, if any)
|
| 66 |
+
line: (yylineno)
|
| 67 |
+
}
|
| 68 |
+
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
|
| 69 |
+
loc: (yylloc)
|
| 70 |
+
expected: (string describing the set of expected tokens)
|
| 71 |
+
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
|
| 72 |
+
}
|
| 73 |
+
*/
|
| 74 |
+
var parser = (function(){
|
| 75 |
+
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,12],$V1=[1,13],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,14],$V6=[1,15],$V7=[14,18,22,24],$V8=[18,22],$V9=[22,24];
|
| 76 |
+
var parser = {trace: function trace() { },
|
| 77 |
+
yy: {},
|
| 78 |
+
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},
|
| 79 |
+
terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
|
| 80 |
+
productions_: [0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],
|
| 81 |
+
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
| 82 |
+
/* this == yyval */
|
| 83 |
+
|
| 84 |
+
var $0 = $$.length - 1;
|
| 85 |
+
switch (yystate) {
|
| 86 |
+
case 1:
|
| 87 |
+
// replace escaped characters with actual character
|
| 88 |
+
this.$ = new String(yytext.replace(/\\(\\|")/g, "$"+"1")
|
| 89 |
+
.replace(/\\n/g,'\n')
|
| 90 |
+
.replace(/\\r/g,'\r')
|
| 91 |
+
.replace(/\\t/g,'\t')
|
| 92 |
+
.replace(/\\v/g,'\v')
|
| 93 |
+
.replace(/\\f/g,'\f')
|
| 94 |
+
.replace(/\\b/g,'\b'));
|
| 95 |
+
this.$.__line__ = this._$.first_line;
|
| 96 |
+
|
| 97 |
+
break;
|
| 98 |
+
case 2:
|
| 99 |
+
|
| 100 |
+
this.$ = new Number(yytext);
|
| 101 |
+
this.$.__line__ = this._$.first_line;
|
| 102 |
+
|
| 103 |
+
break;
|
| 104 |
+
case 3:
|
| 105 |
+
|
| 106 |
+
this.$ = null;
|
| 107 |
+
|
| 108 |
+
break;
|
| 109 |
+
case 4:
|
| 110 |
+
|
| 111 |
+
this.$ = new Boolean(true);
|
| 112 |
+
this.$.__line__ = this._$.first_line;
|
| 113 |
+
|
| 114 |
+
break;
|
| 115 |
+
case 5:
|
| 116 |
+
|
| 117 |
+
this.$ = new Boolean(false);
|
| 118 |
+
this.$.__line__ = this._$.first_line;
|
| 119 |
+
|
| 120 |
+
break;
|
| 121 |
+
case 6:
|
| 122 |
+
return this.$ = $$[$0-1];
|
| 123 |
+
break;
|
| 124 |
+
case 13:
|
| 125 |
+
this.$ = {}; Object.defineProperty(this.$, '__line__', {
|
| 126 |
+
value: this._$.first_line,
|
| 127 |
+
enumerable: false
|
| 128 |
+
})
|
| 129 |
+
break;
|
| 130 |
+
case 14: case 19:
|
| 131 |
+
this.$ = $$[$0-1]; Object.defineProperty(this.$, '__line__', {
|
| 132 |
+
value: this._$.first_line,
|
| 133 |
+
enumerable: false
|
| 134 |
+
})
|
| 135 |
+
break;
|
| 136 |
+
case 15:
|
| 137 |
+
this.$ = [$$[$0-2], $$[$0]];
|
| 138 |
+
break;
|
| 139 |
+
case 16:
|
| 140 |
+
this.$ = {}; this.$[$$[$0][0]] = $$[$0][1];
|
| 141 |
+
break;
|
| 142 |
+
case 17:
|
| 143 |
+
this.$ = $$[$0-2]; $$[$0-2][$$[$0][0]] = $$[$0][1];
|
| 144 |
+
break;
|
| 145 |
+
case 18:
|
| 146 |
+
this.$ = []; Object.defineProperty(this.$, '__line__', {
|
| 147 |
+
value: this._$.first_line,
|
| 148 |
+
enumerable: false
|
| 149 |
+
})
|
| 150 |
+
break;
|
| 151 |
+
case 20:
|
| 152 |
+
this.$ = [$$[$0]];
|
| 153 |
+
break;
|
| 154 |
+
case 21:
|
| 155 |
+
this.$ = $$[$0-2]; $$[$0-2].push($$[$0]);
|
| 156 |
+
break;
|
| 157 |
+
}
|
| 158 |
+
},
|
| 159 |
+
table: [{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,12:1,13:2,15:7,16:8,17:$V5,23:$V6},{1:[3]},{14:[1,16]},o($V7,[2,7]),o($V7,[2,8]),o($V7,[2,9]),o($V7,[2,10]),o($V7,[2,11]),o($V7,[2,12]),o($V7,[2,3]),o($V7,[2,4]),o($V7,[2,5]),o([14,18,21,22,24],[2,1]),o($V7,[2,2]),{3:20,4:$V0,18:[1,17],19:18,20:19},{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,13:23,15:7,16:8,17:$V5,23:$V6,24:[1,21],25:22},{1:[2,6]},o($V7,[2,13]),{18:[1,24],22:[1,25]},o($V8,[2,16]),{21:[1,26]},o($V7,[2,18]),{22:[1,28],24:[1,27]},o($V9,[2,20]),o($V7,[2,14]),{3:20,4:$V0,20:29},{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,13:30,15:7,16:8,17:$V5,23:$V6},o($V7,[2,19]),{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,13:31,15:7,16:8,17:$V5,23:$V6},o($V8,[2,17]),o($V8,[2,15]),o($V9,[2,21])],
|
| 160 |
+
defaultActions: {16:[2,6]},
|
| 161 |
+
parseError: function parseError(str, hash) {
|
| 162 |
+
if (hash.recoverable) {
|
| 163 |
+
this.trace(str);
|
| 164 |
+
} else {
|
| 165 |
+
throw new Error(str);
|
| 166 |
+
}
|
| 167 |
+
},
|
| 168 |
+
parse: function parse(input) {
|
| 169 |
+
var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
|
| 170 |
+
var args = lstack.slice.call(arguments, 1);
|
| 171 |
+
var lexer = Object.create(this.lexer);
|
| 172 |
+
var sharedState = { yy: {} };
|
| 173 |
+
for (var k in this.yy) {
|
| 174 |
+
if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
| 175 |
+
sharedState.yy[k] = this.yy[k];
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
lexer.setInput(input, sharedState.yy);
|
| 179 |
+
sharedState.yy.lexer = lexer;
|
| 180 |
+
sharedState.yy.parser = this;
|
| 181 |
+
if (typeof lexer.yylloc == 'undefined') {
|
| 182 |
+
lexer.yylloc = {};
|
| 183 |
+
}
|
| 184 |
+
var yyloc = lexer.yylloc;
|
| 185 |
+
lstack.push(yyloc);
|
| 186 |
+
var ranges = lexer.options && lexer.options.ranges;
|
| 187 |
+
if (typeof sharedState.yy.parseError === 'function') {
|
| 188 |
+
this.parseError = sharedState.yy.parseError;
|
| 189 |
+
} else {
|
| 190 |
+
this.parseError = Object.getPrototypeOf(this).parseError;
|
| 191 |
+
}
|
| 192 |
+
function popStack(n) {
|
| 193 |
+
stack.length = stack.length - 2 * n;
|
| 194 |
+
vstack.length = vstack.length - n;
|
| 195 |
+
lstack.length = lstack.length - n;
|
| 196 |
+
}
|
| 197 |
+
_token_stack:
|
| 198 |
+
function lex() {
|
| 199 |
+
var token;
|
| 200 |
+
token = lexer.lex() || EOF;
|
| 201 |
+
if (typeof token !== 'number') {
|
| 202 |
+
token = self.symbols_[token] || token;
|
| 203 |
+
}
|
| 204 |
+
return token;
|
| 205 |
+
}
|
| 206 |
+
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
|
| 207 |
+
while (true) {
|
| 208 |
+
state = stack[stack.length - 1];
|
| 209 |
+
if (this.defaultActions[state]) {
|
| 210 |
+
action = this.defaultActions[state];
|
| 211 |
+
} else {
|
| 212 |
+
if (symbol === null || typeof symbol == 'undefined') {
|
| 213 |
+
symbol = lex();
|
| 214 |
+
}
|
| 215 |
+
action = table[state] && table[state][symbol];
|
| 216 |
+
}
|
| 217 |
+
if (typeof action === 'undefined' || !action.length || !action[0]) {
|
| 218 |
+
var errStr = '';
|
| 219 |
+
expected = [];
|
| 220 |
+
for (p in table[state]) {
|
| 221 |
+
if (this.terminals_[p] && p > TERROR) {
|
| 222 |
+
expected.push('\'' + this.terminals_[p] + '\'');
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
if (lexer.showPosition) {
|
| 226 |
+
errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
| 227 |
+
} else {
|
| 228 |
+
errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
| 229 |
+
}
|
| 230 |
+
this.parseError(errStr, {
|
| 231 |
+
text: lexer.match,
|
| 232 |
+
token: this.terminals_[symbol] || symbol,
|
| 233 |
+
line: lexer.yylineno,
|
| 234 |
+
loc: yyloc,
|
| 235 |
+
expected: expected
|
| 236 |
+
});
|
| 237 |
+
}
|
| 238 |
+
if (action[0] instanceof Array && action.length > 1) {
|
| 239 |
+
throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
| 240 |
+
}
|
| 241 |
+
switch (action[0]) {
|
| 242 |
+
case 1:
|
| 243 |
+
stack.push(symbol);
|
| 244 |
+
vstack.push(lexer.yytext);
|
| 245 |
+
lstack.push(lexer.yylloc);
|
| 246 |
+
stack.push(action[1]);
|
| 247 |
+
symbol = null;
|
| 248 |
+
if (!preErrorSymbol) {
|
| 249 |
+
yyleng = lexer.yyleng;
|
| 250 |
+
yytext = lexer.yytext;
|
| 251 |
+
yylineno = lexer.yylineno;
|
| 252 |
+
yyloc = lexer.yylloc;
|
| 253 |
+
if (recovering > 0) {
|
| 254 |
+
recovering--;
|
| 255 |
+
}
|
| 256 |
+
} else {
|
| 257 |
+
symbol = preErrorSymbol;
|
| 258 |
+
preErrorSymbol = null;
|
| 259 |
+
}
|
| 260 |
+
break;
|
| 261 |
+
case 2:
|
| 262 |
+
len = this.productions_[action[1]][1];
|
| 263 |
+
yyval.$ = vstack[vstack.length - len];
|
| 264 |
+
yyval._$ = {
|
| 265 |
+
first_line: lstack[lstack.length - (len || 1)].first_line,
|
| 266 |
+
last_line: lstack[lstack.length - 1].last_line,
|
| 267 |
+
first_column: lstack[lstack.length - (len || 1)].first_column,
|
| 268 |
+
last_column: lstack[lstack.length - 1].last_column
|
| 269 |
+
};
|
| 270 |
+
if (ranges) {
|
| 271 |
+
yyval._$.range = [
|
| 272 |
+
lstack[lstack.length - (len || 1)].range[0],
|
| 273 |
+
lstack[lstack.length - 1].range[1]
|
| 274 |
+
];
|
| 275 |
+
}
|
| 276 |
+
r = this.performAction.apply(yyval, [
|
| 277 |
+
yytext,
|
| 278 |
+
yyleng,
|
| 279 |
+
yylineno,
|
| 280 |
+
sharedState.yy,
|
| 281 |
+
action[1],
|
| 282 |
+
vstack,
|
| 283 |
+
lstack
|
| 284 |
+
].concat(args));
|
| 285 |
+
if (typeof r !== 'undefined') {
|
| 286 |
+
return r;
|
| 287 |
+
}
|
| 288 |
+
if (len) {
|
| 289 |
+
stack = stack.slice(0, -1 * len * 2);
|
| 290 |
+
vstack = vstack.slice(0, -1 * len);
|
| 291 |
+
lstack = lstack.slice(0, -1 * len);
|
| 292 |
+
}
|
| 293 |
+
stack.push(this.productions_[action[1]][0]);
|
| 294 |
+
vstack.push(yyval.$);
|
| 295 |
+
lstack.push(yyval._$);
|
| 296 |
+
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
| 297 |
+
stack.push(newState);
|
| 298 |
+
break;
|
| 299 |
+
case 3:
|
| 300 |
+
return true;
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
return true;
|
| 304 |
+
}};
|
| 305 |
+
/* generated by jison-lex 0.3.4 */
|
| 306 |
+
var lexer = (function(){
|
| 307 |
+
var lexer = ({
|
| 308 |
+
|
| 309 |
+
EOF:1,
|
| 310 |
+
|
| 311 |
+
parseError:function parseError(str, hash) {
|
| 312 |
+
if (this.yy.parser) {
|
| 313 |
+
this.yy.parser.parseError(str, hash);
|
| 314 |
+
} else {
|
| 315 |
+
throw new Error(str);
|
| 316 |
+
}
|
| 317 |
+
},
|
| 318 |
+
|
| 319 |
+
// resets the lexer, sets new input
|
| 320 |
+
setInput:function (input, yy) {
|
| 321 |
+
this.yy = yy || this.yy || {};
|
| 322 |
+
this._input = input;
|
| 323 |
+
this._more = this._backtrack = this.done = false;
|
| 324 |
+
this.yylineno = this.yyleng = 0;
|
| 325 |
+
this.yytext = this.matched = this.match = '';
|
| 326 |
+
this.conditionStack = ['INITIAL'];
|
| 327 |
+
this.yylloc = {
|
| 328 |
+
first_line: 1,
|
| 329 |
+
first_column: 0,
|
| 330 |
+
last_line: 1,
|
| 331 |
+
last_column: 0
|
| 332 |
+
};
|
| 333 |
+
if (this.options.ranges) {
|
| 334 |
+
this.yylloc.range = [0,0];
|
| 335 |
+
}
|
| 336 |
+
this.offset = 0;
|
| 337 |
+
return this;
|
| 338 |
+
},
|
| 339 |
+
|
| 340 |
+
// consumes and returns one char from the input
|
| 341 |
+
input:function () {
|
| 342 |
+
var ch = this._input[0];
|
| 343 |
+
this.yytext += ch;
|
| 344 |
+
this.yyleng++;
|
| 345 |
+
this.offset++;
|
| 346 |
+
this.match += ch;
|
| 347 |
+
this.matched += ch;
|
| 348 |
+
var lines = ch.match(/(?:\r\n?|\n).*/g);
|
| 349 |
+
if (lines) {
|
| 350 |
+
this.yylineno++;
|
| 351 |
+
this.yylloc.last_line++;
|
| 352 |
+
} else {
|
| 353 |
+
this.yylloc.last_column++;
|
| 354 |
+
}
|
| 355 |
+
if (this.options.ranges) {
|
| 356 |
+
this.yylloc.range[1]++;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
this._input = this._input.slice(1);
|
| 360 |
+
return ch;
|
| 361 |
+
},
|
| 362 |
+
|
| 363 |
+
// unshifts one char (or a string) into the input
|
| 364 |
+
unput:function (ch) {
|
| 365 |
+
var len = ch.length;
|
| 366 |
+
var lines = ch.split(/(?:\r\n?|\n)/g);
|
| 367 |
+
|
| 368 |
+
this._input = ch + this._input;
|
| 369 |
+
this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
| 370 |
+
//this.yyleng -= len;
|
| 371 |
+
this.offset -= len;
|
| 372 |
+
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
| 373 |
+
this.match = this.match.substr(0, this.match.length - 1);
|
| 374 |
+
this.matched = this.matched.substr(0, this.matched.length - 1);
|
| 375 |
+
|
| 376 |
+
if (lines.length - 1) {
|
| 377 |
+
this.yylineno -= lines.length - 1;
|
| 378 |
+
}
|
| 379 |
+
var r = this.yylloc.range;
|
| 380 |
+
|
| 381 |
+
this.yylloc = {
|
| 382 |
+
first_line: this.yylloc.first_line,
|
| 383 |
+
last_line: this.yylineno + 1,
|
| 384 |
+
first_column: this.yylloc.first_column,
|
| 385 |
+
last_column: lines ?
|
| 386 |
+
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
|
| 387 |
+
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
|
| 388 |
+
this.yylloc.first_column - len
|
| 389 |
+
};
|
| 390 |
+
|
| 391 |
+
if (this.options.ranges) {
|
| 392 |
+
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
| 393 |
+
}
|
| 394 |
+
this.yyleng = this.yytext.length;
|
| 395 |
+
return this;
|
| 396 |
+
},
|
| 397 |
+
|
| 398 |
+
// When called from action, caches matched text and appends it on next action
|
| 399 |
+
more:function () {
|
| 400 |
+
this._more = true;
|
| 401 |
+
return this;
|
| 402 |
+
},
|
| 403 |
+
|
| 404 |
+
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
| 405 |
+
reject:function () {
|
| 406 |
+
if (this.options.backtrack_lexer) {
|
| 407 |
+
this._backtrack = true;
|
| 408 |
+
} else {
|
| 409 |
+
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
| 410 |
+
text: "",
|
| 411 |
+
token: null,
|
| 412 |
+
line: this.yylineno
|
| 413 |
+
});
|
| 414 |
+
|
| 415 |
+
}
|
| 416 |
+
return this;
|
| 417 |
+
},
|
| 418 |
+
|
| 419 |
+
// retain first n characters of the match
|
| 420 |
+
less:function (n) {
|
| 421 |
+
this.unput(this.match.slice(n));
|
| 422 |
+
},
|
| 423 |
+
|
| 424 |
+
// displays already matched input, i.e. for error messages
|
| 425 |
+
pastInput:function () {
|
| 426 |
+
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
| 427 |
+
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
|
| 428 |
+
},
|
| 429 |
+
|
| 430 |
+
// displays upcoming input, i.e. for error messages
|
| 431 |
+
upcomingInput:function () {
|
| 432 |
+
var next = this.match;
|
| 433 |
+
if (next.length < 20) {
|
| 434 |
+
next += this._input.substr(0, 20-next.length);
|
| 435 |
+
}
|
| 436 |
+
return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
| 437 |
+
},
|
| 438 |
+
|
| 439 |
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
| 440 |
+
showPosition:function () {
|
| 441 |
+
var pre = this.pastInput();
|
| 442 |
+
var c = new Array(pre.length + 1).join("-");
|
| 443 |
+
return pre + this.upcomingInput() + "\n" + c + "^";
|
| 444 |
+
},
|
| 445 |
+
|
| 446 |
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
| 447 |
+
test_match:function (match, indexed_rule) {
|
| 448 |
+
var token,
|
| 449 |
+
lines,
|
| 450 |
+
backup;
|
| 451 |
+
|
| 452 |
+
if (this.options.backtrack_lexer) {
|
| 453 |
+
// save context
|
| 454 |
+
backup = {
|
| 455 |
+
yylineno: this.yylineno,
|
| 456 |
+
yylloc: {
|
| 457 |
+
first_line: this.yylloc.first_line,
|
| 458 |
+
last_line: this.last_line,
|
| 459 |
+
first_column: this.yylloc.first_column,
|
| 460 |
+
last_column: this.yylloc.last_column
|
| 461 |
+
},
|
| 462 |
+
yytext: this.yytext,
|
| 463 |
+
match: this.match,
|
| 464 |
+
matches: this.matches,
|
| 465 |
+
matched: this.matched,
|
| 466 |
+
yyleng: this.yyleng,
|
| 467 |
+
offset: this.offset,
|
| 468 |
+
_more: this._more,
|
| 469 |
+
_input: this._input,
|
| 470 |
+
yy: this.yy,
|
| 471 |
+
conditionStack: this.conditionStack.slice(0),
|
| 472 |
+
done: this.done
|
| 473 |
+
};
|
| 474 |
+
if (this.options.ranges) {
|
| 475 |
+
backup.yylloc.range = this.yylloc.range.slice(0);
|
| 476 |
+
}
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
| 480 |
+
if (lines) {
|
| 481 |
+
this.yylineno += lines.length;
|
| 482 |
+
}
|
| 483 |
+
this.yylloc = {
|
| 484 |
+
first_line: this.yylloc.last_line,
|
| 485 |
+
last_line: this.yylineno + 1,
|
| 486 |
+
first_column: this.yylloc.last_column,
|
| 487 |
+
last_column: lines ?
|
| 488 |
+
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
|
| 489 |
+
this.yylloc.last_column + match[0].length
|
| 490 |
+
};
|
| 491 |
+
this.yytext += match[0];
|
| 492 |
+
this.match += match[0];
|
| 493 |
+
this.matches = match;
|
| 494 |
+
this.yyleng = this.yytext.length;
|
| 495 |
+
if (this.options.ranges) {
|
| 496 |
+
this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
| 497 |
+
}
|
| 498 |
+
this._more = false;
|
| 499 |
+
this._backtrack = false;
|
| 500 |
+
this._input = this._input.slice(match[0].length);
|
| 501 |
+
this.matched += match[0];
|
| 502 |
+
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
| 503 |
+
if (this.done && this._input) {
|
| 504 |
+
this.done = false;
|
| 505 |
+
}
|
| 506 |
+
if (token) {
|
| 507 |
+
return token;
|
| 508 |
+
} else if (this._backtrack) {
|
| 509 |
+
// recover context
|
| 510 |
+
for (var k in backup) {
|
| 511 |
+
this[k] = backup[k];
|
| 512 |
+
}
|
| 513 |
+
return false; // rule action called reject() implying the next rule should be tested instead.
|
| 514 |
+
}
|
| 515 |
+
return false;
|
| 516 |
+
},
|
| 517 |
+
|
| 518 |
+
// return next match in input
|
| 519 |
+
next:function () {
|
| 520 |
+
if (this.done) {
|
| 521 |
+
return this.EOF;
|
| 522 |
+
}
|
| 523 |
+
if (!this._input) {
|
| 524 |
+
this.done = true;
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
var token,
|
| 528 |
+
match,
|
| 529 |
+
tempMatch,
|
| 530 |
+
index;
|
| 531 |
+
if (!this._more) {
|
| 532 |
+
this.yytext = '';
|
| 533 |
+
this.match = '';
|
| 534 |
+
}
|
| 535 |
+
var rules = this._currentRules();
|
| 536 |
+
for (var i = 0; i < rules.length; i++) {
|
| 537 |
+
tempMatch = this._input.match(this.rules[rules[i]]);
|
| 538 |
+
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
| 539 |
+
match = tempMatch;
|
| 540 |
+
index = i;
|
| 541 |
+
if (this.options.backtrack_lexer) {
|
| 542 |
+
token = this.test_match(tempMatch, rules[i]);
|
| 543 |
+
if (token !== false) {
|
| 544 |
+
return token;
|
| 545 |
+
} else if (this._backtrack) {
|
| 546 |
+
match = false;
|
| 547 |
+
continue; // rule action called reject() implying a rule MISmatch.
|
| 548 |
+
} else {
|
| 549 |
+
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
| 550 |
+
return false;
|
| 551 |
+
}
|
| 552 |
+
} else if (!this.options.flex) {
|
| 553 |
+
break;
|
| 554 |
+
}
|
| 555 |
+
}
|
| 556 |
+
}
|
| 557 |
+
if (match) {
|
| 558 |
+
token = this.test_match(match, rules[index]);
|
| 559 |
+
if (token !== false) {
|
| 560 |
+
return token;
|
| 561 |
+
}
|
| 562 |
+
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
| 563 |
+
return false;
|
| 564 |
+
}
|
| 565 |
+
if (this._input === "") {
|
| 566 |
+
return this.EOF;
|
| 567 |
+
} else {
|
| 568 |
+
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
| 569 |
+
text: "",
|
| 570 |
+
token: null,
|
| 571 |
+
line: this.yylineno
|
| 572 |
+
});
|
| 573 |
+
}
|
| 574 |
+
},
|
| 575 |
+
|
| 576 |
+
// return next match that has a token
|
| 577 |
+
lex:function lex() {
|
| 578 |
+
var r = this.next();
|
| 579 |
+
if (r) {
|
| 580 |
+
return r;
|
| 581 |
+
} else {
|
| 582 |
+
return this.lex();
|
| 583 |
+
}
|
| 584 |
+
},
|
| 585 |
+
|
| 586 |
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
| 587 |
+
begin:function begin(condition) {
|
| 588 |
+
this.conditionStack.push(condition);
|
| 589 |
+
},
|
| 590 |
+
|
| 591 |
+
// pop the previously active lexer condition state off the condition stack
|
| 592 |
+
popState:function popState() {
|
| 593 |
+
var n = this.conditionStack.length - 1;
|
| 594 |
+
if (n > 0) {
|
| 595 |
+
return this.conditionStack.pop();
|
| 596 |
+
} else {
|
| 597 |
+
return this.conditionStack[0];
|
| 598 |
+
}
|
| 599 |
+
},
|
| 600 |
+
|
| 601 |
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
| 602 |
+
_currentRules:function _currentRules() {
|
| 603 |
+
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
| 604 |
+
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
| 605 |
+
} else {
|
| 606 |
+
return this.conditions["INITIAL"].rules;
|
| 607 |
+
}
|
| 608 |
+
},
|
| 609 |
+
|
| 610 |
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
| 611 |
+
topState:function topState(n) {
|
| 612 |
+
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
| 613 |
+
if (n >= 0) {
|
| 614 |
+
return this.conditionStack[n];
|
| 615 |
+
} else {
|
| 616 |
+
return "INITIAL";
|
| 617 |
+
}
|
| 618 |
+
},
|
| 619 |
+
|
| 620 |
+
// alias for begin(condition)
|
| 621 |
+
pushState:function pushState(condition) {
|
| 622 |
+
this.begin(condition);
|
| 623 |
+
},
|
| 624 |
+
|
| 625 |
+
// return the number of states currently on the stack
|
| 626 |
+
stateStackSize:function stateStackSize() {
|
| 627 |
+
return this.conditionStack.length;
|
| 628 |
+
},
|
| 629 |
+
options: {},
|
| 630 |
+
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
| 631 |
+
var YYSTATE=YY_START;
|
| 632 |
+
switch($avoiding_name_collisions) {
|
| 633 |
+
case 0:/* skip whitespace */
|
| 634 |
+
break;
|
| 635 |
+
case 1:return 6
|
| 636 |
+
break;
|
| 637 |
+
case 2:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 4
|
| 638 |
+
break;
|
| 639 |
+
case 3:return 17
|
| 640 |
+
break;
|
| 641 |
+
case 4:return 18
|
| 642 |
+
break;
|
| 643 |
+
case 5:return 23
|
| 644 |
+
break;
|
| 645 |
+
case 6:return 24
|
| 646 |
+
break;
|
| 647 |
+
case 7:return 22
|
| 648 |
+
break;
|
| 649 |
+
case 8:return 21
|
| 650 |
+
break;
|
| 651 |
+
case 9:return 10
|
| 652 |
+
break;
|
| 653 |
+
case 10:return 11
|
| 654 |
+
break;
|
| 655 |
+
case 11:return 8
|
| 656 |
+
break;
|
| 657 |
+
case 12:return 14
|
| 658 |
+
break;
|
| 659 |
+
case 13:return 'INVALID'
|
| 660 |
+
break;
|
| 661 |
+
}
|
| 662 |
+
},
|
| 663 |
+
rules: [/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],
|
| 664 |
+
conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"inclusive":true}}
|
| 665 |
+
});
|
| 666 |
+
return lexer;
|
| 667 |
+
})();
|
| 668 |
+
parser.lexer = lexer;
|
| 669 |
+
function Parser () {
|
| 670 |
+
this.yy = {};
|
| 671 |
+
}
|
| 672 |
+
Parser.prototype = parser;parser.Parser = Parser;
|
| 673 |
+
return new Parser;
|
| 674 |
+
})();
|
| 675 |
+
|
| 676 |
+
|
| 677 |
+
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
|
| 678 |
+
exports.parser = parser;
|
| 679 |
+
exports.Parser = parser.Parser;
|
| 680 |
+
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
| 681 |
+
}
|
node_modules/@mapbox/jsonlint-lines-primitives/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"author": "Zach Carter <zach@carter.name> (http://zaa.ch)",
|
| 3 |
+
"name": "@mapbox/jsonlint-lines-primitives",
|
| 4 |
+
"description": "Validate JSON",
|
| 5 |
+
"keywords": [
|
| 6 |
+
"json",
|
| 7 |
+
"validation",
|
| 8 |
+
"lint",
|
| 9 |
+
"jsonlint"
|
| 10 |
+
],
|
| 11 |
+
"version": "2.0.2",
|
| 12 |
+
"preferGlobal": true,
|
| 13 |
+
"repository": {
|
| 14 |
+
"type": "git",
|
| 15 |
+
"url": "git://github.com/mapbox/jsonlint.git"
|
| 16 |
+
},
|
| 17 |
+
"bugs": {
|
| 18 |
+
"url": "http://github.com/mapbox/jsonlint/issues"
|
| 19 |
+
},
|
| 20 |
+
"main": "lib/jsonlint.js",
|
| 21 |
+
"engines": {
|
| 22 |
+
"node": ">= 0.6"
|
| 23 |
+
},
|
| 24 |
+
"dependencies": {},
|
| 25 |
+
"devDependencies": {
|
| 26 |
+
"test": "*",
|
| 27 |
+
"jison": "*",
|
| 28 |
+
"uglify-js": "*"
|
| 29 |
+
},
|
| 30 |
+
"scripts": {
|
| 31 |
+
"test": "node test/all-tests.js"
|
| 32 |
+
},
|
| 33 |
+
"optionalDependencies": {}
|
| 34 |
+
}
|
node_modules/@mapbox/jsonlint-lines-primitives/scripts/bundle.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var fs = require('fs');
|
| 2 |
+
|
| 3 |
+
var source = "var jsonlint = (function(){var require=true,module=false;var exports={};" +
|
| 4 |
+
fs.readFileSync(__dirname+'/../lib/jsonlint.js', 'utf8') +
|
| 5 |
+
"return exports;})()";
|
| 6 |
+
|
| 7 |
+
console.log(source);
|
| 8 |
+
|
node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.l
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
int "-"?([0-9]|[1-9][0-9]+)
|
| 2 |
+
exp [eE][-+]?[0-9]+
|
| 3 |
+
frac "."[0-9]+
|
| 4 |
+
|
| 5 |
+
%%
|
| 6 |
+
\s+ /* skip whitespace */
|
| 7 |
+
|
| 8 |
+
{int}{frac}?{exp}?\b return 'NUMBER'
|
| 9 |
+
\"(?:'\\'[\\"bfnrt/]|'\\u'[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*\" yytext = yytext.substr(1,yyleng-2); return 'STRING'
|
| 10 |
+
|
| 11 |
+
"{" return '{'
|
| 12 |
+
"}" return '}'
|
| 13 |
+
"[" return '['
|
| 14 |
+
"]" return ']'
|
| 15 |
+
"," return ','
|
| 16 |
+
":" return ':'
|
| 17 |
+
"true" return 'TRUE'
|
| 18 |
+
"false" return 'FALSE'
|
| 19 |
+
"null" return 'NULL'
|
| 20 |
+
<<EOF>> return 'EOF'
|
| 21 |
+
. return 'INVALID'
|
| 22 |
+
|
| 23 |
+
%%
|
| 24 |
+
|
node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.y
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
%start JSONText
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
ECMA-262 5th Edition, 15.12.1 The JSON Grammar.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
%%
|
| 9 |
+
|
| 10 |
+
JSONString
|
| 11 |
+
: STRING
|
| 12 |
+
{ // replace escaped characters with actual character
|
| 13 |
+
$$ = new String(yytext.replace(/\\(\\|")/g, "$"+"1")
|
| 14 |
+
.replace(/\\n/g,'\n')
|
| 15 |
+
.replace(/\\r/g,'\r')
|
| 16 |
+
.replace(/\\t/g,'\t')
|
| 17 |
+
.replace(/\\v/g,'\v')
|
| 18 |
+
.replace(/\\f/g,'\f')
|
| 19 |
+
.replace(/\\b/g,'\b'));
|
| 20 |
+
$$.__line__ = @$.first_line;
|
| 21 |
+
}
|
| 22 |
+
;
|
| 23 |
+
|
| 24 |
+
JSONNumber
|
| 25 |
+
: NUMBER
|
| 26 |
+
{
|
| 27 |
+
$$ = new Number(yytext);
|
| 28 |
+
$$.__line__ = @$.first_line;
|
| 29 |
+
}
|
| 30 |
+
;
|
| 31 |
+
|
| 32 |
+
JSONNullLiteral
|
| 33 |
+
: NULL
|
| 34 |
+
{
|
| 35 |
+
$$ = null;
|
| 36 |
+
}
|
| 37 |
+
;
|
| 38 |
+
|
| 39 |
+
JSONBooleanLiteral
|
| 40 |
+
: TRUE
|
| 41 |
+
{
|
| 42 |
+
$$ = new Boolean(true);
|
| 43 |
+
$$.__line__ = @$.first_line;
|
| 44 |
+
}
|
| 45 |
+
| FALSE
|
| 46 |
+
{
|
| 47 |
+
$$ = new Boolean(false);
|
| 48 |
+
$$.__line__ = @$.first_line;
|
| 49 |
+
}
|
| 50 |
+
;
|
| 51 |
+
|
| 52 |
+
JSONText
|
| 53 |
+
: JSONValue EOF
|
| 54 |
+
{return $$ = $1;}
|
| 55 |
+
;
|
| 56 |
+
|
| 57 |
+
JSONValue
|
| 58 |
+
: JSONNullLiteral
|
| 59 |
+
| JSONBooleanLiteral
|
| 60 |
+
| JSONString
|
| 61 |
+
| JSONNumber
|
| 62 |
+
| JSONObject
|
| 63 |
+
| JSONArray
|
| 64 |
+
;
|
| 65 |
+
|
| 66 |
+
JSONObject
|
| 67 |
+
: '{' '}'
|
| 68 |
+
{$$ = {}; Object.defineProperty($$, '__line__', {
|
| 69 |
+
value: @$.first_line,
|
| 70 |
+
enumerable: false
|
| 71 |
+
})}
|
| 72 |
+
| '{' JSONMemberList '}'
|
| 73 |
+
{$$ = $2; Object.defineProperty($$, '__line__', {
|
| 74 |
+
value: @$.first_line,
|
| 75 |
+
enumerable: false
|
| 76 |
+
})}
|
| 77 |
+
;
|
| 78 |
+
|
| 79 |
+
JSONMember
|
| 80 |
+
: JSONString ':' JSONValue
|
| 81 |
+
{$$ = [$1, $3];}
|
| 82 |
+
;
|
| 83 |
+
|
| 84 |
+
JSONMemberList
|
| 85 |
+
: JSONMember
|
| 86 |
+
{{$$ = {}; $$[$1[0]] = $1[1];}}
|
| 87 |
+
| JSONMemberList ',' JSONMember
|
| 88 |
+
{$$ = $1; $1[$3[0]] = $3[1];}
|
| 89 |
+
;
|
| 90 |
+
|
| 91 |
+
JSONArray
|
| 92 |
+
: '[' ']'
|
| 93 |
+
{$$ = []; Object.defineProperty($$, '__line__', {
|
| 94 |
+
value: @$.first_line,
|
| 95 |
+
enumerable: false
|
| 96 |
+
})}
|
| 97 |
+
| '[' JSONElementList ']'
|
| 98 |
+
{$$ = $2; Object.defineProperty($$, '__line__', {
|
| 99 |
+
value: @$.first_line,
|
| 100 |
+
enumerable: false
|
| 101 |
+
})}
|
| 102 |
+
;
|
| 103 |
+
|
| 104 |
+
JSONElementList
|
| 105 |
+
: JSONValue
|
| 106 |
+
{$$ = [$1];}
|
| 107 |
+
| JSONElementList ',' JSONValue
|
| 108 |
+
{$$ = $1; $1.push($3);}
|
| 109 |
+
;
|
| 110 |
+
|
node_modules/@mapbox/jsonlint-lines-primitives/test/all-tests.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var fs = require("fs"),
|
| 2 |
+
assert = require("assert"),
|
| 3 |
+
parser = require("../lib/jsonlint").parser;
|
| 4 |
+
|
| 5 |
+
exports["test string with line break"] = function () {
|
| 6 |
+
var json = '{"foo": "bar\nbar"}';
|
| 7 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 8 |
+
};
|
| 9 |
+
|
| 10 |
+
exports["test string literal"] = function () {
|
| 11 |
+
var json = '"foo"';
|
| 12 |
+
assert.equal(parser.parse(json), "foo");
|
| 13 |
+
assert.equal(parser.parse(json).__line__, 1);
|
| 14 |
+
};
|
| 15 |
+
|
| 16 |
+
exports["test number literal"] = function () {
|
| 17 |
+
var json = '1234';
|
| 18 |
+
assert.equal(parser.parse(json), 1234);
|
| 19 |
+
assert.equal(parser.parse(json).__line__, 1);
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
exports["test null literal"] = function () {
|
| 23 |
+
var json = 'null';
|
| 24 |
+
assert.equal(parser.parse(json), null);
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
exports["test boolean literal"] = function () {
|
| 28 |
+
var json = 'true';
|
| 29 |
+
assert.equal(parser.parse(json), true);
|
| 30 |
+
assert.equal(parser.parse(json).__line__, 1);
|
| 31 |
+
};
|
| 32 |
+
|
| 33 |
+
exports["test unclosed array"] = function () {
|
| 34 |
+
var json = fs.readFileSync(__dirname + "/fails/2.json").toString();
|
| 35 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 36 |
+
};
|
| 37 |
+
|
| 38 |
+
exports["test unquotedkey keys must be quoted"] = function () {
|
| 39 |
+
var json = fs.readFileSync(__dirname + "/fails/3.json").toString();
|
| 40 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports["test extra comma"] = function () {
|
| 44 |
+
var json = fs.readFileSync(__dirname + "/fails/4.json").toString();
|
| 45 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports["test double extra comma"] = function () {
|
| 49 |
+
var json = fs.readFileSync(__dirname + "/fails/5.json").toString();
|
| 50 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports["test missing value"] = function () {
|
| 54 |
+
var json = fs.readFileSync(__dirname + "/fails/6.json").toString();
|
| 55 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
exports["test comma after the close"] = function () {
|
| 59 |
+
var json = fs.readFileSync(__dirname + "/fails/7.json").toString();
|
| 60 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
exports["test extra close"] = function () {
|
| 64 |
+
var json = fs.readFileSync(__dirname + "/fails/8.json").toString();
|
| 65 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports["test extra comma after value"] = function () {
|
| 69 |
+
var json = fs.readFileSync(__dirname + "/fails/9.json").toString();
|
| 70 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 71 |
+
};
|
| 72 |
+
|
| 73 |
+
exports["test extra value after close with misplaced quotes"] = function () {
|
| 74 |
+
var json = fs.readFileSync(__dirname + "/fails/10.json").toString();
|
| 75 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 76 |
+
};
|
| 77 |
+
|
| 78 |
+
exports["test illegal expression addition"] = function () {
|
| 79 |
+
var json = fs.readFileSync(__dirname + "/fails/11.json").toString();
|
| 80 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 81 |
+
};
|
| 82 |
+
|
| 83 |
+
exports["test illegal invocation of alert"] = function () {
|
| 84 |
+
var json = fs.readFileSync(__dirname + "/fails/12.json").toString();
|
| 85 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 86 |
+
};
|
| 87 |
+
|
| 88 |
+
exports["test numbers cannot have leading zeroes"] = function () {
|
| 89 |
+
var json = fs.readFileSync(__dirname + "/fails/13.json").toString();
|
| 90 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
exports["test numbers cannot be hex"] = function () {
|
| 94 |
+
var json = fs.readFileSync(__dirname + "/fails/14.json").toString();
|
| 95 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
exports["test illegal backslash escape \\0"] = function () {
|
| 99 |
+
var json = fs.readFileSync(__dirname + "/fails/15.json").toString();
|
| 100 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 101 |
+
};
|
| 102 |
+
|
| 103 |
+
exports["test unquoted text"] = function () {
|
| 104 |
+
var json = fs.readFileSync(__dirname + "/fails/16.json").toString();
|
| 105 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 106 |
+
};
|
| 107 |
+
|
| 108 |
+
exports["test illegal backslash escape \\x"] = function () {
|
| 109 |
+
var json = fs.readFileSync(__dirname + "/fails/17.json").toString();
|
| 110 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 111 |
+
};
|
| 112 |
+
|
| 113 |
+
exports["test missing colon"] = function () {
|
| 114 |
+
var json = fs.readFileSync(__dirname + "/fails/19.json")
|
| 115 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 116 |
+
};
|
| 117 |
+
|
| 118 |
+
exports["test double colon"] = function () {
|
| 119 |
+
var json = fs.readFileSync(__dirname + "/fails/20.json").toString();
|
| 120 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
exports["test comma instead of colon"] = function () {
|
| 124 |
+
var json = fs.readFileSync(__dirname + "/fails/21.json").toString();
|
| 125 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 126 |
+
};
|
| 127 |
+
|
| 128 |
+
exports["test colon instead of comma"] = function () {
|
| 129 |
+
var json = fs.readFileSync(__dirname + "/fails/22.json").toString();
|
| 130 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
exports["test bad raw value"] = function () {
|
| 134 |
+
var json = fs.readFileSync(__dirname + "/fails/23.json").toString();
|
| 135 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 136 |
+
};
|
| 137 |
+
|
| 138 |
+
exports["test single quotes"] = function () {
|
| 139 |
+
var json = fs.readFileSync(__dirname + "/fails/24.json").toString();
|
| 140 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 141 |
+
};
|
| 142 |
+
|
| 143 |
+
exports["test tab character in string"] = function () {
|
| 144 |
+
var json = fs.readFileSync(__dirname + "/fails/25.json").toString();
|
| 145 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 146 |
+
};
|
| 147 |
+
|
| 148 |
+
exports["test tab character in string 2"] = function () {
|
| 149 |
+
var json = fs.readFileSync(__dirname + "/fails/26.json").toString();
|
| 150 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 151 |
+
};
|
| 152 |
+
|
| 153 |
+
exports["test line break in string"] = function () {
|
| 154 |
+
var json = fs.readFileSync(__dirname + "/fails/27.json").toString();
|
| 155 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 156 |
+
};
|
| 157 |
+
|
| 158 |
+
exports["test line break in string in array"] = function () {
|
| 159 |
+
var json = fs.readFileSync(__dirname + "/fails/28.json").toString();
|
| 160 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 161 |
+
};
|
| 162 |
+
|
| 163 |
+
exports["test 0e"] = function () {
|
| 164 |
+
var json = fs.readFileSync(__dirname + "/fails/29.json").toString();
|
| 165 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 166 |
+
};
|
| 167 |
+
|
| 168 |
+
exports["test 0e+"] = function () {
|
| 169 |
+
var json = fs.readFileSync(__dirname + "/fails/30.json").toString();
|
| 170 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 171 |
+
};
|
| 172 |
+
|
| 173 |
+
exports["test 0e+ 1"] = function () {
|
| 174 |
+
var json = fs.readFileSync(__dirname + "/fails/31.json").toString();
|
| 175 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 176 |
+
};
|
| 177 |
+
|
| 178 |
+
exports["test comma instead of closing brace"] = function () {
|
| 179 |
+
var json = fs.readFileSync(__dirname + "/fails/32.json").toString();
|
| 180 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 181 |
+
};
|
| 182 |
+
|
| 183 |
+
exports["test bracket mismatch"] = function () {
|
| 184 |
+
var json = fs.readFileSync(__dirname + "/fails/33.json").toString();
|
| 185 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
exports["test extra brace"] = function () {
|
| 189 |
+
var json = fs.readFileSync(__dirname + "/fails/34.json").toString();
|
| 190 |
+
assert["throws"](function () {parser.parse(json)}, "should throw error");
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
exports["test pass-1"] = function () {
|
| 194 |
+
var json = fs.readFileSync(__dirname + "/passes/1.json").toString();
|
| 195 |
+
assert.doesNotThrow(function () {parser.parse(json)}, "should pass");
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
exports["test pass-2"] = function () {
|
| 199 |
+
var json = fs.readFileSync(__dirname + "/passes/2.json").toString();
|
| 200 |
+
assert.doesNotThrow(function () {parser.parse(json)}, "should pass");
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
exports["test pass-3"] = function () {
|
| 204 |
+
var json = fs.readFileSync(__dirname + "/passes/3.json").toString();
|
| 205 |
+
assert.doesNotThrow(function () {parser.parse(json)}, "should pass");
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
if (require.main === module) {
|
| 209 |
+
require("test").run(exports);
|
| 210 |
+
}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/10.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Extra value after close": true} "misplaced quoted value"
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/11.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Illegal expression": 1 + 2}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/12.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Illegal invocation": alert()}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/13.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Numbers cannot have leading zeroes": 013}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/14.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Numbers cannot be hex": 0x14}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/15.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Illegal backslash escape: \x15"]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/16.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[\naked]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/17.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Illegal backslash escape: \017"]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/19.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Missing colon" null}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/2.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Unclosed array"
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/20.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Double colon":: null}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/21.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Comma instead of colon", null}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/22.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Colon instead of comma": false]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/23.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Bad value", truth]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/24.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
['single quote']
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/25.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[" tab character in string "]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/26.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["tab\ character\ in\ string\ "]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/27.json
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
["line
|
| 2 |
+
break"]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/28.json
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
["line\
|
| 2 |
+
break"]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/29.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[0e]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/3.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{unquoted_key: "keys must be quoted"}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/30.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[0e+]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/31.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[0e+-1]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/32.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Comma instead if closing brace": true,
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/33.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["mismatch"}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/34.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"extra brace": 1}}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/4.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["extra comma",]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/5.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["double extra comma",,]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/6.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[ , "<-- missing value"]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/7.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Comma after the close"],
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/8.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["Extra close"]]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/9.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Extra comma": true,}
|
node_modules/@mapbox/jsonlint-lines-primitives/test/passes/1.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
"JSON Test Pattern pass1",
|
| 3 |
+
{"object with 1 member":["array with 1 element"]},
|
| 4 |
+
{},
|
| 5 |
+
[],
|
| 6 |
+
-42,
|
| 7 |
+
true,
|
| 8 |
+
false,
|
| 9 |
+
null,
|
| 10 |
+
{
|
| 11 |
+
"integer": 1234567890,
|
| 12 |
+
"real": -9876.543210,
|
| 13 |
+
"e": 0.123456789e-12,
|
| 14 |
+
"E": 1.234567890E+34,
|
| 15 |
+
"": 23456789012E66,
|
| 16 |
+
"zero": 0,
|
| 17 |
+
"one": 1,
|
| 18 |
+
"space": " ",
|
| 19 |
+
"quote": "\"",
|
| 20 |
+
"backslash": "\\",
|
| 21 |
+
"controls": "\b\f\n\r\t",
|
| 22 |
+
"slash": "/ & \/",
|
| 23 |
+
"alpha": "abcdefghijklmnopqrstuvwyz",
|
| 24 |
+
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
|
| 25 |
+
"digit": "0123456789",
|
| 26 |
+
"0123456789": "digit",
|
| 27 |
+
"special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
|
| 28 |
+
"hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
|
| 29 |
+
"true": true,
|
| 30 |
+
"false": false,
|
| 31 |
+
"null": null,
|
| 32 |
+
"array":[ ],
|
| 33 |
+
"object":{ },
|
| 34 |
+
"address": "50 St. James Street",
|
| 35 |
+
"url": "http://www.JSON.org/",
|
| 36 |
+
"comment": "// /* <!-- --",
|
| 37 |
+
"# -- --> */": " ",
|
| 38 |
+
" s p a c e d " :[1,2 , 3
|
| 39 |
+
|
| 40 |
+
,
|
| 41 |
+
|
| 42 |
+
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
|
| 43 |
+
"jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
|
| 44 |
+
"quotes": "" \u0022 %22 0x22 034 "",
|
| 45 |
+
"\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
|
| 46 |
+
: "A key can be any string"
|
| 47 |
+
},
|
| 48 |
+
0.5 ,98.6
|
| 49 |
+
,
|
| 50 |
+
99.44
|
| 51 |
+
,
|
| 52 |
+
|
| 53 |
+
1066,
|
| 54 |
+
1e1,
|
| 55 |
+
0.1e1,
|
| 56 |
+
1e-1,
|
| 57 |
+
1e00,2e+00,2e-00
|
| 58 |
+
,"rosebud"]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/passes/2.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
|
node_modules/@mapbox/jsonlint-lines-primitives/test/passes/3.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"JSON Test Pattern pass3": {
|
| 3 |
+
"The outermost value": "must be an object or array.",
|
| 4 |
+
"In this test": "It is an object."
|
| 5 |
+
}
|
| 6 |
+
}
|