oj 3.11.3 → 3.11.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/ext/oj/buf.h +34 -38
  4. data/ext/oj/cache8.c +59 -62
  5. data/ext/oj/cache8.h +8 -7
  6. data/ext/oj/circarray.c +33 -35
  7. data/ext/oj/circarray.h +11 -9
  8. data/ext/oj/code.c +170 -174
  9. data/ext/oj/code.h +21 -20
  10. data/ext/oj/compat.c +159 -166
  11. data/ext/oj/custom.c +802 -851
  12. data/ext/oj/dump.c +766 -778
  13. data/ext/oj/dump.h +49 -51
  14. data/ext/oj/dump_compat.c +1 -0
  15. data/ext/oj/dump_leaf.c +116 -157
  16. data/ext/oj/dump_object.c +609 -628
  17. data/ext/oj/dump_strict.c +318 -327
  18. data/ext/oj/encode.h +3 -4
  19. data/ext/oj/err.c +39 -25
  20. data/ext/oj/err.h +24 -15
  21. data/ext/oj/extconf.rb +2 -1
  22. data/ext/oj/fast.c +1008 -1038
  23. data/ext/oj/hash.c +62 -66
  24. data/ext/oj/hash.h +7 -6
  25. data/ext/oj/hash_test.c +450 -443
  26. data/ext/oj/mimic_json.c +405 -401
  27. data/ext/oj/object.c +559 -528
  28. data/ext/oj/odd.c +123 -128
  29. data/ext/oj/odd.h +27 -25
  30. data/ext/oj/oj.c +1121 -921
  31. data/ext/oj/oj.h +286 -298
  32. data/ext/oj/parse.c +938 -930
  33. data/ext/oj/parse.h +70 -69
  34. data/ext/oj/rails.c +836 -839
  35. data/ext/oj/rails.h +7 -7
  36. data/ext/oj/reader.c +135 -140
  37. data/ext/oj/reader.h +66 -79
  38. data/ext/oj/resolve.c +43 -43
  39. data/ext/oj/resolve.h +3 -2
  40. data/ext/oj/rxclass.c +67 -68
  41. data/ext/oj/rxclass.h +12 -10
  42. data/ext/oj/saj.c +451 -479
  43. data/ext/oj/scp.c +93 -103
  44. data/ext/oj/sparse.c +770 -730
  45. data/ext/oj/stream_writer.c +120 -149
  46. data/ext/oj/strict.c +71 -86
  47. data/ext/oj/string_writer.c +198 -243
  48. data/ext/oj/trace.c +29 -33
  49. data/ext/oj/trace.h +14 -11
  50. data/ext/oj/util.c +103 -103
  51. data/ext/oj/util.h +3 -2
  52. data/ext/oj/val_stack.c +47 -47
  53. data/ext/oj/val_stack.h +79 -86
  54. data/ext/oj/wab.c +291 -309
  55. data/lib/oj/bag.rb +1 -0
  56. data/lib/oj/mimic.rb +0 -12
  57. data/lib/oj/version.rb +1 -1
  58. data/test/activerecord/result_test.rb +7 -2
  59. data/test/foo.rb +35 -32
  60. data/test/test_scp.rb +1 -1
  61. metadata +2 -2
data/ext/oj/hash.c CHANGED
@@ -1,43 +1,44 @@
1
1
  // Copyright (c) 2011 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
2
3
 
3
4
  #include "hash.h"
5
+
4
6
  #include <stdint.h>
5
7
 
6
- #define HASH_MASK 0x000003FF
7
- #define HASH_SLOT_CNT 1024
8
+ #define HASH_MASK 0x000003FF
9
+ #define HASH_SLOT_CNT 1024
8
10
 
9
11
  typedef struct _keyVal {
10
- struct _keyVal *next;
11
- const char *key;
12
- size_t len;
13
- VALUE val;
14
- } *KeyVal;
12
+ struct _keyVal *next;
13
+ const char * key;
14
+ size_t len;
15
+ VALUE val;
16
+ } * KeyVal;
15
17
 
16
18
  struct _hash {
17
- struct _keyVal slots[HASH_SLOT_CNT];
19
+ struct _keyVal slots[HASH_SLOT_CNT];
18
20
  };
19
21
 
20
- struct _hash class_hash;
21
- struct _hash intern_hash;
22
+ struct _hash class_hash;
23
+ struct _hash intern_hash;
22
24
 
23
25
  // almost the Murmur hash algorithm
24
26
  #define M 0x5bd1e995
25
27
  #define C1 0xCC9E2D51
26
28
  #define C2 0x1B873593
27
- #define N 0xE6546B64
29
+ #define N 0xE6546B64
28
30
 
29
- static uint32_t
30
- hash_calc(const uint8_t *key, size_t len) {
31
- const uint8_t *end = key + len;
32
- const uint8_t *endless = key + (len / 4 * 4);
33
- uint32_t h = (uint32_t)len;
34
- uint32_t k;
31
+ static uint32_t hash_calc(const uint8_t *key, size_t len) {
32
+ const uint8_t *end = key + len;
33
+ const uint8_t *endless = key + (len / 4 * 4);
34
+ uint32_t h = (uint32_t)len;
35
+ uint32_t k;
35
36
 
36
37
  while (key < endless) {
37
- k = (uint32_t)*key++;
38
- k |= (uint32_t)*key++ << 8;
39
- k |= (uint32_t)*key++ << 16;
40
- k |= (uint32_t)*key++ << 24;
38
+ k = (uint32_t)*key++;
39
+ k |= (uint32_t)*key++ << 8;
40
+ k |= (uint32_t)*key++ << 16;
41
+ k |= (uint32_t)*key++ << 24;
41
42
 
42
43
  k *= M;
43
44
  k ^= k >> 24;
@@ -45,13 +46,13 @@ hash_calc(const uint8_t *key, size_t len) {
45
46
  h ^= k * M;
46
47
  }
47
48
  if (1 < end - key) {
48
- uint16_t k16 = (uint16_t)*key++;
49
+ uint16_t k16 = (uint16_t)*key++;
49
50
 
50
- k16 |= (uint16_t)*key++ << 8;
51
- h ^= k16 << 8;
51
+ k16 |= (uint16_t)*key++ << 8;
52
+ h ^= k16 << 8;
52
53
  }
53
54
  if (key < end) {
54
- h ^= *key;
55
+ h ^= *key;
55
56
  }
56
57
  h *= M;
57
58
  h ^= h >> 13;
@@ -61,56 +62,53 @@ hash_calc(const uint8_t *key, size_t len) {
61
62
  return h;
62
63
  }
63
64
 
64
- void
65
- oj_hash_init() {
65
+ void oj_hash_init() {
66
66
  memset(class_hash.slots, 0, sizeof(class_hash.slots));
67
67
  memset(intern_hash.slots, 0, sizeof(intern_hash.slots));
68
68
  }
69
69
 
70
70
  // if slotp is 0 then just lookup
71
- static VALUE
72
- hash_get(Hash hash, const char *key, size_t len, VALUE **slotp, VALUE def_value) {
73
- uint32_t h = hash_calc((const uint8_t*)key, len) & HASH_MASK;
74
- KeyVal bucket = hash->slots + h;
71
+ static VALUE hash_get(Hash hash, const char *key, size_t len, VALUE **slotp, VALUE def_value) {
72
+ uint32_t h = hash_calc((const uint8_t *)key, len) & HASH_MASK;
73
+ KeyVal bucket = hash->slots + h;
75
74
 
76
75
  if (0 != bucket->key) {
77
- KeyVal b;
78
-
79
- for (b = bucket; 0 != b; b = b->next) {
80
- if (len == b->len && 0 == strncmp(b->key, key, len)) {
81
- *slotp = &b->val;
82
- return b->val;
83
- }
84
- bucket = b;
85
- }
76
+ KeyVal b;
77
+
78
+ for (b = bucket; 0 != b; b = b->next) {
79
+ if (len == b->len && 0 == strncmp(b->key, key, len)) {
80
+ *slotp = &b->val;
81
+ return b->val;
82
+ }
83
+ bucket = b;
84
+ }
86
85
  }
87
86
  if (0 != slotp) {
88
- if (0 != bucket->key) {
89
- KeyVal b = ALLOC(struct _keyVal);
90
-
91
- b->next = 0;
92
- bucket->next = b;
93
- bucket = b;
94
- }
95
- bucket->key = oj_strndup(key, len);
96
- bucket->len = len;
97
- bucket->val = def_value;
98
- *slotp = &bucket->val;
87
+ if (0 != bucket->key) {
88
+ KeyVal b = ALLOC(struct _keyVal);
89
+
90
+ b->next = 0;
91
+ bucket->next = b;
92
+ bucket = b;
93
+ }
94
+ bucket->key = oj_strndup(key, len);
95
+ bucket->len = len;
96
+ bucket->val = def_value;
97
+ *slotp = &bucket->val;
99
98
  }
100
99
  return def_value;
101
100
  }
102
101
 
103
- void
104
- oj_hash_print() {
105
- int i;
106
- KeyVal b;
102
+ void oj_hash_print() {
103
+ int i;
104
+ KeyVal b;
107
105
 
108
106
  for (i = 0; i < HASH_SLOT_CNT; i++) {
109
- printf("%4d:", i);
110
- for (b = class_hash.slots + i; 0 != b && 0 != b->key; b = b->next) {
111
- printf(" %s", b->key);
112
- }
113
- printf("\n");
107
+ printf("%4d:", i);
108
+ for (b = class_hash.slots + i; 0 != b && 0 != b->key; b = b->next) {
109
+ printf(" %s", b->key);
110
+ }
111
+ printf("\n");
114
112
  }
115
113
  }
116
114
 
@@ -119,14 +117,12 @@ oj_class_hash_get(const char *key, size_t len, VALUE **slotp) {
119
117
  return hash_get(&class_hash, key, len, slotp, Qnil);
120
118
  }
121
119
 
122
- ID
123
- oj_attr_hash_get(const char *key, size_t len, ID **slotp) {
124
- return (ID)hash_get(&intern_hash, key, len, (VALUE**)slotp, 0);
120
+ ID oj_attr_hash_get(const char *key, size_t len, ID **slotp) {
121
+ return (ID)hash_get(&intern_hash, key, len, (VALUE **)slotp, 0);
125
122
  }
126
123
 
127
- char*
128
- oj_strndup(const char *s, size_t len) {
129
- char *d = ALLOC_N(char, len + 1);
124
+ char *oj_strndup(const char *s, size_t len) {
125
+ char *d = ALLOC_N(char, len + 1);
130
126
 
131
127
  memcpy(d, s, len);
132
128
  d[len] = '\0';
data/ext/oj/hash.h CHANGED
@@ -1,18 +1,19 @@
1
1
  // Copyright (c) 2011 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
2
3
 
3
4
  #ifndef OJ_HASH_H
4
5
  #define OJ_HASH_H
5
6
 
6
7
  #include "ruby.h"
7
8
 
8
- typedef struct _hash *Hash;
9
+ typedef struct _hash *Hash;
9
10
 
10
- extern void oj_hash_init();
11
+ extern void oj_hash_init();
11
12
 
12
- extern VALUE oj_class_hash_get(const char *key, size_t len, VALUE **slotp);
13
- extern ID oj_attr_hash_get(const char *key, size_t len, ID **slotp);
13
+ extern VALUE oj_class_hash_get(const char *key, size_t len, VALUE **slotp);
14
+ extern ID oj_attr_hash_get(const char *key, size_t len, ID **slotp);
14
15
 
15
- extern void oj_hash_print();
16
- extern char* oj_strndup(const char *s, size_t len);
16
+ extern void oj_hash_print();
17
+ extern char *oj_strndup(const char *s, size_t len);
17
18
 
18
19
  #endif /* OJ_HASH_H */
data/ext/oj/hash_test.c CHANGED
@@ -1,481 +1,488 @@
1
1
  // Copyright (c) 2011 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
2
3
 
3
4
  // if windows, comment out the whole file. It's only a performance test.
4
5
  #ifndef _WIN32
5
- #include <sys/time.h>
6
- #include <time.h>
7
6
  #include "hash.h"
7
+
8
8
  #include <stdint.h>
9
+ #include <sys/time.h>
10
+ #include <time.h>
9
11
 
10
12
  /* Define printf formats for standard types, like PRIu64 for uint64_t. */
11
13
  #define __STDC_FORMAT_MACROS
12
14
  #include <inttypes.h>
13
15
 
14
16
  typedef struct _strLen {
15
- const char *str;
16
- size_t len;
17
- } *StrLen;
17
+ const char *str;
18
+ size_t len;
19
+ } * StrLen;
18
20
 
19
- static struct _strLen data[] = {
20
- { "Gem::Version", 12 },
21
- { "TracePoint", 10 },
22
- { "Complex::compatible", 19 },
23
- { "Complex", 7 },
24
- { "Rational::compatible", 20 },
25
- { "Rational", 8 },
26
- { "FiberError", 10 },
27
- { "Fiber", 5 },
28
- { "ThreadError", 11 },
29
- { "Mutex", 5 },
30
- { "ThreadGroup", 11 },
31
- { "RubyVM::InstructionSequence", 27 },
32
- { "Thread::Backtrace::Location", 27 },
33
- { "Thread::Backtrace", 17 },
34
- { "Thread", 6 },
35
- { "RubyVM::Env", 11 },
36
- { "RubyVM", 6 },
37
- { "Enumerator::Yielder", 19 },
38
- { "Enumerator::Generator", 21 },
39
- { "StopIteration", 13 },
40
- { "Enumerator::Lazy", 16 },
41
- { "Enumerator", 10 },
42
- { "ObjectSpace::WeakMap", 20 },
43
- { "Math::DomainError", 17 },
44
- { "Binding", 7 },
45
- { "UnboundMethod", 13 },
46
- { "Method", 6 },
47
- { "SystemStackError", 16 },
48
- { "LocalJumpError", 14 },
49
- { "Proc", 4 },
50
- { "Struct::Tms", 11 },
51
- { "Process::Status", 15 },
52
- { "Random", 6 },
53
- { "Time", 4 },
54
- { "Dir", 3 },
55
- { "File::Stat", 10 },
56
- { "File", 4 },
57
- { "ARGF.class", 10 },
58
- { "IO", 2 },
59
- { "EOFError", 8 },
60
- { "IOError", 7 },
61
- { "Range", 5 },
62
- { "Encoding::Converter", 19 },
63
- { "Encoding::ConverterNotFoundError", 32 },
64
- { "Encoding::InvalidByteSequenceError", 34 },
65
- { "Encoding::UndefinedConversionError", 34 },
66
- { "MatchData", 9 },
67
- { "Regexp", 6 },
68
- { "RegexpError", 11 },
69
- { "Struct", 6 },
70
- { "Hash", 4 },
71
- { "Array", 5 },
72
- { "Errno::ERPCMISMATCH", 19 },
73
- { "Errno::EPROGUNAVAIL", 19 },
74
- { "Errno::EPROGMISMATCH", 20 },
75
- { "Errno::EPROCUNAVAIL", 19 },
76
- { "Errno::EPROCLIM", 15 },
77
- { "Errno::ENOTSUP", 14 },
78
- { "Errno::ENOATTR", 14 },
79
- { "Errno::ENEEDAUTH", 16 },
80
- { "Errno::EFTYPE", 13 },
81
- { "Errno::EBADRPC", 14 },
82
- { "Errno::EAUTH", 12 },
83
- { "Errno::EOWNERDEAD", 17 },
84
- { "Errno::ENOTRECOVERABLE", 22 },
85
- { "Errno::ECANCELED", 16 },
86
- { "Errno::EDQUOT", 13 },
87
- { "Errno::ESTALE", 13 },
88
- { "Errno::EINPROGRESS", 18 },
89
- { "Errno::EALREADY", 15 },
90
- { "Errno::EHOSTUNREACH", 19 },
91
- { "Errno::EHOSTDOWN", 16 },
92
- { "Errno::ECONNREFUSED", 19 },
93
- { "Errno::ETIMEDOUT", 16 },
94
- { "Errno::ETOOMANYREFS", 19 },
95
- { "Errno::ESHUTDOWN", 16 },
96
- { "Errno::ENOTCONN", 15 },
97
- { "Errno::EISCONN", 14 },
98
- { "Errno::ENOBUFS", 14 },
99
- { "Errno::ECONNRESET", 17 },
100
- { "Errno::ECONNABORTED", 19 },
101
- { "Errno::ENETRESET", 16 },
102
- { "Errno::ENETUNREACH", 18 },
103
- { "Errno::ENETDOWN", 15 },
104
- { "Errno::EADDRNOTAVAIL", 20 },
105
- { "Errno::EADDRINUSE", 17 },
106
- { "Errno::EAFNOSUPPORT", 19 },
107
- { "Errno::EPFNOSUPPORT", 19 },
108
- { "Errno::EOPNOTSUPP", 17 },
109
- { "Errno::ESOCKTNOSUPPORT", 22 },
110
- { "Errno::EPROTONOSUPPORT", 22 },
111
- { "Errno::ENOPROTOOPT", 18 },
112
- { "Errno::EPROTOTYPE", 17 },
113
- { "Errno::EMSGSIZE", 15 },
114
- { "Errno::EDESTADDRREQ", 19 },
115
- { "Errno::ENOTSOCK", 15 },
116
- { "Errno::EUSERS", 13 },
117
- { "Errno::EILSEQ", 13 },
118
- { "Errno::EOVERFLOW", 16 },
119
- { "Errno::EBADMSG", 14 },
120
- { "Errno::EMULTIHOP", 16 },
121
- { "Errno::EPROTO", 13 },
122
- { "Errno::ENOLINK", 14 },
123
- { "Errno::EREMOTE", 14 },
124
- { "Errno::ENOSR", 12 },
125
- { "Errno::ETIME", 12 },
126
- { "Errno::ENODATA", 14 },
127
- { "Errno::ENOSTR", 13 },
128
- { "Errno::EIDRM", 12 },
129
- { "Errno::ENOMSG", 13 },
130
- { "Errno::ELOOP", 12 },
131
- { "Errno::ENOTEMPTY", 16 },
132
- { "Errno::ENOSYS", 13 },
133
- { "Errno::ENOLCK", 13 },
134
- { "Errno::ENAMETOOLONG", 19 },
135
- { "Errno::EDEADLK", 14 },
136
- { "Errno::ERANGE", 13 },
137
- { "Errno::EDOM", 11 },
138
- { "Errno::EPIPE", 12 },
139
- { "Errno::EMLINK", 13 },
140
- { "Errno::EROFS", 12 },
141
- { "Errno::ESPIPE", 13 },
142
- { "Errno::ENOSPC", 13 },
143
- { "Errno::EFBIG", 12 },
144
- { "Errno::ETXTBSY", 14 },
145
- { "Errno::ENOTTY", 13 },
146
- { "Errno::EMFILE", 13 },
147
- { "Errno::ENFILE", 13 },
148
- { "Errno::EINVAL", 13 },
149
- { "Errno::EISDIR", 13 },
150
- { "Errno::ENOTDIR", 14 },
151
- { "Errno::ENODEV", 13 },
152
- { "Errno::EXDEV", 12 },
153
- { "Errno::EEXIST", 13 },
154
- { "Errno::EBUSY", 12 },
155
- { "Errno::ENOTBLK", 14 },
156
- { "Errno::EFAULT", 13 },
157
- { "Errno::EACCES", 13 },
158
- { "Errno::ENOMEM", 13 },
159
- { "Errno::EAGAIN", 13 },
160
- { "Errno::ECHILD", 13 },
161
- { "Errno::EBADF", 12 },
162
- { "Errno::ENOEXEC", 14 },
163
- { "Errno::E2BIG", 12 },
164
- { "Errno::ENXIO", 12 },
165
- { "Errno::EIO", 10 },
166
- { "Errno::EINTR", 12 },
167
- { "Errno::ESRCH", 12 },
168
- { "Errno::ENOENT", 13 },
169
- { "Errno::EPERM", 12 },
170
- { "Errno::NOERROR", 14 },
171
- { "Bignum", 6 },
172
- { "Float", 5 },
173
- { "Fixnum", 6 },
174
- { "Integer", 7 },
175
- { "Numeric", 7 },
176
- { "FloatDomainError", 16 },
177
- { "ZeroDivisionError", 17 },
178
- { "SystemCallError", 15 },
179
- { "Encoding::CompatibilityError", 28 },
180
- { "EncodingError", 13 },
181
- { "NoMemoryError", 13 },
182
- { "SecurityError", 13 },
183
- { "RuntimeError", 12 },
184
- { "NoMethodError", 13 },
185
- { "NameError::message", 18 },
186
- { "NameError", 9 },
187
- { "NotImplementedError", 19 },
188
- { "LoadError", 9 },
189
- { "SyntaxError", 11 },
190
- { "ScriptError", 11 },
191
- { "RangeError", 10 },
192
- { "KeyError", 8 },
193
- { "IndexError", 10 },
194
- { "ArgumentError", 13 },
195
- { "TypeError", 9 },
196
- { "StandardError", 13 },
197
- { "Interrupt", 9 },
198
- { "SignalException", 15 },
199
- { "SystemExit", 10 },
200
- { "Exception", 9 },
201
- { "Symbol", 6 },
202
- { "String", 6 },
203
- { "Encoding", 8 },
204
- { "FalseClass", 10 },
205
- { "TrueClass", 9 },
206
- { "Data", 4 },
207
- { "NilClass", 8 },
208
- { "Class", 5 },
209
- { "Module", 6 },
210
- { "Object", 6 },
211
- { "BasicObject", 11 },
212
- { "Gem::Requirement::BadRequirementError", 37 },
213
- { "Gem::Requirement", 16 },
214
- { "Gem::SourceFetchProblem", 23 },
215
- { "Gem::PlatformMismatch", 21 },
216
- { "Gem::ErrorReason", 16 },
217
- { "Gem::LoadError", 14 },
218
- { "Gem::RemoteSourceException", 26 },
219
- { "Gem::RemoteInstallationSkipped", 30 },
220
- { "Gem::RemoteInstallationCancelled", 32 },
221
- { "Gem::RemoteError", 16 },
222
- { "Gem::OperationNotSupportedError", 31 },
223
- { "Gem::InvalidSpecificationException", 34 },
224
- { "Gem::InstallError", 17 },
225
- { "Gem::Specification", 18 },
226
- { "Date", 4 },
227
- { "Gem::Platform", 13 },
228
- { "Gem::SpecificGemNotFoundException", 33 },
229
- { "Gem::GemNotFoundException", 25 },
230
- { "Gem::FormatException", 20 },
231
- { "Gem::FilePermissionError", 24 },
232
- { "Gem::EndOfYAMLException", 23 },
233
- { "Gem::DocumentError", 18 },
234
- { "Gem::GemNotInHomeException", 26 },
235
- { "Gem::DependencyRemovalException", 31 },
236
- { "Gem::DependencyError", 20 },
237
- { "Gem::CommandLineError", 21 },
238
- { "Gem::Exception", 14 },
239
- { "IRB::SLex", 9 },
240
- { "IRB::Notifier::NoMsgNotifier", 28 },
241
- { "IRB::Notifier::LeveledNotifier", 30 },
242
- { "IRB::Notifier::CompositeNotifier", 32 },
243
- { "IRB::Notifier::AbstractNotifier", 31 },
244
- { "IRB::Notifier::ErrUnrecognizedLevel", 35 },
245
- { "IRB::Notifier::ErrUndefinedNotifier", 35 },
246
- { "IRB::StdioOutputMethod", 22 },
247
- { "IRB::OutputMethod::NotImplementedError", 38 },
248
- { "IRB::OutputMethod", 17 },
249
- { "IRB::IllegalRCGenerator", 23 },
250
- { "IRB::UndefinedPromptMode", 24 },
251
- { "IRB::CantChangeBinding", 22 },
252
- { "IRB::CantShiftToMultiIrbMode", 28 },
253
- { "IRB::NoSuchJob", 14 },
254
- { "IRB::IrbSwitchedToCurrentThread", 31 },
255
- { "IRB::IrbAlreadyDead", 19 },
256
- { "IRB::IllegalParameter", 21 },
257
- { "IRB::CantReturnToNormalMode", 27 },
258
- { "IRB::NotImplementedError", 24 },
259
- { "IRB::UnrecognizedSwitch", 23 },
260
- { "IRB::Irb", 8 },
261
- { "IRB::Abort", 10 },
262
- { "IRB::Locale", 11 },
263
- { "IRB::SLex::ErrNodeNothing", 25 },
264
- { "IRB::SLex::ErrNodeAlreadyExists", 31 },
265
- { "RubyLex", 7 },
266
- { "IRB::SLex::Node", 15 },
267
- { "Gem::SystemExitException", 24 },
268
- { "Gem::VerificationError", 22 },
269
- { "RubyToken::TkError", 18 },
270
- { "RubyToken::TkUnknownChar", 24 },
271
- { "RubyToken::TkOPASGN", 19 },
272
- { "RubyToken::TkOp", 15 },
273
- { "RubyToken::TkVal", 16 },
274
- { "RubyToken::TkId", 15 },
275
- { "RubyToken::TkNode", 17 },
276
- { "RubyToken::Token", 16 },
277
- { "RubyToken::TkUNDEF", 18 },
278
- { "RubyToken::TkDEF", 16 },
279
- { "RubyToken::TkMODULE", 19 },
280
- { "RubyToken::TkCLASS", 18 },
281
- { "RubyToken::TkWHILE", 18 },
282
- { "RubyToken::TkWHEN", 17 },
283
- { "RubyToken::TkCASE", 17 },
284
- { "RubyToken::TkELSE", 17 },
285
- { "RubyToken::TkELSIF", 18 },
286
- { "RubyToken::TkTHEN", 17 },
287
- { "RubyToken::TkUNLESS", 19 },
288
- { "RubyToken::TkIF", 15 },
289
- { "RubyToken::TkEND", 16 },
290
- { "RubyToken::TkENSURE", 19 },
291
- { "RubyToken::TkRESCUE", 19 },
292
- { "RubyToken::TkBEGIN", 18 },
293
- { "RubyToken::TkDO", 15 },
294
- { "RubyToken::TkIN", 15 },
295
- { "RubyToken::TkRETRY", 18 },
296
- { "RubyToken::TkREDO", 17 },
297
- { "RubyToken::TkNEXT", 17 },
298
- { "RubyToken::TkBREAK", 18 },
299
- { "RubyToken::TkFOR", 16 },
300
- { "RubyToken::TkUNTIL", 18 },
301
- { "RubyToken::TkTRUE", 17 },
302
- { "RubyToken::TkNIL", 16 },
303
- { "RubyToken::TkSELF", 17 },
304
- { "RubyToken::TkSUPER", 18 },
305
- { "RubyToken::TkYIELD", 18 },
306
- { "RubyToken::TkRETURN", 19 },
307
- { "RubyToken::TkAND", 16 },
308
- { "RubyToken::TkFALSE", 18 },
309
- { "RubyToken::TkUNLESS_MOD", 23 },
310
- { "RubyToken::TkIF_MOD", 19 },
311
- { "RubyToken::TkNOT", 16 },
312
- { "RubyToken::TkOR", 15 },
313
- { "RubyToken::TkALIAS", 18 },
314
- { "RubyToken::TkUNTIL_MOD", 22 },
315
- { "RubyToken::TkWHILE_MOD", 22 },
316
- { "RubyToken::TkGVAR", 17 },
317
- { "RubyToken::TkFID", 16 },
318
- { "RubyToken::TkIDENTIFIER", 23 },
319
- { "RubyToken::Tk__FILE__", 21 },
320
- { "RubyToken::Tk__LINE__", 21 },
321
- { "RubyToken::TklEND", 17 },
322
- { "RubyToken::TklBEGIN", 19 },
323
- { "RubyToken::TkDEFINED", 20 },
324
- { "RubyToken::TkDREGEXP", 20 },
325
- { "RubyToken::TkDXSTRING", 21 },
326
- { "RubyToken::TkDSTRING", 20 },
327
- { "RubyToken::TkSYMBOL", 19 },
328
- { "RubyToken::TkREGEXP", 19 },
329
- { "RubyToken::TkXSTRING", 20 },
330
- { "RubyToken::TkSTRING", 19 },
331
- { "RubyToken::TkFLOAT", 18 },
332
- { "RubyToken::TkINTEGER", 20 },
333
- { "RubyToken::TkCONSTANT", 21 },
334
- { "RubyToken::TkIVAR", 17 },
335
- { "RubyToken::TkCVAR", 17 },
336
- { "RubyToken::TkNEQ", 16 },
337
- { "RubyToken::TkEQQ", 16 },
338
- { "RubyToken::TkEQ", 15 },
339
- { "RubyToken::TkCMP", 16 },
340
- { "RubyToken::TkPOW", 16 },
341
- { "RubyToken::TkUMINUS", 19 },
342
- { "RubyToken::TkUPLUS", 18 },
343
- { "Exception2MessageMapper::ErrNotRegisteredException", 50 },
344
- { "RubyToken::TkBACK_REF", 21 },
345
- { "RubyToken::TkNTH_REF", 20 },
346
- { "RubyToken::TkLSHFT", 18 },
347
- { "RubyToken::TkASET", 17 },
348
- { "RubyToken::TkAREF", 17 },
349
- { "RubyToken::TkDOT3", 17 },
350
- { "RubyToken::TkDOT2", 17 },
351
- { "RubyToken::TkNMATCH", 19 },
352
- { "RubyToken::TkMATCH", 18 },
353
- { "RubyToken::TkOROP", 17 },
354
- { "RubyToken::TkANDOP", 18 },
355
- { "RubyToken::TkLEQ", 16 },
356
- { "RubyToken::TkGEQ", 16 },
357
- { "RubyToken::TkAMPER", 18 },
358
- { "RubyToken::TkSTAR", 17 },
359
- { "RubyToken::TkfLBRACE", 20 },
360
- { "RubyToken::TkfLBRACK", 20 },
361
- { "RubyToken::TkfLPAREN", 20 },
362
- { "RubyToken::TkCOLON", 18 },
363
- { "RubyToken::TkQUESTION", 21 },
364
- { "RubyToken::TkASSOC", 18 },
365
- { "RubyToken::TkCOLON3", 19 },
366
- { "RubyToken::TkCOLON2", 19 },
367
- { "RubyToken::TkRSHFT", 18 },
368
- { "RubyToken::TkBITAND", 19 },
369
- { "RubyToken::TkBITXOR", 19 },
370
- { "RubyToken::TkBITOR", 18 },
371
- { "RubyToken::TkMOD", 16 },
372
- { "RubyToken::TkDIV", 16 },
373
- { "RubyToken::TkMULT", 17 },
374
- { "RubyToken::TkMINUS", 18 },
375
- { "RubyToken::TkPLUS", 17 },
376
- { "RubyToken::TkLT", 15 },
377
- { "RubyToken::TkGT", 15 },
378
- { "RubyToken::TkSYMBEG", 19 },
379
- { "IRB::DefaultEncodings", 21 },
380
- { "RubyToken::TkRPAREN", 19 },
381
- { "RubyToken::TkLBRACE", 19 },
382
- { "RubyToken::TkLBRACK", 19 },
383
- { "RubyToken::TkLPAREN", 19 },
384
- { "RubyToken::TkDOT", 16 },
385
- { "RubyToken::TkASSIGN", 19 },
386
- { "RubyToken::TkBACKQUOTE", 22 },
387
- { "RubyToken::TkNOTOP", 18 },
388
- { "RubyToken::TkBITNOT", 19 },
389
- { "RubyToken::TkDOLLAR", 19 },
390
- { "RubyToken::TkAT", 15 },
391
- { "RubyToken::TkBACKSLASH", 22 },
392
- { "RubyToken::TkEND_OF_SCRIPT", 26 },
393
- { "RubyToken::TkNL", 15 },
394
- { "RubyToken::TkSPACE", 18 },
395
- { "RubyToken::TkRD_COMMENT", 23 },
396
- { "RubyToken::TkCOMMENT", 20 },
397
- { "RubyToken::TkSEMICOLON", 22 },
398
- { "RubyToken::TkCOMMA", 18 },
399
- { "RubyToken::TkRBRACE", 19 },
400
- { "RubyToken::TkRBRACK", 19 },
401
- { "RubyLex::TerminateLineInput", 27 },
402
- { "RubyLex::SyntaxError", 20 },
403
- { "RubyLex::TkReading2TokenDuplicateError", 38 },
404
- { "RubyLex::TkSymbol2TokenNoKey", 28 },
405
- { "RubyLex::TkReading2TokenNoKey", 29 },
406
- { "RubyLex::AlreadyDefinedToken", 28 },
407
- { "IRB::FileInputMethod", 20 },
408
- { "IRB::StdioInputMethod", 21 },
409
- { "IRB::InputMethod", 16 },
410
- { "IRB::ReadlineInputMethod", 24 },
411
- { "IRB::Context", 12 },
412
- { "IRB::Inspector", 14 },
413
- { "IRB::WorkSpace", 14 },
414
- { 0, 0 }
415
- };
21
+ static struct _strLen data[] = {{"Gem::Version", 12},
22
+ {"TracePoint", 10},
23
+ {"Complex::compatible", 19},
24
+ {"Complex", 7},
25
+ {"Rational::compatible", 20},
26
+ {"Rational", 8},
27
+ {"FiberError", 10},
28
+ {"Fiber", 5},
29
+ {"ThreadError", 11},
30
+ {"Mutex", 5},
31
+ {"ThreadGroup", 11},
32
+ {"RubyVM::InstructionSequence", 27},
33
+ {"Thread::Backtrace::Location", 27},
34
+ {"Thread::Backtrace", 17},
35
+ {"Thread", 6},
36
+ {"RubyVM::Env", 11},
37
+ {"RubyVM", 6},
38
+ {"Enumerator::Yielder", 19},
39
+ {"Enumerator::Generator", 21},
40
+ {"StopIteration", 13},
41
+ {"Enumerator::Lazy", 16},
42
+ {"Enumerator", 10},
43
+ {"ObjectSpace::WeakMap", 20},
44
+ {"Math::DomainError", 17},
45
+ {"Binding", 7},
46
+ {"UnboundMethod", 13},
47
+ {"Method", 6},
48
+ {"SystemStackError", 16},
49
+ {"LocalJumpError", 14},
50
+ {"Proc", 4},
51
+ {"Struct::Tms", 11},
52
+ {"Process::Status", 15},
53
+ {"Random", 6},
54
+ {"Time", 4},
55
+ {"Dir", 3},
56
+ {"File::Stat", 10},
57
+ {"File", 4},
58
+ {"ARGF.class", 10},
59
+ {"IO", 2},
60
+ {"EOFError", 8},
61
+ {"IOError", 7},
62
+ {"Range", 5},
63
+ {"Encoding::Converter", 19},
64
+ {"Encoding::ConverterNotFoundError", 32},
65
+ {"Encoding::InvalidByteSequenceError", 34},
66
+ {"Encoding::UndefinedConversionError", 34},
67
+ {"MatchData", 9},
68
+ {"Regexp", 6},
69
+ {"RegexpError", 11},
70
+ {"Struct", 6},
71
+ {"Hash", 4},
72
+ {"Array", 5},
73
+ {"Errno::ERPCMISMATCH", 19},
74
+ {"Errno::EPROGUNAVAIL", 19},
75
+ {"Errno::EPROGMISMATCH", 20},
76
+ {"Errno::EPROCUNAVAIL", 19},
77
+ {"Errno::EPROCLIM", 15},
78
+ {"Errno::ENOTSUP", 14},
79
+ {"Errno::ENOATTR", 14},
80
+ {"Errno::ENEEDAUTH", 16},
81
+ {"Errno::EFTYPE", 13},
82
+ {"Errno::EBADRPC", 14},
83
+ {"Errno::EAUTH", 12},
84
+ {"Errno::EOWNERDEAD", 17},
85
+ {"Errno::ENOTRECOVERABLE", 22},
86
+ {"Errno::ECANCELED", 16},
87
+ {"Errno::EDQUOT", 13},
88
+ {"Errno::ESTALE", 13},
89
+ {"Errno::EINPROGRESS", 18},
90
+ {"Errno::EALREADY", 15},
91
+ {"Errno::EHOSTUNREACH", 19},
92
+ {"Errno::EHOSTDOWN", 16},
93
+ {"Errno::ECONNREFUSED", 19},
94
+ {"Errno::ETIMEDOUT", 16},
95
+ {"Errno::ETOOMANYREFS", 19},
96
+ {"Errno::ESHUTDOWN", 16},
97
+ {"Errno::ENOTCONN", 15},
98
+ {"Errno::EISCONN", 14},
99
+ {"Errno::ENOBUFS", 14},
100
+ {"Errno::ECONNRESET", 17},
101
+ {"Errno::ECONNABORTED", 19},
102
+ {"Errno::ENETRESET", 16},
103
+ {"Errno::ENETUNREACH", 18},
104
+ {"Errno::ENETDOWN", 15},
105
+ {"Errno::EADDRNOTAVAIL", 20},
106
+ {"Errno::EADDRINUSE", 17},
107
+ {"Errno::EAFNOSUPPORT", 19},
108
+ {"Errno::EPFNOSUPPORT", 19},
109
+ {"Errno::EOPNOTSUPP", 17},
110
+ {"Errno::ESOCKTNOSUPPORT", 22},
111
+ {"Errno::EPROTONOSUPPORT", 22},
112
+ {"Errno::ENOPROTOOPT", 18},
113
+ {"Errno::EPROTOTYPE", 17},
114
+ {"Errno::EMSGSIZE", 15},
115
+ {"Errno::EDESTADDRREQ", 19},
116
+ {"Errno::ENOTSOCK", 15},
117
+ {"Errno::EUSERS", 13},
118
+ {"Errno::EILSEQ", 13},
119
+ {"Errno::EOVERFLOW", 16},
120
+ {"Errno::EBADMSG", 14},
121
+ {"Errno::EMULTIHOP", 16},
122
+ {"Errno::EPROTO", 13},
123
+ {"Errno::ENOLINK", 14},
124
+ {"Errno::EREMOTE", 14},
125
+ {"Errno::ENOSR", 12},
126
+ {"Errno::ETIME", 12},
127
+ {"Errno::ENODATA", 14},
128
+ {"Errno::ENOSTR", 13},
129
+ {"Errno::EIDRM", 12},
130
+ {"Errno::ENOMSG", 13},
131
+ {"Errno::ELOOP", 12},
132
+ {"Errno::ENOTEMPTY", 16},
133
+ {"Errno::ENOSYS", 13},
134
+ {"Errno::ENOLCK", 13},
135
+ {"Errno::ENAMETOOLONG", 19},
136
+ {"Errno::EDEADLK", 14},
137
+ {"Errno::ERANGE", 13},
138
+ {"Errno::EDOM", 11},
139
+ {"Errno::EPIPE", 12},
140
+ {"Errno::EMLINK", 13},
141
+ {"Errno::EROFS", 12},
142
+ {"Errno::ESPIPE", 13},
143
+ {"Errno::ENOSPC", 13},
144
+ {"Errno::EFBIG", 12},
145
+ {"Errno::ETXTBSY", 14},
146
+ {"Errno::ENOTTY", 13},
147
+ {"Errno::EMFILE", 13},
148
+ {"Errno::ENFILE", 13},
149
+ {"Errno::EINVAL", 13},
150
+ {"Errno::EISDIR", 13},
151
+ {"Errno::ENOTDIR", 14},
152
+ {"Errno::ENODEV", 13},
153
+ {"Errno::EXDEV", 12},
154
+ {"Errno::EEXIST", 13},
155
+ {"Errno::EBUSY", 12},
156
+ {"Errno::ENOTBLK", 14},
157
+ {"Errno::EFAULT", 13},
158
+ {"Errno::EACCES", 13},
159
+ {"Errno::ENOMEM", 13},
160
+ {"Errno::EAGAIN", 13},
161
+ {"Errno::ECHILD", 13},
162
+ {"Errno::EBADF", 12},
163
+ {"Errno::ENOEXEC", 14},
164
+ {"Errno::E2BIG", 12},
165
+ {"Errno::ENXIO", 12},
166
+ {"Errno::EIO", 10},
167
+ {"Errno::EINTR", 12},
168
+ {"Errno::ESRCH", 12},
169
+ {"Errno::ENOENT", 13},
170
+ {"Errno::EPERM", 12},
171
+ {"Errno::NOERROR", 14},
172
+ {"Bignum", 6},
173
+ {"Float", 5},
174
+ {"Fixnum", 6},
175
+ {"Integer", 7},
176
+ {"Numeric", 7},
177
+ {"FloatDomainError", 16},
178
+ {"ZeroDivisionError", 17},
179
+ {"SystemCallError", 15},
180
+ {"Encoding::CompatibilityError", 28},
181
+ {"EncodingError", 13},
182
+ {"NoMemoryError", 13},
183
+ {"SecurityError", 13},
184
+ {"RuntimeError", 12},
185
+ {"NoMethodError", 13},
186
+ {"NameError::message", 18},
187
+ {"NameError", 9},
188
+ {"NotImplementedError", 19},
189
+ {"LoadError", 9},
190
+ {"SyntaxError", 11},
191
+ {"ScriptError", 11},
192
+ {"RangeError", 10},
193
+ {"KeyError", 8},
194
+ {"IndexError", 10},
195
+ {"ArgumentError", 13},
196
+ {"TypeError", 9},
197
+ {"StandardError", 13},
198
+ {"Interrupt", 9},
199
+ {"SignalException", 15},
200
+ {"SystemExit", 10},
201
+ {"Exception", 9},
202
+ {"Symbol", 6},
203
+ {"String", 6},
204
+ {"Encoding", 8},
205
+ {"FalseClass", 10},
206
+ {"TrueClass", 9},
207
+ {"Data", 4},
208
+ {"NilClass", 8},
209
+ {"Class", 5},
210
+ {"Module", 6},
211
+ {"Object", 6},
212
+ {"BasicObject", 11},
213
+ {"Gem::Requirement::BadRequirementError", 37},
214
+ {"Gem::Requirement", 16},
215
+ {"Gem::SourceFetchProblem", 23},
216
+ {"Gem::PlatformMismatch", 21},
217
+ {"Gem::ErrorReason", 16},
218
+ {"Gem::LoadError", 14},
219
+ {"Gem::RemoteSourceException", 26},
220
+ {"Gem::RemoteInstallationSkipped", 30},
221
+ {"Gem::RemoteInstallationCancelled", 32},
222
+ {"Gem::RemoteError", 16},
223
+ {"Gem::OperationNotSupportedError", 31},
224
+ {"Gem::InvalidSpecificationException", 34},
225
+ {"Gem::InstallError", 17},
226
+ {"Gem::Specification", 18},
227
+ {"Date", 4},
228
+ {"Gem::Platform", 13},
229
+ {"Gem::SpecificGemNotFoundException", 33},
230
+ {"Gem::GemNotFoundException", 25},
231
+ {"Gem::FormatException", 20},
232
+ {"Gem::FilePermissionError", 24},
233
+ {"Gem::EndOfYAMLException", 23},
234
+ {"Gem::DocumentError", 18},
235
+ {"Gem::GemNotInHomeException", 26},
236
+ {"Gem::DependencyRemovalException", 31},
237
+ {"Gem::DependencyError", 20},
238
+ {"Gem::CommandLineError", 21},
239
+ {"Gem::Exception", 14},
240
+ {"IRB::SLex", 9},
241
+ {"IRB::Notifier::NoMsgNotifier", 28},
242
+ {"IRB::Notifier::LeveledNotifier", 30},
243
+ {"IRB::Notifier::CompositeNotifier", 32},
244
+ {"IRB::Notifier::AbstractNotifier", 31},
245
+ {"IRB::Notifier::ErrUnrecognizedLevel", 35},
246
+ {"IRB::Notifier::ErrUndefinedNotifier", 35},
247
+ {"IRB::StdioOutputMethod", 22},
248
+ {"IRB::OutputMethod::NotImplementedError", 38},
249
+ {"IRB::OutputMethod", 17},
250
+ {"IRB::IllegalRCGenerator", 23},
251
+ {"IRB::UndefinedPromptMode", 24},
252
+ {"IRB::CantChangeBinding", 22},
253
+ {"IRB::CantShiftToMultiIrbMode", 28},
254
+ {"IRB::NoSuchJob", 14},
255
+ {"IRB::IrbSwitchedToCurrentThread", 31},
256
+ {"IRB::IrbAlreadyDead", 19},
257
+ {"IRB::IllegalParameter", 21},
258
+ {"IRB::CantReturnToNormalMode", 27},
259
+ {"IRB::NotImplementedError", 24},
260
+ {"IRB::UnrecognizedSwitch", 23},
261
+ {"IRB::Irb", 8},
262
+ {"IRB::Abort", 10},
263
+ {"IRB::Locale", 11},
264
+ {"IRB::SLex::ErrNodeNothing", 25},
265
+ {"IRB::SLex::ErrNodeAlreadyExists", 31},
266
+ {"RubyLex", 7},
267
+ {"IRB::SLex::Node", 15},
268
+ {"Gem::SystemExitException", 24},
269
+ {"Gem::VerificationError", 22},
270
+ {"RubyToken::TkError", 18},
271
+ {"RubyToken::TkUnknownChar", 24},
272
+ {"RubyToken::TkOPASGN", 19},
273
+ {"RubyToken::TkOp", 15},
274
+ {"RubyToken::TkVal", 16},
275
+ {"RubyToken::TkId", 15},
276
+ {"RubyToken::TkNode", 17},
277
+ {"RubyToken::Token", 16},
278
+ {"RubyToken::TkUNDEF", 18},
279
+ {"RubyToken::TkDEF", 16},
280
+ {"RubyToken::TkMODULE", 19},
281
+ {"RubyToken::TkCLASS", 18},
282
+ {"RubyToken::TkWHILE", 18},
283
+ {"RubyToken::TkWHEN", 17},
284
+ {"RubyToken::TkCASE", 17},
285
+ {"RubyToken::TkELSE", 17},
286
+ {"RubyToken::TkELSIF", 18},
287
+ {"RubyToken::TkTHEN", 17},
288
+ {"RubyToken::TkUNLESS", 19},
289
+ {"RubyToken::TkIF", 15},
290
+ {"RubyToken::TkEND", 16},
291
+ {"RubyToken::TkENSURE", 19},
292
+ {"RubyToken::TkRESCUE", 19},
293
+ {"RubyToken::TkBEGIN", 18},
294
+ {"RubyToken::TkDO", 15},
295
+ {"RubyToken::TkIN", 15},
296
+ {"RubyToken::TkRETRY", 18},
297
+ {"RubyToken::TkREDO", 17},
298
+ {"RubyToken::TkNEXT", 17},
299
+ {"RubyToken::TkBREAK", 18},
300
+ {"RubyToken::TkFOR", 16},
301
+ {"RubyToken::TkUNTIL", 18},
302
+ {"RubyToken::TkTRUE", 17},
303
+ {"RubyToken::TkNIL", 16},
304
+ {"RubyToken::TkSELF", 17},
305
+ {"RubyToken::TkSUPER", 18},
306
+ {"RubyToken::TkYIELD", 18},
307
+ {"RubyToken::TkRETURN", 19},
308
+ {"RubyToken::TkAND", 16},
309
+ {"RubyToken::TkFALSE", 18},
310
+ {"RubyToken::TkUNLESS_MOD", 23},
311
+ {"RubyToken::TkIF_MOD", 19},
312
+ {"RubyToken::TkNOT", 16},
313
+ {"RubyToken::TkOR", 15},
314
+ {"RubyToken::TkALIAS", 18},
315
+ {"RubyToken::TkUNTIL_MOD", 22},
316
+ {"RubyToken::TkWHILE_MOD", 22},
317
+ {"RubyToken::TkGVAR", 17},
318
+ {"RubyToken::TkFID", 16},
319
+ {"RubyToken::TkIDENTIFIER", 23},
320
+ {"RubyToken::Tk__FILE__", 21},
321
+ {"RubyToken::Tk__LINE__", 21},
322
+ {"RubyToken::TklEND", 17},
323
+ {"RubyToken::TklBEGIN", 19},
324
+ {"RubyToken::TkDEFINED", 20},
325
+ {"RubyToken::TkDREGEXP", 20},
326
+ {"RubyToken::TkDXSTRING", 21},
327
+ {"RubyToken::TkDSTRING", 20},
328
+ {"RubyToken::TkSYMBOL", 19},
329
+ {"RubyToken::TkREGEXP", 19},
330
+ {"RubyToken::TkXSTRING", 20},
331
+ {"RubyToken::TkSTRING", 19},
332
+ {"RubyToken::TkFLOAT", 18},
333
+ {"RubyToken::TkINTEGER", 20},
334
+ {"RubyToken::TkCONSTANT", 21},
335
+ {"RubyToken::TkIVAR", 17},
336
+ {"RubyToken::TkCVAR", 17},
337
+ {"RubyToken::TkNEQ", 16},
338
+ {"RubyToken::TkEQQ", 16},
339
+ {"RubyToken::TkEQ", 15},
340
+ {"RubyToken::TkCMP", 16},
341
+ {"RubyToken::TkPOW", 16},
342
+ {"RubyToken::TkUMINUS", 19},
343
+ {"RubyToken::TkUPLUS", 18},
344
+ {"Exception2MessageMapper::ErrNotRegisteredException", 50},
345
+ {"RubyToken::TkBACK_REF", 21},
346
+ {"RubyToken::TkNTH_REF", 20},
347
+ {"RubyToken::TkLSHFT", 18},
348
+ {"RubyToken::TkASET", 17},
349
+ {"RubyToken::TkAREF", 17},
350
+ {"RubyToken::TkDOT3", 17},
351
+ {"RubyToken::TkDOT2", 17},
352
+ {"RubyToken::TkNMATCH", 19},
353
+ {"RubyToken::TkMATCH", 18},
354
+ {"RubyToken::TkOROP", 17},
355
+ {"RubyToken::TkANDOP", 18},
356
+ {"RubyToken::TkLEQ", 16},
357
+ {"RubyToken::TkGEQ", 16},
358
+ {"RubyToken::TkAMPER", 18},
359
+ {"RubyToken::TkSTAR", 17},
360
+ {"RubyToken::TkfLBRACE", 20},
361
+ {"RubyToken::TkfLBRACK", 20},
362
+ {"RubyToken::TkfLPAREN", 20},
363
+ {"RubyToken::TkCOLON", 18},
364
+ {"RubyToken::TkQUESTION", 21},
365
+ {"RubyToken::TkASSOC", 18},
366
+ {"RubyToken::TkCOLON3", 19},
367
+ {"RubyToken::TkCOLON2", 19},
368
+ {"RubyToken::TkRSHFT", 18},
369
+ {"RubyToken::TkBITAND", 19},
370
+ {"RubyToken::TkBITXOR", 19},
371
+ {"RubyToken::TkBITOR", 18},
372
+ {"RubyToken::TkMOD", 16},
373
+ {"RubyToken::TkDIV", 16},
374
+ {"RubyToken::TkMULT", 17},
375
+ {"RubyToken::TkMINUS", 18},
376
+ {"RubyToken::TkPLUS", 17},
377
+ {"RubyToken::TkLT", 15},
378
+ {"RubyToken::TkGT", 15},
379
+ {"RubyToken::TkSYMBEG", 19},
380
+ {"IRB::DefaultEncodings", 21},
381
+ {"RubyToken::TkRPAREN", 19},
382
+ {"RubyToken::TkLBRACE", 19},
383
+ {"RubyToken::TkLBRACK", 19},
384
+ {"RubyToken::TkLPAREN", 19},
385
+ {"RubyToken::TkDOT", 16},
386
+ {"RubyToken::TkASSIGN", 19},
387
+ {"RubyToken::TkBACKQUOTE", 22},
388
+ {"RubyToken::TkNOTOP", 18},
389
+ {"RubyToken::TkBITNOT", 19},
390
+ {"RubyToken::TkDOLLAR", 19},
391
+ {"RubyToken::TkAT", 15},
392
+ {"RubyToken::TkBACKSLASH", 22},
393
+ {"RubyToken::TkEND_OF_SCRIPT", 26},
394
+ {"RubyToken::TkNL", 15},
395
+ {"RubyToken::TkSPACE", 18},
396
+ {"RubyToken::TkRD_COMMENT", 23},
397
+ {"RubyToken::TkCOMMENT", 20},
398
+ {"RubyToken::TkSEMICOLON", 22},
399
+ {"RubyToken::TkCOMMA", 18},
400
+ {"RubyToken::TkRBRACE", 19},
401
+ {"RubyToken::TkRBRACK", 19},
402
+ {"RubyLex::TerminateLineInput", 27},
403
+ {"RubyLex::SyntaxError", 20},
404
+ {"RubyLex::TkReading2TokenDuplicateError", 38},
405
+ {"RubyLex::TkSymbol2TokenNoKey", 28},
406
+ {"RubyLex::TkReading2TokenNoKey", 29},
407
+ {"RubyLex::AlreadyDefinedToken", 28},
408
+ {"IRB::FileInputMethod", 20},
409
+ {"IRB::StdioInputMethod", 21},
410
+ {"IRB::InputMethod", 16},
411
+ {"IRB::ReadlineInputMethod", 24},
412
+ {"IRB::Context", 12},
413
+ {"IRB::Inspector", 14},
414
+ {"IRB::WorkSpace", 14},
415
+ {0, 0}};
416
416
 
417
- static uint64_t
418
- micro_time() {
419
- struct timeval tv;
417
+ static uint64_t micro_time() {
418
+ struct timeval tv;
420
419
 
421
420
  gettimeofday(&tv, NULL);
422
421
 
423
422
  return (uint64_t)tv.tv_sec * 1000000ULL + (uint64_t)tv.tv_usec;
424
423
  }
425
424
 
426
- static void
427
- perf() {
428
- StrLen d;
429
- VALUE v;
430
- VALUE *slot = 0;
431
- uint64_t dt, start;
432
- int i, iter = 1000000;
433
- int dataCnt = sizeof(data) / sizeof(*data);
425
+ static void perf() {
426
+ StrLen d;
427
+ VALUE v;
428
+ VALUE * slot = 0;
429
+ uint64_t dt, start;
430
+ int i, iter = 1000000;
431
+ int dataCnt = sizeof(data) / sizeof(*data);
434
432
 
435
433
  oj_hash_init();
436
434
  start = micro_time();
437
435
  for (i = iter; 0 < i; i--) {
438
- for (d = data; 0 != d->str; d++) {
439
- v = oj_class_hash_get(d->str, d->len, &slot);
440
- if (Qundef == v) {
441
- if (0 != slot) {
442
- v = ID2SYM(rb_intern(d->str));
443
- *slot = v;
444
- }
445
- }
446
- }
436
+ for (d = data; 0 != d->str; d++) {
437
+ v = oj_class_hash_get(d->str, d->len, &slot);
438
+ if (Qundef == v) {
439
+ if (0 != slot) {
440
+ v = ID2SYM(rb_intern(d->str));
441
+ *slot = v;
442
+ }
443
+ }
444
+ }
447
445
  }
448
446
  dt = micro_time() - start;
449
447
  #if IS_WINDOWS
450
- printf("%d iterations took %ld msecs, %ld gets/msec\n", iter, (long)(dt / 1000), (long)(iter * dataCnt / (dt / 1000)));
448
+ printf("%d iterations took %ld msecs, %ld gets/msec\n",
449
+ iter,
450
+ (long)(dt / 1000),
451
+ (long)(iter * dataCnt / (dt / 1000)));
451
452
  #else
452
- printf("%d iterations took %"PRIu64" msecs, %ld gets/msec\n", iter, dt / 1000, (long)(iter * dataCnt / (dt / 1000)));
453
+ printf("%d iterations took %" PRIu64 " msecs, %ld gets/msec\n",
454
+ iter,
455
+ dt / 1000,
456
+ (long)(iter * dataCnt / (dt / 1000)));
453
457
  #endif
454
458
  }
455
459
 
456
- void
457
- oj_hash_test() {
458
- StrLen d;
459
- VALUE v;
460
- VALUE *slot = 0;;
460
+ void oj_hash_test() {
461
+ StrLen d;
462
+ VALUE v;
463
+ VALUE *slot = 0;
464
+ ;
461
465
 
462
466
  oj_hash_init();
463
467
  for (d = data; 0 != d->str; d++) {
464
- char *s = oj_strndup(d->str, d->len);
465
- v = oj_class_hash_get(d->str, d->len, &slot);
466
- if (Qnil == v) {
467
- if (0 == slot) {
468
- printf("*** failed to get a slot for %s\n", s);
469
- } else {
470
- v = ID2SYM(rb_intern(d->str));
471
- *slot = v;
472
- }
473
- } else {
474
- VALUE rs = rb_funcall2(v, rb_intern("to_s"), 0, 0);
468
+ char *s = oj_strndup(d->str, d->len);
469
+ v = oj_class_hash_get(d->str, d->len, &slot);
470
+ if (Qnil == v) {
471
+ if (0 == slot) {
472
+ printf("*** failed to get a slot for %s\n", s);
473
+ } else {
474
+ v = ID2SYM(rb_intern(d->str));
475
+ *slot = v;
476
+ }
477
+ } else {
478
+ VALUE rs = rb_funcall2(v, rb_intern("to_s"), 0, 0);
475
479
 
476
- printf("*** get on '%s' returned '%s' (%s)\n", s, StringValuePtr(rs), rb_class2name(rb_obj_class(v)));
477
- }
478
- /*oj_hash_print(c);*/
480
+ printf("*** get on '%s' returned '%s' (%s)\n",
481
+ s,
482
+ StringValuePtr(rs),
483
+ rb_class2name(rb_obj_class(v)));
484
+ }
485
+ /*oj_hash_print(c);*/
479
486
  }
480
487
  printf("*** ---------- hash table ------------\n");
481
488
  oj_hash_print();