qr_reader-native 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE-mruby.txt +22 -0
- data/LICENSE-spinel.txt +19 -0
- data/LICENSE.txt +21 -0
- data/README.md +61 -0
- data/ext/qr_reader_native/SPINEL_VERSION +1 -0
- data/ext/qr_reader_native/extconf.rb +8 -0
- data/ext/qr_reader_native/mruby/error.h +13 -0
- data/ext/qr_reader_native/mruby/internal.h +145 -0
- data/ext/qr_reader_native/mruby/string.h +22 -0
- data/ext/qr_reader_native/mruby.h +93 -0
- data/ext/qr_reader_native/mruby_shim.h +118 -0
- data/ext/qr_reader_native/qr_reader_native.c +13513 -0
- data/ext/qr_reader_native/qr_reader_native.h +29 -0
- data/ext/qr_reader_native/qr_reader_native_ext.c +598 -0
- data/ext/qr_reader_native/re_cased.h +71 -0
- data/ext/qr_reader_native/re_compile.c +5784 -0
- data/ext/qr_reader_native/re_ctype.h +3540 -0
- data/ext/qr_reader_native/re_exec.c +2190 -0
- data/ext/qr_reader_native/re_internal.h +671 -0
- data/ext/qr_reader_native/re_prop.h +4629 -0
- data/ext/qr_reader_native/re_spinel.c +363 -0
- data/ext/qr_reader_native/re_spinel.h +22 -0
- data/ext/qr_reader_native/re_spinel_utf8.inc +97 -0
- data/ext/qr_reader_native/re_utf8.c +156 -0
- data/ext/qr_reader_native/sp_alloc.c +1447 -0
- data/ext/qr_reader_native/sp_alloc.h +1196 -0
- data/ext/qr_reader_native/sp_argf.h +33 -0
- data/ext/qr_reader_native/sp_array.c +1052 -0
- data/ext/qr_reader_native/sp_array.h +456 -0
- data/ext/qr_reader_native/sp_bigint.c +5826 -0
- data/ext/qr_reader_native/sp_bigint.h +117 -0
- data/ext/qr_reader_native/sp_cold.c +5259 -0
- data/ext/qr_reader_native/sp_compat.h +402 -0
- data/ext/qr_reader_native/sp_core.c +818 -0
- data/ext/qr_reader_native/sp_core.h +56 -0
- data/ext/qr_reader_native/sp_crypto.c +877 -0
- data/ext/qr_reader_native/sp_crypto.h +169 -0
- data/ext/qr_reader_native/sp_dtoa.c +1533 -0
- data/ext/qr_reader_native/sp_dtoa.h +29 -0
- data/ext/qr_reader_native/sp_encoding_names.h +172 -0
- data/ext/qr_reader_native/sp_enum.h +86 -0
- data/ext/qr_reader_native/sp_exc.c +1185 -0
- data/ext/qr_reader_native/sp_exc.h +186 -0
- data/ext/qr_reader_native/sp_exc_ctx.h +56 -0
- data/ext/qr_reader_native/sp_fiber.c +889 -0
- data/ext/qr_reader_native/sp_fiber.h +162 -0
- data/ext/qr_reader_native/sp_fiber_ctx.h +84 -0
- data/ext/qr_reader_native/sp_format.c +695 -0
- data/ext/qr_reader_native/sp_format.h +83 -0
- data/ext/qr_reader_native/sp_gc.c +1793 -0
- data/ext/qr_reader_native/sp_gc.h +762 -0
- data/ext/qr_reader_native/sp_hash.c +131 -0
- data/ext/qr_reader_native/sp_hash.h +131 -0
- data/ext/qr_reader_native/sp_inspect.c +215 -0
- data/ext/qr_reader_native/sp_inspect.h +128 -0
- data/ext/qr_reader_native/sp_io.c +1676 -0
- data/ext/qr_reader_native/sp_io.h +272 -0
- data/ext/qr_reader_native/sp_iobuffer.c +1014 -0
- data/ext/qr_reader_native/sp_iobuffer.h +167 -0
- data/ext/qr_reader_native/sp_marshal.c +487 -0
- data/ext/qr_reader_native/sp_marshal.h +60 -0
- data/ext/qr_reader_native/sp_net.c +1029 -0
- data/ext/qr_reader_native/sp_net.h +205 -0
- data/ext/qr_reader_native/sp_pack.c +1254 -0
- data/ext/qr_reader_native/sp_poly_cold.c +1220 -0
- data/ext/qr_reader_native/sp_proc.c +410 -0
- data/ext/qr_reader_native/sp_proc.h +327 -0
- data/ext/qr_reader_native/sp_process.c +547 -0
- data/ext/qr_reader_native/sp_process_status.c +211 -0
- data/ext/qr_reader_native/sp_process_status.h +66 -0
- data/ext/qr_reader_native/sp_random.c +287 -0
- data/ext/qr_reader_native/sp_random.h +52 -0
- data/ext/qr_reader_native/sp_range.h +144 -0
- data/ext/qr_reader_native/sp_re.c +1379 -0
- data/ext/qr_reader_native/sp_re.h +186 -0
- data/ext/qr_reader_native/sp_re_names.h +59 -0
- data/ext/qr_reader_native/sp_sched.c +4044 -0
- data/ext/qr_reader_native/sp_sched.h +295 -0
- data/ext/qr_reader_native/sp_slab.c +1507 -0
- data/ext/qr_reader_native/sp_str.c +1462 -0
- data/ext/qr_reader_native/sp_str.h +306 -0
- data/ext/qr_reader_native/sp_str_crypt.c +23 -0
- data/ext/qr_reader_native/sp_string.c +92 -0
- data/ext/qr_reader_native/sp_string.h +253 -0
- data/ext/qr_reader_native/sp_system.c +78 -0
- data/ext/qr_reader_native/sp_system.h +18 -0
- data/ext/qr_reader_native/sp_time.c +860 -0
- data/ext/qr_reader_native/sp_time.h +100 -0
- data/ext/qr_reader_native/sp_types.h +292 -0
- data/ext/qr_reader_native/spinel_rt.h +19017 -0
- data/ext/qr_reader_native/unicase.c +399 -0
- data/ext/qr_reader_native/unicase.h +901 -0
- data/lib/qr_reader/native.rb +6 -0
- metadata +153 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* sp_dtoa.h -- locale-independent float <-> string conversion.
|
|
2
|
+
*
|
|
3
|
+
* mruby's fp_uscale.c (Russ Cox's Unrounded Scaling; see
|
|
4
|
+
* https://research.swtch.com/fp), adapted for spinel. It is pure integer
|
|
5
|
+
* arithmetic and never touches libc's locale-sensitive snprintf/strtod, so a
|
|
6
|
+
* float always renders and parses with a `.` decimal point regardless of the
|
|
7
|
+
* process locale -- the invariant Ruby guarantees. */
|
|
8
|
+
#ifndef SP_DTOA_H
|
|
9
|
+
#define SP_DTOA_H
|
|
10
|
+
|
|
11
|
+
#include "sp_types.h"
|
|
12
|
+
|
|
13
|
+
/* Shortest-round-trip and printf-style float formatting into `buf` (NUL
|
|
14
|
+
terminated). fmt is one of 'e'/'f'/'g' (upper-case for E/upper output);
|
|
15
|
+
prec is the precision, or -2 for shortest round-trip ('g' only). sign is a
|
|
16
|
+
forced leading sign ('+'/' ') or '\0'. Returns the written length. */
|
|
17
|
+
int sp_format_float(sp_float f, char *buf, size_t buf_size, char fmt, int prec, char sign);
|
|
18
|
+
|
|
19
|
+
/* Parse a float prefix of `str` (leading space skipped). On success stores the
|
|
20
|
+
value in *fp, sets *endp past the consumed text, and returns TRUE. */
|
|
21
|
+
sp_bool sp_read_float(const char *str, char **endp, double *fp);
|
|
22
|
+
|
|
23
|
+
/* Shortest-round-trip significant digits of a finite non-zero f: writes the
|
|
24
|
+
NUL-terminated digits to `digs`, their count to *nd, and returns the base-10
|
|
25
|
+
exponent of the leading digit. The caller applies its own fixed/scientific
|
|
26
|
+
layout (Ruby's Float#to_s threshold is not %g's). */
|
|
27
|
+
int sp_float_shortest(double f, char *digs, int *nd);
|
|
28
|
+
|
|
29
|
+
#endif
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* Encoding names and aliases, CRuby 4.0.7. Generated by tools/gen_encoding_names.rb. */
|
|
2
|
+
{"646", "US-ASCII"},
|
|
3
|
+
{"ANSI_X3.4-1968", "US-ASCII"},
|
|
4
|
+
{"ASCII", "US-ASCII"},
|
|
5
|
+
{"ASCII-8BIT", "ASCII-8BIT"},
|
|
6
|
+
{"BINARY", "ASCII-8BIT"},
|
|
7
|
+
{"Big5", "Big5"},
|
|
8
|
+
{"Big5-HKSCS", "Big5-HKSCS"},
|
|
9
|
+
{"Big5-HKSCS:2008", "Big5-HKSCS"},
|
|
10
|
+
{"Big5-UAO", "Big5-UAO"},
|
|
11
|
+
{"CESU-8", "CESU-8"},
|
|
12
|
+
{"CP1250", "Windows-1250"},
|
|
13
|
+
{"CP1251", "Windows-1251"},
|
|
14
|
+
{"CP1252", "Windows-1252"},
|
|
15
|
+
{"CP1253", "Windows-1253"},
|
|
16
|
+
{"CP1254", "Windows-1254"},
|
|
17
|
+
{"CP1255", "Windows-1255"},
|
|
18
|
+
{"CP1256", "Windows-1256"},
|
|
19
|
+
{"CP1257", "Windows-1257"},
|
|
20
|
+
{"CP1258", "Windows-1258"},
|
|
21
|
+
{"CP437", "IBM437"},
|
|
22
|
+
{"CP50220", "CP50220"},
|
|
23
|
+
{"CP50221", "CP50221"},
|
|
24
|
+
{"CP51932", "CP51932"},
|
|
25
|
+
{"CP65000", "UTF-7"},
|
|
26
|
+
{"CP65001", "UTF-8"},
|
|
27
|
+
{"CP720", "IBM720"},
|
|
28
|
+
{"CP737", "IBM737"},
|
|
29
|
+
{"CP775", "IBM775"},
|
|
30
|
+
{"CP850", "CP850"},
|
|
31
|
+
{"CP852", "CP852"},
|
|
32
|
+
{"CP855", "CP855"},
|
|
33
|
+
{"CP857", "IBM857"},
|
|
34
|
+
{"CP860", "IBM860"},
|
|
35
|
+
{"CP861", "IBM861"},
|
|
36
|
+
{"CP862", "IBM862"},
|
|
37
|
+
{"CP863", "IBM863"},
|
|
38
|
+
{"CP864", "IBM864"},
|
|
39
|
+
{"CP865", "IBM865"},
|
|
40
|
+
{"CP866", "IBM866"},
|
|
41
|
+
{"CP869", "IBM869"},
|
|
42
|
+
{"CP874", "Windows-874"},
|
|
43
|
+
{"CP878", "KOI8-R"},
|
|
44
|
+
{"CP932", "Windows-31J"},
|
|
45
|
+
{"CP936", "GBK"},
|
|
46
|
+
{"CP949", "CP949"},
|
|
47
|
+
{"CP950", "CP950"},
|
|
48
|
+
{"CP951", "CP951"},
|
|
49
|
+
{"EUC-CN", "GB2312"},
|
|
50
|
+
{"EUC-JIS-2004", "EUC-JIS-2004"},
|
|
51
|
+
{"EUC-JISX0213", "EUC-JIS-2004"},
|
|
52
|
+
{"EUC-JP", "EUC-JP"},
|
|
53
|
+
{"EUC-KR", "EUC-KR"},
|
|
54
|
+
{"EUC-TW", "EUC-TW"},
|
|
55
|
+
{"Emacs-Mule", "Emacs-Mule"},
|
|
56
|
+
{"GB12345", "GB12345"},
|
|
57
|
+
{"GB18030", "GB18030"},
|
|
58
|
+
{"GB1988", "GB1988"},
|
|
59
|
+
{"GB2312", "GB2312"},
|
|
60
|
+
{"GBK", "GBK"},
|
|
61
|
+
{"IBM037", "IBM037"},
|
|
62
|
+
{"IBM437", "IBM437"},
|
|
63
|
+
{"IBM720", "IBM720"},
|
|
64
|
+
{"IBM737", "IBM737"},
|
|
65
|
+
{"IBM775", "IBM775"},
|
|
66
|
+
{"IBM850", "CP850"},
|
|
67
|
+
{"IBM852", "IBM852"},
|
|
68
|
+
{"IBM855", "IBM855"},
|
|
69
|
+
{"IBM857", "IBM857"},
|
|
70
|
+
{"IBM860", "IBM860"},
|
|
71
|
+
{"IBM861", "IBM861"},
|
|
72
|
+
{"IBM862", "IBM862"},
|
|
73
|
+
{"IBM863", "IBM863"},
|
|
74
|
+
{"IBM864", "IBM864"},
|
|
75
|
+
{"IBM865", "IBM865"},
|
|
76
|
+
{"IBM866", "IBM866"},
|
|
77
|
+
{"IBM869", "IBM869"},
|
|
78
|
+
{"ISO-2022-JP", "ISO-2022-JP"},
|
|
79
|
+
{"ISO-2022-JP-2", "ISO-2022-JP-2"},
|
|
80
|
+
{"ISO-2022-JP-KDDI", "ISO-2022-JP-KDDI"},
|
|
81
|
+
{"ISO-8859-1", "ISO-8859-1"},
|
|
82
|
+
{"ISO-8859-10", "ISO-8859-10"},
|
|
83
|
+
{"ISO-8859-11", "ISO-8859-11"},
|
|
84
|
+
{"ISO-8859-13", "ISO-8859-13"},
|
|
85
|
+
{"ISO-8859-14", "ISO-8859-14"},
|
|
86
|
+
{"ISO-8859-15", "ISO-8859-15"},
|
|
87
|
+
{"ISO-8859-16", "ISO-8859-16"},
|
|
88
|
+
{"ISO-8859-2", "ISO-8859-2"},
|
|
89
|
+
{"ISO-8859-3", "ISO-8859-3"},
|
|
90
|
+
{"ISO-8859-4", "ISO-8859-4"},
|
|
91
|
+
{"ISO-8859-5", "ISO-8859-5"},
|
|
92
|
+
{"ISO-8859-6", "ISO-8859-6"},
|
|
93
|
+
{"ISO-8859-7", "ISO-8859-7"},
|
|
94
|
+
{"ISO-8859-8", "ISO-8859-8"},
|
|
95
|
+
{"ISO-8859-9", "ISO-8859-9"},
|
|
96
|
+
{"ISO2022-JP", "ISO-2022-JP"},
|
|
97
|
+
{"ISO2022-JP2", "ISO-2022-JP-2"},
|
|
98
|
+
{"ISO8859-1", "ISO-8859-1"},
|
|
99
|
+
{"ISO8859-10", "ISO-8859-10"},
|
|
100
|
+
{"ISO8859-11", "ISO-8859-11"},
|
|
101
|
+
{"ISO8859-13", "ISO-8859-13"},
|
|
102
|
+
{"ISO8859-14", "ISO-8859-14"},
|
|
103
|
+
{"ISO8859-15", "ISO-8859-15"},
|
|
104
|
+
{"ISO8859-16", "ISO-8859-16"},
|
|
105
|
+
{"ISO8859-2", "ISO-8859-2"},
|
|
106
|
+
{"ISO8859-3", "ISO-8859-3"},
|
|
107
|
+
{"ISO8859-4", "ISO-8859-4"},
|
|
108
|
+
{"ISO8859-5", "ISO-8859-5"},
|
|
109
|
+
{"ISO8859-6", "ISO-8859-6"},
|
|
110
|
+
{"ISO8859-7", "ISO-8859-7"},
|
|
111
|
+
{"ISO8859-8", "ISO-8859-8"},
|
|
112
|
+
{"ISO8859-9", "ISO-8859-9"},
|
|
113
|
+
{"KOI8-R", "KOI8-R"},
|
|
114
|
+
{"KOI8-U", "KOI8-U"},
|
|
115
|
+
{"MacJapan", "MacJapanese"},
|
|
116
|
+
{"MacJapanese", "MacJapanese"},
|
|
117
|
+
{"PCK", "Windows-31J"},
|
|
118
|
+
{"SJIS", "Windows-31J"},
|
|
119
|
+
{"SJIS-DoCoMo", "SJIS-DoCoMo"},
|
|
120
|
+
{"SJIS-KDDI", "SJIS-KDDI"},
|
|
121
|
+
{"SJIS-SoftBank", "SJIS-SoftBank"},
|
|
122
|
+
{"Shift_JIS", "Shift_JIS"},
|
|
123
|
+
{"TIS-620", "TIS-620"},
|
|
124
|
+
{"UCS-2BE", "UTF-16BE"},
|
|
125
|
+
{"UCS-4BE", "UTF-32BE"},
|
|
126
|
+
{"UCS-4LE", "UTF-32LE"},
|
|
127
|
+
{"US-ASCII", "US-ASCII"},
|
|
128
|
+
{"UTF-16", "UTF-16"},
|
|
129
|
+
{"UTF-16BE", "UTF-16BE"},
|
|
130
|
+
{"UTF-16LE", "UTF-16LE"},
|
|
131
|
+
{"UTF-32", "UTF-32"},
|
|
132
|
+
{"UTF-32BE", "UTF-32BE"},
|
|
133
|
+
{"UTF-32LE", "UTF-32LE"},
|
|
134
|
+
{"UTF-7", "UTF-7"},
|
|
135
|
+
{"UTF-8", "UTF-8"},
|
|
136
|
+
{"UTF-8-HFS", "UTF8-MAC"},
|
|
137
|
+
{"UTF-8-MAC", "UTF8-MAC"},
|
|
138
|
+
{"UTF8-DoCoMo", "UTF8-DoCoMo"},
|
|
139
|
+
{"UTF8-KDDI", "UTF8-KDDI"},
|
|
140
|
+
{"UTF8-MAC", "UTF8-MAC"},
|
|
141
|
+
{"UTF8-SoftBank", "UTF8-SoftBank"},
|
|
142
|
+
{"Windows-1250", "Windows-1250"},
|
|
143
|
+
{"Windows-1251", "Windows-1251"},
|
|
144
|
+
{"Windows-1252", "Windows-1252"},
|
|
145
|
+
{"Windows-1253", "Windows-1253"},
|
|
146
|
+
{"Windows-1254", "Windows-1254"},
|
|
147
|
+
{"Windows-1255", "Windows-1255"},
|
|
148
|
+
{"Windows-1256", "Windows-1256"},
|
|
149
|
+
{"Windows-1257", "Windows-1257"},
|
|
150
|
+
{"Windows-1258", "Windows-1258"},
|
|
151
|
+
{"Windows-31J", "Windows-31J"},
|
|
152
|
+
{"Windows-874", "Windows-874"},
|
|
153
|
+
{"csWindows31J", "Windows-31J"},
|
|
154
|
+
{"ebcdic-cp-us", "IBM037"},
|
|
155
|
+
{"euc-jp-ms", "eucJP-ms"},
|
|
156
|
+
{"eucCN", "GB2312"},
|
|
157
|
+
{"eucJP", "EUC-JP"},
|
|
158
|
+
{"eucJP-ms", "eucJP-ms"},
|
|
159
|
+
{"eucKR", "EUC-KR"},
|
|
160
|
+
{"eucTW", "EUC-TW"},
|
|
161
|
+
{"macCentEuro", "macCentEuro"},
|
|
162
|
+
{"macCroatian", "macCroatian"},
|
|
163
|
+
{"macCyrillic", "macCyrillic"},
|
|
164
|
+
{"macGreek", "macGreek"},
|
|
165
|
+
{"macIceland", "macIceland"},
|
|
166
|
+
{"macRoman", "macRoman"},
|
|
167
|
+
{"macRomania", "macRomania"},
|
|
168
|
+
{"macThai", "macThai"},
|
|
169
|
+
{"macTurkish", "macTurkish"},
|
|
170
|
+
{"macUkraine", "macUkraine"},
|
|
171
|
+
{"stateless-ISO-2022-JP", "stateless-ISO-2022-JP"},
|
|
172
|
+
{"stateless-ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI"},
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* sp_enum.h -- the Enumerator handle (cursor/generator ops in lib/sp_cold.c).
|
|
2
|
+
*
|
|
3
|
+
* Two flavors: a materialized snapshot (items + cursor, from a collection's
|
|
4
|
+
* blockless #each) or a fiber-backed generator (Enumerator.new { |y| ... },
|
|
5
|
+
* where `y << v` is a Fiber.yield). The fiber is created lazily on first
|
|
6
|
+
* #next and re-created on #rewind. */
|
|
7
|
+
#ifndef SP_ENUM_H
|
|
8
|
+
#define SP_ENUM_H
|
|
9
|
+
|
|
10
|
+
#include "sp_alloc.h"
|
|
11
|
+
#include "sp_fiber.h"
|
|
12
|
+
|
|
13
|
+
#define SP_PAIR_EACH 1
|
|
14
|
+
#define SP_PAIR_PACKED 2
|
|
15
|
+
|
|
16
|
+
/* The Array a generator step that yields several values packs them in: an
|
|
17
|
+
ordinary poly array, told apart by its scan function so a generator that
|
|
18
|
+
also yields single values (an Array among them) keeps each step's arity. */
|
|
19
|
+
void sp_PolyArray_pack_scan(void *p);
|
|
20
|
+
sp_PolyArray *sp_PolyArray_new_pack(void);
|
|
21
|
+
static inline sp_bool sp_poly_is_pack(sp_RbVal v) {
|
|
22
|
+
return v.tag == SP_TAG_OBJ && v.cls_id == SP_BUILTIN_POLY_ARRAY && v.v.p &&
|
|
23
|
+
((sp_gc_hdr *)((char *)v.v.p - sizeof(sp_gc_hdr)))->scan == sp_PolyArray_pack_scan;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* A generator step that yields no value (`y.yield`, `y.yield(*[])`): nil to a
|
|
27
|
+
reader of the item, and no values to a `|*r|` block. The mark rides in the
|
|
28
|
+
nil's cls_id, which nothing else reads. */
|
|
29
|
+
static inline sp_RbVal sp_box_empty_step(void) {
|
|
30
|
+
sp_RbVal r = sp_box_nil(); r.cls_id = 1; return r;
|
|
31
|
+
}
|
|
32
|
+
static inline sp_bool sp_poly_is_empty_step(sp_RbVal v) {
|
|
33
|
+
return v.tag == SP_TAG_NIL && v.cls_id == 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
typedef struct {
|
|
37
|
+
sp_PolyArray *items; sp_int cursor; /* materialized mode (items != NULL) */
|
|
38
|
+
void (*gen)(sp_Fiber *); /* generator body (fiber mode, gen != NULL) */
|
|
39
|
+
void *gen_cap; /* captures, passed via fiber user_data */
|
|
40
|
+
sp_Fiber *fib; /* current generator fiber (lazy) */
|
|
41
|
+
sp_bool peeked; sp_RbVal peek_val; /* #peek lookahead cache */
|
|
42
|
+
sp_RbVal size; /* #size for a generator: a value, a
|
|
43
|
+
callable (Proc), or nil. Unused by
|
|
44
|
+
the materialized path (items->len). */
|
|
45
|
+
sp_RbVal feed; sp_bool has_feed; /* #feed: value returned by the next Fiber.yield */
|
|
46
|
+
sp_RbVal gen_result; /* generator body's return -> StopIteration#result */
|
|
47
|
+
sp_RbVal source; /* the iterated receiver -> materialized StopIteration#result */
|
|
48
|
+
sp_bool has_src; /* source is set, even to nil: `nil.then`'s receiver IS
|
|
49
|
+
nil, and #inspect must not read that as "no source"
|
|
50
|
+
and fall back to the items (sp_gc_alloc zero-fills) */
|
|
51
|
+
const char *meth; /* creating method name, for #inspect ("each", ...):
|
|
52
|
+
an SPL literal or a GC-traced heap label */
|
|
53
|
+
sp_bool gen_label; /* #inspect as a Generator wrapper (chunk_while & co.):
|
|
54
|
+
the items are an eager snapshot, but CRuby shows
|
|
55
|
+
#<Enumerator: #<Enumerator::Generator:0x..>:each> */
|
|
56
|
+
sp_bool frozen; /* Object#freeze observed (sp_gc_alloc zero-fills) */
|
|
57
|
+
sp_bool is_chain; /* built by Enumerable#chain / Enumerator#+: the items
|
|
58
|
+
are the concatenated sources, and #class reports
|
|
59
|
+
Enumerator::Chain (sp_gc_alloc zero-fills) */
|
|
60
|
+
sp_bool is_product; /* built by Enumerator.product / Enumerator::Product.new:
|
|
61
|
+
the items are the tuples, `source` the factors, and
|
|
62
|
+
#class reports Enumerator::Product (zero-filled) */
|
|
63
|
+
sp_bool endless; /* an argless #cycle: the items are one round, and
|
|
64
|
+
#next / #peek start over at their end, so the
|
|
65
|
+
enumerator never stops (sp_gc_alloc zero-fills) */
|
|
66
|
+
sp_bool is_bsearch; /* Array#bsearch enum_for: items are candidates,
|
|
67
|
+
with the block result steering the search */
|
|
68
|
+
sp_int bsearch_lo, bsearch_hi, bsearch_mid;
|
|
69
|
+
sp_bool bsearch_waiting;
|
|
70
|
+
sp_RbVal bsearch_result;
|
|
71
|
+
unsigned char yields_pair; /* SP_PAIR_EACH: each item is the two values one step
|
|
72
|
+
yields (each_with_index, with_index,
|
|
73
|
+
each_with_object, with_object) packed as an Array,
|
|
74
|
+
which a block of map and its kin takes spread;
|
|
75
|
+
SP_PAIR_PACKED: only the items packed by a
|
|
76
|
+
generator step that yielded several values
|
|
77
|
+
(sp_PolyArray_new_pack) are (sp_gc_alloc
|
|
78
|
+
zero-fills) */
|
|
79
|
+
sp_PolyArray *walk_buf; /* a walker (sp_enum_walker_boxed): the items pulled
|
|
80
|
+
so far by an index walk over a generator or
|
|
81
|
+
endless source, one at a time; NULL otherwise */
|
|
82
|
+
sp_int walk_next; /* the walk's next index: how far it has read */
|
|
83
|
+
sp_bool walk_done; /* the source has no more items */
|
|
84
|
+
} sp_Enumerator;
|
|
85
|
+
|
|
86
|
+
#endif
|