ruby-json 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/COPYING +504 -0
  2. data/README +16 -0
  3. data/doc/classes/Array.html +162 -0
  4. data/doc/classes/Array.src/M000011.html +27 -0
  5. data/doc/classes/Array.src/M000012.html +32 -0
  6. data/doc/classes/ArrayTest.html +129 -0
  7. data/doc/classes/ArrayTest.src/M000014.html +28 -0
  8. data/doc/classes/FalseClass.html +131 -0
  9. data/doc/classes/FalseClass.src/M000013.html +18 -0
  10. data/doc/classes/Hash.html +156 -0
  11. data/doc/classes/Hash.src/M000009.html +29 -0
  12. data/doc/classes/Hash.src/M000010.html +45 -0
  13. data/doc/classes/JSON.html +103 -0
  14. data/doc/classes/JSON/Lexer.html +411 -0
  15. data/doc/classes/JSON/Lexer.src/M000022.html +19 -0
  16. data/doc/classes/JSON/Lexer.src/M000023.html +18 -0
  17. data/doc/classes/JSON/Lexer.src/M000024.html +18 -0
  18. data/doc/classes/JSON/Lexer.src/M000025.html +20 -0
  19. data/doc/classes/JSON/Lexer.src/M000026.html +20 -0
  20. data/doc/classes/JSON/Lexer.src/M000027.html +21 -0
  21. data/doc/classes/JSON/Lexer.src/M000028.html +43 -0
  22. data/doc/classes/JSON/Lexer.src/M000029.html +67 -0
  23. data/doc/classes/JSON/Lexer.src/M000030.html +46 -0
  24. data/doc/classes/JSON/Lexer.src/M000031.html +26 -0
  25. data/doc/classes/JSON/Lexer.src/M000032.html +61 -0
  26. data/doc/classes/JSON/Lexer.src/M000033.html +29 -0
  27. data/doc/classes/JSON/Lexer.src/M000034.html +18 -0
  28. data/doc/classes/JSON/Lexer.src/M000035.html +19 -0
  29. data/doc/classes/JSON/Lexer.src/M000036.html +20 -0
  30. data/doc/classes/LexerTest.html +219 -0
  31. data/doc/classes/LexerTest.src/M000002.html +24 -0
  32. data/doc/classes/LexerTest.src/M000003.html +22 -0
  33. data/doc/classes/LexerTest.src/M000004.html +26 -0
  34. data/doc/classes/LexerTest.src/M000005.html +23 -0
  35. data/doc/classes/LexerTest.src/M000006.html +31 -0
  36. data/doc/classes/LexerTest.src/M000007.html +27 -0
  37. data/doc/classes/LexerTest.src/M000008.html +58 -0
  38. data/doc/classes/NilClass.html +131 -0
  39. data/doc/classes/NilClass.src/M000017.html +18 -0
  40. data/doc/classes/Numeric.html +131 -0
  41. data/doc/classes/Numeric.src/M000016.html +18 -0
  42. data/doc/classes/Object.html +176 -0
  43. data/doc/classes/Object.src/M000018.html +18 -0
  44. data/doc/classes/ObjectTest.html +129 -0
  45. data/doc/classes/ObjectTest.src/M000015.html +28 -0
  46. data/doc/classes/String.html +151 -0
  47. data/doc/classes/String.src/M000019.html +18 -0
  48. data/doc/classes/String.src/M000020.html +46 -0
  49. data/doc/classes/TrueClass.html +131 -0
  50. data/doc/classes/TrueClass.src/M000021.html +18 -0
  51. data/doc/created.rid +1 -0
  52. data/doc/files/install_rb.html +194 -0
  53. data/doc/files/install_rb.src/M000001.html +43 -0
  54. data/doc/files/json/lexer_rb.html +156 -0
  55. data/doc/files/json/objects_rb.html +154 -0
  56. data/doc/files/test/arraytest_rb.html +150 -0
  57. data/doc/files/test/lexertest_rb.html +150 -0
  58. data/doc/files/test/objtest_rb.html +150 -0
  59. data/doc/fr_class_index.html +39 -0
  60. data/doc/fr_file_index.html +32 -0
  61. data/doc/fr_method_index.html +62 -0
  62. data/doc/index.html +24 -0
  63. data/doc/rdoc-style.css +175 -0
  64. data/install.rb +67 -0
  65. data/lib/json/lexer.rb +297 -0
  66. data/lib/json/objects.rb +201 -0
  67. data/ruby-json.gemspec +25 -0
  68. data/test/arraytest.rb +45 -0
  69. data/test/lexertest.rb +146 -0
  70. data/test/objtest.rb +45 -0
  71. metadata +126 -0
@@ -0,0 +1,219 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: LexerTest</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <h1>LexerTest <sup class="type-note">(Class)</sup></h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>In:</strong></td>
54
+ <td>
55
+ <a href="../files/test/lexertest_rb.html">
56
+ test/lexertest.rb
57
+ </a>
58
+ <br />
59
+ </td>
60
+ </tr>
61
+
62
+ <tr class="top-aligned-row">
63
+ <td><strong>Parent:</strong></td>
64
+ <td>
65
+ Test::Unit::TestCase
66
+ </td>
67
+ </tr>
68
+ </table>
69
+ </div>
70
+ <!-- banner header -->
71
+
72
+ <div id="bodyContent">
73
+
74
+
75
+ <div id="contextContent">
76
+
77
+
78
+
79
+ <div id="method-list">
80
+ <h2 class="section-bar">Methods</h2>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000003">test_ending</a>&nbsp;&nbsp;
84
+ <a href="#M000002">test_nextchar_back</a>&nbsp;&nbsp;
85
+ <a href="#M000005">test_nextchars</a>&nbsp;&nbsp;
86
+ <a href="#M000006">test_nextclean</a>&nbsp;&nbsp;
87
+ <a href="#M000004">test_nextmatch</a>&nbsp;&nbsp;
88
+ <a href="#M000007">test_nextstring</a>&nbsp;&nbsp;
89
+ <a href="#M000008">test_nextvalue</a>&nbsp;&nbsp;
90
+ </div>
91
+ </div>
92
+
93
+
94
+
95
+
96
+
97
+
98
+ </div>
99
+
100
+
101
+
102
+ <!-- if includes -->
103
+
104
+
105
+ <!-- if method_list -->
106
+ <div id="methods">
107
+ <h2 class="section-bar">Public Instance methods</h2>
108
+
109
+ <div id="method-M000003" class="method-detail">
110
+ <a name="M000003"></a>
111
+
112
+ <div class="method-heading">
113
+ <a href="LexerTest.src/M000003.html" target="Code" class="method-signature"
114
+ onclick="popupCode('LexerTest.src/M000003.html');return false;">
115
+ <span class="method-name">test_ending</span><span class="method-args">()</span>
116
+ </a>
117
+ </div>
118
+
119
+ <div class="method-description">
120
+ </div>
121
+ </div>
122
+
123
+ <div id="method-M000002" class="method-detail">
124
+ <a name="M000002"></a>
125
+
126
+ <div class="method-heading">
127
+ <a href="LexerTest.src/M000002.html" target="Code" class="method-signature"
128
+ onclick="popupCode('LexerTest.src/M000002.html');return false;">
129
+ <span class="method-name">test_nextchar_back</span><span class="method-args">()</span>
130
+ </a>
131
+ </div>
132
+
133
+ <div class="method-description">
134
+ </div>
135
+ </div>
136
+
137
+ <div id="method-M000005" class="method-detail">
138
+ <a name="M000005"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="LexerTest.src/M000005.html" target="Code" class="method-signature"
142
+ onclick="popupCode('LexerTest.src/M000005.html');return false;">
143
+ <span class="method-name">test_nextchars</span><span class="method-args">()</span>
144
+ </a>
145
+ </div>
146
+
147
+ <div class="method-description">
148
+ </div>
149
+ </div>
150
+
151
+ <div id="method-M000006" class="method-detail">
152
+ <a name="M000006"></a>
153
+
154
+ <div class="method-heading">
155
+ <a href="LexerTest.src/M000006.html" target="Code" class="method-signature"
156
+ onclick="popupCode('LexerTest.src/M000006.html');return false;">
157
+ <span class="method-name">test_nextclean</span><span class="method-args">()</span>
158
+ </a>
159
+ </div>
160
+
161
+ <div class="method-description">
162
+ </div>
163
+ </div>
164
+
165
+ <div id="method-M000004" class="method-detail">
166
+ <a name="M000004"></a>
167
+
168
+ <div class="method-heading">
169
+ <a href="LexerTest.src/M000004.html" target="Code" class="method-signature"
170
+ onclick="popupCode('LexerTest.src/M000004.html');return false;">
171
+ <span class="method-name">test_nextmatch</span><span class="method-args">()</span>
172
+ </a>
173
+ </div>
174
+
175
+ <div class="method-description">
176
+ </div>
177
+ </div>
178
+
179
+ <div id="method-M000007" class="method-detail">
180
+ <a name="M000007"></a>
181
+
182
+ <div class="method-heading">
183
+ <a href="LexerTest.src/M000007.html" target="Code" class="method-signature"
184
+ onclick="popupCode('LexerTest.src/M000007.html');return false;">
185
+ <span class="method-name">test_nextstring</span><span class="method-args">()</span>
186
+ </a>
187
+ </div>
188
+
189
+ <div class="method-description">
190
+ </div>
191
+ </div>
192
+
193
+ <div id="method-M000008" class="method-detail">
194
+ <a name="M000008"></a>
195
+
196
+ <div class="method-heading">
197
+ <a href="LexerTest.src/M000008.html" target="Code" class="method-signature"
198
+ onclick="popupCode('LexerTest.src/M000008.html');return false;">
199
+ <span class="method-name">test_nextvalue</span><span class="method-args">()</span>
200
+ </a>
201
+ </div>
202
+
203
+ <div class="method-description">
204
+ </div>
205
+ </div>
206
+
207
+
208
+ </div>
209
+
210
+
211
+ </div>
212
+
213
+
214
+ <div id="validator-badges">
215
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
216
+ </div>
217
+
218
+ </body>
219
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_nextchar_back (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 33</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_nextchar_back</span>
15
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;some_string&quot;</span>
16
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
17
+ <span class="ruby-identifier">c</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextchar</span>
18
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'s'</span>, <span class="ruby-value str">&quot;wrong character read&quot;</span>)
19
+ <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">back</span>
20
+ <span class="ruby-identifier">c</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextchar</span>
21
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'s'</span>, <span class="ruby-value str">&quot;backing up produces inconsistent results&quot;</span>)
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_ending (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 43</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ending</span>
15
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;ab&quot;</span>)
16
+ <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextchar</span>
17
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">more?</span>, <span class="ruby-value str">&quot;more? method produces wrong results (no more when there should be more)&quot;</span>)
18
+ <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextchar</span>
19
+ <span class="ruby-identifier">assert</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">lex</span>.<span class="ruby-identifier">more?</span>, <span class="ruby-value str">&quot;more? method produces wrong results (more when there are no more)&quot;</span>)
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_nextmatch (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 51</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_nextmatch</span>
15
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;abc&quot;</span>)
16
+ <span class="ruby-identifier">c</span> = <span class="ruby-value str">&quot;&quot;</span>
17
+ <span class="ruby-identifier">assert_nothing_raised</span> {
18
+ <span class="ruby-identifier">c</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextmatch</span>(<span class="ruby-value str">'a'</span>)
19
+ }
20
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'a'</span>, <span class="ruby-value str">&quot;nextmatch is wrong&quot;</span>)
21
+ <span class="ruby-identifier">assert_raises</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">&quot;exception not raised for not found&quot;</span>) {
22
+ <span class="ruby-identifier">c</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextmatch</span>(<span class="ruby-value str">'a'</span>)
23
+ }
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_nextchars (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 63</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_nextchars</span>
15
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;some_string&quot;</span>)
16
+ <span class="ruby-identifier">str</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextchars</span>(<span class="ruby-value">4</span>)
17
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">str</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'some'</span>, <span class="ruby-value str">&quot;nextchars doesn't work correctly&quot;</span>)
18
+ <span class="ruby-identifier">assert_raises</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">&quot;exception not raised for substring bounds error&quot;</span>) {
19
+ <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextchars</span>(<span class="ruby-value">10</span>)
20
+ }
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_nextclean (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 72</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_nextclean</span>
15
+ <span class="ruby-identifier">str1</span> = <span class="ruby-value str">&quot;/\t// comment\nb&quot;</span>
16
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str1</span>)
17
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextclean</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span>, <span class="ruby-value str">&quot;nextclean seems to have problems&quot;</span>)
18
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextclean</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'b'</span>, <span class="ruby-value str">&quot;// comment processing has problems&quot;</span>)
19
+ <span class="ruby-identifier">str2</span> = <span class="ruby-value str">&quot;/ /* comment */b&quot;</span>
20
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str2</span>)
21
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextclean</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span>, <span class="ruby-value str">&quot;nextclean seems to have problems&quot;</span>)
22
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextclean</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'b'</span>, <span class="ruby-value str">&quot;/* .. */ comment processing has problems&quot;</span>)
23
+ <span class="ruby-comment cmt"># test unclosed comments</span>
24
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;a/* unclosed comment&quot;</span>)
25
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextclean</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'a'</span>, <span class="ruby-value str">&quot;nextclean seems to have problems&quot;</span>)
26
+ <span class="ruby-identifier">assert_raises</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">&quot;unclosed comment doesn't raise exceptions&quot;</span>) {
27
+ <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextclean</span>
28
+ }
29
+ <span class="ruby-keyword kw">end</span></pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_nextstring (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 89</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_nextstring</span>
15
+ <span class="ruby-identifier">str1</span> = <span class="ruby-value str">&quot;str\&quot;&quot;</span>
16
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str1</span>)
17
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextstring</span>(<span class="ruby-value str">'&quot;'</span>) <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;str&quot;</span>, <span class="ruby-value str">&quot;string processing has problems&quot;</span>)
18
+ <span class="ruby-identifier">str2</span> = <span class="ruby-value str">'\b\t\n\f\r&quot;'</span>
19
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str2</span>)
20
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextstring</span>(<span class="ruby-value str">'&quot;'</span>) <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;\b\t\n\f\r&quot;</span>, <span class="ruby-value str">&quot;escape sequence processing has bugs&quot;</span>)
21
+ <span class="ruby-comment cmt"># UTF8 conversion tests for escape sequences</span>
22
+ <span class="ruby-identifier">str3</span> = <span class="ruby-value str">'\u1234&quot;'</span>
23
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str3</span>)
24
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextstring</span>(<span class="ruby-value str">'&quot;'</span>) <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;\341\210\224&quot;</span>, <span class="ruby-value str">&quot;Unicode escape sequence processing has bugs&quot;</span>)
25
+ <span class="ruby-keyword kw">end</span></pre>
26
+ </body>
27
+ </html>
@@ -0,0 +1,58 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_nextvalue (LexerTest)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/lexertest.rb, line 102</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_nextvalue</span>
15
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;false&quot;</span>
16
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
17
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-value str">&quot;error parsing false&quot;</span>);
18
+
19
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;true&quot;</span>
20
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
21
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;error parsing true&quot;</span>);
22
+
23
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;31337&quot;</span>
24
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
25
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span> <span class="ruby-operator">==</span> <span class="ruby-value">31337</span>, <span class="ruby-value str">&quot;error parsing integer&quot;</span>);
26
+
27
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;0.577289&quot;</span>
28
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
29
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span><span class="ruby-value">.577289</span>, <span class="ruby-value str">&quot;error parsing float&quot;</span>)
30
+
31
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;\&quot;123\n\&quot;&quot;</span>
32
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
33
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;123\n&quot;</span>, <span class="ruby-value str">&quot;error parsing string&quot;</span>)
34
+
35
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;null&quot;</span>
36
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
37
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">&quot;error parsing null&quot;</span>)
38
+
39
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;[ 1, \&quot;abc\&quot;, 2.7182818 ]&quot;</span>
40
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
41
+ <span class="ruby-identifier">array</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span>
42
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">array</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>, <span class="ruby-value str">&quot;error parsing an array (0th elem)&quot;</span>)
43
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">array</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;abc&quot;</span>, <span class="ruby-value str">&quot;error parsing an array (1st elem)&quot;</span>)
44
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">array</span>[<span class="ruby-value">2</span>] = <span class="ruby-value">2.7182818</span>, <span class="ruby-value str">&quot;error parsing an array (2nd elem)&quot;</span>)
45
+
46
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">'{&quot;foo&quot;:&quot;bar&quot;, &quot;xyz&quot;:1, &quot;e&quot;:2.7182818}'</span>
47
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
48
+ <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span>
49
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">obj</span>[<span class="ruby-value str">&quot;foo&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;bar&quot;</span>, <span class="ruby-value str">&quot;error parsing an object ('foo' elem)&quot;</span>)
50
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">obj</span>[<span class="ruby-value str">&quot;xyz&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>, <span class="ruby-value str">&quot;error parsing an object ('xyz' elem)&quot;</span>)
51
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">obj</span>[<span class="ruby-value str">&quot;e&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value">2.7182818</span>, <span class="ruby-value str">&quot;error parsing an object ('e' elem)&quot;</span>)
52
+
53
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;false&quot;</span>
54
+ <span class="ruby-identifier">lex</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>)
55
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">lex</span>.<span class="ruby-identifier">nextvalue</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-value str">&quot;error parsing false&quot;</span>);
56
+ <span class="ruby-keyword kw">end</span></pre>
57
+ </body>
58
+ </html>
@@ -0,0 +1,131 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: NilClass</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <h1>NilClass <sup class="type-note">(Class)</sup></h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>In:</strong></td>
54
+ <td>
55
+ <a href="../files/json/objects_rb.html">
56
+ json/objects.rb
57
+ </a>
58
+ <br />
59
+ </td>
60
+ </tr>
61
+
62
+ <tr class="top-aligned-row">
63
+ <td><strong>Parent:</strong></td>
64
+ <td>
65
+ <a href="Object.html">
66
+ Object
67
+ </a>
68
+ </td>
69
+ </tr>
70
+ </table>
71
+ </div>
72
+ <!-- banner header -->
73
+
74
+ <div id="bodyContent">
75
+
76
+
77
+ <div id="contextContent">
78
+
79
+
80
+
81
+ <div id="method-list">
82
+ <h2 class="section-bar">Methods</h2>
83
+
84
+ <div class="name-list">
85
+ <a href="#M000017">to_json</a>&nbsp;&nbsp;
86
+ </div>
87
+ </div>
88
+
89
+
90
+
91
+
92
+
93
+
94
+ </div>
95
+
96
+
97
+
98
+ <!-- if includes -->
99
+
100
+
101
+ <!-- if method_list -->
102
+ <div id="methods">
103
+ <h2 class="section-bar">Public Instance methods</h2>
104
+
105
+ <div id="method-M000017" class="method-detail">
106
+ <a name="M000017"></a>
107
+
108
+ <div class="method-heading">
109
+ <a href="NilClass.src/M000017.html" target="Code" class="method-signature"
110
+ onclick="popupCode('NilClass.src/M000017.html');return false;">
111
+ <span class="method-name">to_json</span><span class="method-args">()</span>
112
+ </a>
113
+ </div>
114
+
115
+ <div class="method-description">
116
+ </div>
117
+ </div>
118
+
119
+
120
+ </div>
121
+
122
+
123
+ </div>
124
+
125
+
126
+ <div id="validator-badges">
127
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
128
+ </div>
129
+
130
+ </body>
131
+ </html>