json5 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +60 -0
- data/Rakefile +1 -0
- data/json5.gemspec +25 -0
- data/lib/json5.rb +13 -0
- data/lib/json5/parser.rb +461 -0
- data/lib/json5/stringifier.rb +242 -0
- data/lib/json5/version.rb +3 -0
- data/spec/json5/parse_spec.rb +71 -0
- data/spec/parse-cases/arrays/empty-array.json +1 -0
- data/spec/parse-cases/arrays/leading-comma-array.js +3 -0
- data/spec/parse-cases/arrays/lone-trailing-comma-array.js +3 -0
- data/spec/parse-cases/arrays/no-comma-array.txt +4 -0
- data/spec/parse-cases/arrays/regular-array.json +5 -0
- data/spec/parse-cases/arrays/trailing-comma-array.json5 +3 -0
- data/spec/parse-cases/comments/block-comment-following-array-element.json5 +6 -0
- data/spec/parse-cases/comments/block-comment-following-top-level-value.json5 +5 -0
- data/spec/parse-cases/comments/block-comment-in-string.json +1 -0
- data/spec/parse-cases/comments/block-comment-preceding-top-level-value.json5 +5 -0
- data/spec/parse-cases/comments/block-comment-with-asterisks.json5 +7 -0
- data/spec/parse-cases/comments/inline-comment-following-array-element.json5 +3 -0
- data/spec/parse-cases/comments/inline-comment-following-top-level-value.json5 +1 -0
- data/spec/parse-cases/comments/inline-comment-in-string.json +1 -0
- data/spec/parse-cases/comments/inline-comment-preceding-top-level-value.json5 +2 -0
- data/spec/parse-cases/comments/top-level-block-comment.txt +4 -0
- data/spec/parse-cases/comments/top-level-inline-comment.txt +1 -0
- data/spec/parse-cases/comments/unterminated-block-comment.txt +5 -0
- data/spec/parse-cases/misc/empty.txt +0 -0
- data/spec/parse-cases/misc/npm-package.json +106 -0
- data/spec/parse-cases/misc/npm-package.json5 +106 -0
- data/spec/parse-cases/misc/readme-example.json5 +25 -0
- data/spec/parse-cases/numbers/binary-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/float-leading-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/float-leading-zero.json +1 -0
- data/spec/parse-cases/numbers/float-trailing-decimal-point-with-integer-exponent.json5.todo +1 -0
- data/spec/parse-cases/numbers/float-trailing-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/float-with-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/float.json +1 -0
- data/spec/parse-cases/numbers/hexadecimal-empty.txt +1 -0
- data/spec/parse-cases/numbers/hexadecimal-lowercase-letter.json5 +1 -0
- data/spec/parse-cases/numbers/hexadecimal-uppercase-x.json5 +1 -0
- data/spec/parse-cases/numbers/hexadecimal-with-integer-exponent.json5 +1 -0
- data/spec/parse-cases/numbers/hexadecimal.json5 +1 -0
- data/spec/parse-cases/numbers/infinity.json5 +1 -0
- data/spec/parse-cases/numbers/integer-with-float-exponent.txt +1 -0
- data/spec/parse-cases/numbers/integer-with-hexadecimal-exponent.txt +1 -0
- data/spec/parse-cases/numbers/integer-with-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/integer-with-negative-float-exponent.txt +1 -0
- data/spec/parse-cases/numbers/integer-with-negative-hexadecimal-exponent.txt +1 -0
- data/spec/parse-cases/numbers/integer-with-negative-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/integer-with-negative-zero-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/integer-with-positive-float-exponent.txt +1 -0
- data/spec/parse-cases/numbers/integer-with-positive-hexadecimal-exponent.txt +1 -0
- data/spec/parse-cases/numbers/integer-with-positive-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/integer-with-positive-zero-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/integer-with-zero-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/integer.json +1 -0
- data/spec/parse-cases/numbers/lone-decimal-point.txt +1 -0
- data/spec/parse-cases/numbers/nan.json5 +1 -0
- data/spec/parse-cases/numbers/negative-binary-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/negative-float-leading-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/negative-float-leading-zero.json +1 -0
- data/spec/parse-cases/numbers/negative-float-trailing-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/negative-float.json +1 -0
- data/spec/parse-cases/numbers/negative-hexadecimal.js +1 -0
- data/spec/parse-cases/numbers/negative-infinity.json5 +1 -0
- data/spec/parse-cases/numbers/negative-integer.json +1 -0
- data/spec/parse-cases/numbers/negative-noctal.js +1 -0
- data/spec/parse-cases/numbers/negative-octal-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/negative-octal.txt +1 -0
- data/spec/parse-cases/numbers/negative-zero-binary-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/negative-zero-float-leading-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/negative-zero-float-trailing-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/negative-zero-float.json +1 -0
- data/spec/parse-cases/numbers/negative-zero-hexadecimal.js +1 -0
- data/spec/parse-cases/numbers/negative-zero-integer.json +1 -0
- data/spec/parse-cases/numbers/negative-zero-octal-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/negative-zero-octal.txt +1 -0
- data/spec/parse-cases/numbers/noctal-with-leading-octal-digit.js +1 -0
- data/spec/parse-cases/numbers/noctal.js +1 -0
- data/spec/parse-cases/numbers/octal-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/octal.txt +1 -0
- data/spec/parse-cases/numbers/positive-binary-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/positive-float-leading-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/positive-float-leading-zero.json5 +1 -0
- data/spec/parse-cases/numbers/positive-float-trailing-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/positive-float.json5 +1 -0
- data/spec/parse-cases/numbers/positive-hexadecimal.js +1 -0
- data/spec/parse-cases/numbers/positive-infinity.json5 +1 -0
- data/spec/parse-cases/numbers/positive-integer.json5 +1 -0
- data/spec/parse-cases/numbers/positive-noctal.js +1 -0
- data/spec/parse-cases/numbers/positive-octal-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/positive-octal.txt +1 -0
- data/spec/parse-cases/numbers/positive-zero-binary-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/positive-zero-float-leading-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/positive-zero-float-trailing-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/positive-zero-float.json5 +1 -0
- data/spec/parse-cases/numbers/positive-zero-hexadecimal.js +1 -0
- data/spec/parse-cases/numbers/positive-zero-integer.json5 +1 -0
- data/spec/parse-cases/numbers/positive-zero-octal-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/positive-zero-octal.txt +1 -0
- data/spec/parse-cases/numbers/zero-binary-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/zero-float-leading-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/zero-float-trailing-decimal-point.json5 +1 -0
- data/spec/parse-cases/numbers/zero-float.json +1 -0
- data/spec/parse-cases/numbers/zero-hexadecimal.json5 +1 -0
- data/spec/parse-cases/numbers/zero-integer-with-integer-exponent.json +1 -0
- data/spec/parse-cases/numbers/zero-integer.json +1 -0
- data/spec/parse-cases/numbers/zero-octal-coffeescript.txt +1 -0
- data/spec/parse-cases/numbers/zero-octal.txt +1 -0
- data/spec/parse-cases/objects/empty-object.json +1 -0
- data/spec/parse-cases/objects/illegal-unquoted-key-number.txt +3 -0
- data/spec/parse-cases/objects/illegal-unquoted-key-symbol.txt +3 -0
- data/spec/parse-cases/objects/leading-comma-object.txt +3 -0
- data/spec/parse-cases/objects/lone-trailing-comma-object.txt +3 -0
- data/spec/parse-cases/objects/no-comma-object.txt +4 -0
- data/spec/parse-cases/objects/reserved-unquoted-key.json5 +3 -0
- data/spec/parse-cases/objects/single-quoted-key.json5 +3 -0
- data/spec/parse-cases/objects/trailing-comma-object.json5 +3 -0
- data/spec/parse-cases/objects/unquoted-keys.json5 +8 -0
- data/spec/parse-cases/strings/escaped-single-quoted-string.json5 +1 -0
- data/spec/parse-cases/strings/multi-line-string.json5 +2 -0
- data/spec/parse-cases/strings/single-quoted-string.json5 +1 -0
- data/spec/parse-cases/strings/unescaped-multi-line-string.txt +2 -0
- data/spec/parse-cases/todo/unicode-escaped-unquoted-key.json5.todo +3 -0
- data/spec/parse-cases/todo/unicode-unquoted-key.json5.todo +3 -0
- data/spec/spec_helper.rb +15 -0
- metadata +363 -0
@@ -0,0 +1,106 @@
|
|
1
|
+
{
|
2
|
+
name: 'npm',
|
3
|
+
publishConfig: {
|
4
|
+
'proprietary-attribs': false,
|
5
|
+
},
|
6
|
+
description: 'A package manager for node',
|
7
|
+
keywords: [
|
8
|
+
'package manager',
|
9
|
+
'modules',
|
10
|
+
'install',
|
11
|
+
'package.json',
|
12
|
+
],
|
13
|
+
version: '1.1.22',
|
14
|
+
preferGlobal: true,
|
15
|
+
config: {
|
16
|
+
publishtest: false,
|
17
|
+
},
|
18
|
+
homepage: 'http://npmjs.org/',
|
19
|
+
author: 'Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)',
|
20
|
+
repository: {
|
21
|
+
type: 'git',
|
22
|
+
url: 'https://github.com/isaacs/npm',
|
23
|
+
},
|
24
|
+
bugs: {
|
25
|
+
email: 'npm-@googlegroups.com',
|
26
|
+
url: 'http://github.com/isaacs/npm/issues',
|
27
|
+
},
|
28
|
+
directories: {
|
29
|
+
doc: './doc',
|
30
|
+
man: './man',
|
31
|
+
lib: './lib',
|
32
|
+
bin: './bin',
|
33
|
+
},
|
34
|
+
main: './lib/npm.js',
|
35
|
+
bin: './bin/npm-cli.js',
|
36
|
+
dependencies: {
|
37
|
+
semver: '~1.0.14',
|
38
|
+
ini: '1',
|
39
|
+
slide: '1',
|
40
|
+
abbrev: '1',
|
41
|
+
'graceful-fs': '~1.1.1',
|
42
|
+
minimatch: '~0.2',
|
43
|
+
nopt: '1',
|
44
|
+
'node-uuid': '~1.3',
|
45
|
+
'proto-list': '1',
|
46
|
+
rimraf: '2',
|
47
|
+
request: '~2.9',
|
48
|
+
which: '1',
|
49
|
+
tar: '~0.1.12',
|
50
|
+
fstream: '~0.1.17',
|
51
|
+
'block-stream': '*',
|
52
|
+
inherits: '1',
|
53
|
+
mkdirp: '0.3',
|
54
|
+
read: '0',
|
55
|
+
'lru-cache': '1',
|
56
|
+
'node-gyp': '~0.4.1',
|
57
|
+
'fstream-npm': '0 >=0.0.5',
|
58
|
+
'uid-number': '0',
|
59
|
+
archy: '0',
|
60
|
+
chownr: '0',
|
61
|
+
},
|
62
|
+
bundleDependencies: [
|
63
|
+
'slide',
|
64
|
+
'ini',
|
65
|
+
'semver',
|
66
|
+
'abbrev',
|
67
|
+
'graceful-fs',
|
68
|
+
'minimatch',
|
69
|
+
'nopt',
|
70
|
+
'node-uuid',
|
71
|
+
'rimraf',
|
72
|
+
'request',
|
73
|
+
'proto-list',
|
74
|
+
'which',
|
75
|
+
'tar',
|
76
|
+
'fstream',
|
77
|
+
'block-stream',
|
78
|
+
'inherits',
|
79
|
+
'mkdirp',
|
80
|
+
'read',
|
81
|
+
'lru-cache',
|
82
|
+
'node-gyp',
|
83
|
+
'fstream-npm',
|
84
|
+
'uid-number',
|
85
|
+
'archy',
|
86
|
+
'chownr',
|
87
|
+
],
|
88
|
+
devDependencies: {
|
89
|
+
ronn: 'https://github.com/isaacs/ronnjs/tarball/master',
|
90
|
+
},
|
91
|
+
engines: {
|
92
|
+
node: '0.6 || 0.7 || 0.8',
|
93
|
+
npm: '1',
|
94
|
+
},
|
95
|
+
scripts: {
|
96
|
+
test: 'node ./test/run.js',
|
97
|
+
prepublish: 'npm prune; rm -rf node_modules/*/{test,example,bench}*; make -j4 doc',
|
98
|
+
dumpconf: 'env | grep npm | sort | uniq',
|
99
|
+
},
|
100
|
+
licenses: [
|
101
|
+
{
|
102
|
+
type: 'MIT +no-false-attribs',
|
103
|
+
url: 'http://github.com/isaacs/npm/raw/master/LICENSE',
|
104
|
+
},
|
105
|
+
],
|
106
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
foo: 'bar',
|
3
|
+
while: true,
|
4
|
+
|
5
|
+
this: 'is a \
|
6
|
+
multi-line string',
|
7
|
+
|
8
|
+
// this is an inline comment
|
9
|
+
here: 'is another', // inline comment
|
10
|
+
|
11
|
+
/* this is a block comment
|
12
|
+
that continues on another line */
|
13
|
+
|
14
|
+
hex: 0xDEADbeef,
|
15
|
+
half: .5,
|
16
|
+
delta: +10,
|
17
|
+
to: Infinity, // and beyond!
|
18
|
+
|
19
|
+
finally: 'a trailing comma',
|
20
|
+
oh: [
|
21
|
+
"we shouldn't forget",
|
22
|
+
'arrays can have',
|
23
|
+
'trailing commas too',
|
24
|
+
],
|
25
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
0b100
|
@@ -0,0 +1 @@
|
|
1
|
+
.5
|
@@ -0,0 +1 @@
|
|
1
|
+
0.5
|
@@ -0,0 +1 @@
|
|
1
|
+
5.e4
|
@@ -0,0 +1 @@
|
|
1
|
+
5.
|
@@ -0,0 +1 @@
|
|
1
|
+
1.2e3
|
@@ -0,0 +1 @@
|
|
1
|
+
1.2
|
@@ -0,0 +1 @@
|
|
1
|
+
0x
|
@@ -0,0 +1 @@
|
|
1
|
+
0xc8
|
@@ -0,0 +1 @@
|
|
1
|
+
0XC8
|
@@ -0,0 +1 @@
|
|
1
|
+
0xc8e4
|
@@ -0,0 +1 @@
|
|
1
|
+
0xC8
|
@@ -0,0 +1 @@
|
|
1
|
+
Infinity
|
@@ -0,0 +1 @@
|
|
1
|
+
1e2.3
|
@@ -0,0 +1 @@
|
|
1
|
+
1e0x4
|
@@ -0,0 +1 @@
|
|
1
|
+
2e23
|
@@ -0,0 +1 @@
|
|
1
|
+
1e-2.3
|
@@ -0,0 +1 @@
|
|
1
|
+
1e-0x4
|
@@ -0,0 +1 @@
|
|
1
|
+
2e-23
|
@@ -0,0 +1 @@
|
|
1
|
+
5e-0
|
@@ -0,0 +1 @@
|
|
1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