xbintsc 0.3.15 → 0.3.18
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.
- package/dist/src/cli/main.js +4 -4
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/codegen/generator/state.js +8 -0
- package/dist/src/codegen/generator/state.js.map +1 -1
- package/dist/src/codegen/generator/tables.js +8 -0
- package/dist/src/codegen/generator/tables.js.map +1 -1
- package/dist/src/driver/bundler/graph.d.ts +8 -0
- package/dist/src/driver/bundler/graph.js +85 -0
- package/dist/src/driver/bundler/graph.js.map +1 -0
- package/dist/src/driver/bundler/merge.d.ts +11 -0
- package/dist/src/driver/bundler/merge.js +288 -0
- package/dist/src/driver/bundler/merge.js.map +1 -0
- package/dist/src/driver/bundler/resolve.d.ts +12 -0
- package/dist/src/driver/bundler/resolve.js +246 -0
- package/dist/src/driver/bundler/resolve.js.map +1 -0
- package/dist/src/driver/bundler/symbols.d.ts +15 -0
- package/dist/src/driver/bundler/symbols.js +51 -0
- package/dist/src/driver/bundler/symbols.js.map +1 -0
- package/dist/src/driver/bundler/types.d.ts +36 -0
- package/dist/src/driver/bundler/types.js +5 -0
- package/dist/src/driver/bundler/types.js.map +1 -0
- package/dist/src/driver/modules.d.ts +9 -16
- package/dist/src/driver/modules.js +8 -644
- package/dist/src/driver/modules.js.map +1 -1
- package/dist/src/extensions/catalog.js +2 -1
- package/dist/src/extensions/catalog.js.map +1 -1
- package/dist/src/extensions/gui/index.d.ts +24 -0
- package/dist/src/extensions/gui/index.js +101 -0
- package/dist/src/extensions/gui/index.js.map +1 -0
- package/dist/tests/e2e/compile-basics.test.d.ts +4 -0
- package/dist/tests/e2e/compile-basics.test.js +134 -0
- package/dist/tests/e2e/compile-basics.test.js.map +1 -0
- package/dist/tests/e2e/compile-builtins.test.d.ts +4 -0
- package/dist/tests/e2e/compile-builtins.test.js +191 -0
- package/dist/tests/e2e/compile-builtins.test.js.map +1 -0
- package/dist/tests/e2e/compile-control-flow.test.d.ts +4 -0
- package/dist/tests/e2e/compile-control-flow.test.js +190 -0
- package/dist/tests/e2e/compile-control-flow.test.js.map +1 -0
- package/dist/tests/e2e/compile-modules.test.d.ts +4 -0
- package/dist/tests/e2e/compile-modules.test.js +48 -0
- package/dist/tests/e2e/compile-modules.test.js.map +1 -0
- package/dist/tests/e2e/compile-objects-classes.test.d.ts +4 -0
- package/dist/tests/e2e/compile-objects-classes.test.js +362 -0
- package/dist/tests/e2e/compile-objects-classes.test.js.map +1 -0
- package/dist/tests/e2e/differential-helpers.d.ts +12 -0
- package/dist/tests/e2e/differential-helpers.js +16 -0
- package/dist/tests/e2e/differential-helpers.js.map +1 -0
- package/dist/tests/e2e/differential-language.test.d.ts +4 -0
- package/dist/tests/e2e/{differential.test.js → differential-language.test.js} +5 -287
- package/dist/tests/e2e/differential-language.test.js.map +1 -0
- package/dist/tests/e2e/differential-symbols.test.d.ts +4 -0
- package/dist/tests/e2e/differential-symbols.test.js +92 -0
- package/dist/tests/e2e/differential-symbols.test.js.map +1 -0
- package/dist/tests/e2e/differential-values.test.d.ts +4 -0
- package/dist/tests/e2e/differential-values.test.js +197 -0
- package/dist/tests/e2e/differential-values.test.js.map +1 -0
- package/dist/tests/e2e/gui.test.d.ts +12 -0
- package/dist/tests/e2e/gui.test.js +493 -0
- package/dist/tests/e2e/gui.test.js.map +1 -0
- package/dist/tests/e2e/runtime-coverage-buffer.test.d.ts +4 -0
- package/dist/tests/e2e/runtime-coverage-buffer.test.js +97 -0
- package/dist/tests/e2e/runtime-coverage-buffer.test.js.map +1 -0
- package/dist/tests/e2e/runtime-coverage-globals.test.d.ts +4 -0
- package/dist/tests/e2e/runtime-coverage-globals.test.js +149 -0
- package/dist/tests/e2e/runtime-coverage-globals.test.js.map +1 -0
- package/dist/tests/e2e/runtime-coverage-node-modules.test.d.ts +4 -0
- package/dist/tests/e2e/runtime-coverage-node-modules.test.js +177 -0
- package/dist/tests/e2e/runtime-coverage-node-modules.test.js.map +1 -0
- package/dist/tests/e2e/runtime-coverage-streams.test.d.ts +4 -0
- package/dist/tests/e2e/runtime-coverage-streams.test.js +161 -0
- package/dist/tests/e2e/runtime-coverage-streams.test.js.map +1 -0
- package/dist/tests/e2e/runtime-coverage-system.test.d.ts +4 -0
- package/dist/tests/e2e/runtime-coverage-system.test.js +91 -0
- package/dist/tests/e2e/runtime-coverage-system.test.js.map +1 -0
- package/dist/tests/e2e/timers.test.d.ts +7 -0
- package/dist/tests/e2e/timers.test.js +63 -0
- package/dist/tests/e2e/timers.test.js.map +1 -0
- package/package.json +2 -1
- package/runtime/ext_gui/css.cpp +743 -0
- package/runtime/ext_gui/css.h +98 -0
- package/runtime/ext_gui/document.cpp +264 -0
- package/runtime/ext_gui/document.h +89 -0
- package/runtime/ext_gui/dom.cpp +472 -0
- package/runtime/ext_gui/dom.h +71 -0
- package/runtime/ext_gui/gui.cpp +457 -0
- package/runtime/ext_gui/gui_engine.h +81 -0
- package/runtime/ext_gui/image.cpp +125 -0
- package/runtime/ext_gui/image.h +42 -0
- package/runtime/ext_gui/layout.cpp +748 -0
- package/runtime/ext_gui/layout.h +93 -0
- package/runtime/ext_gui/paint.cpp +137 -0
- package/runtime/ext_gui/paint.h +75 -0
- package/runtime/ext_gui/renderer.cpp +959 -0
- package/runtime/ext_gui/renderer.h +68 -0
- package/runtime/ext_gui/stb_image.h +7988 -0
- package/runtime/ext_gui/style.cpp +771 -0
- package/runtime/ext_gui/style.h +117 -0
- package/runtime/ext_gui/text.cpp +378 -0
- package/runtime/ext_gui/text.h +78 -0
- package/runtime/ext_gui/window.cpp +405 -0
- package/runtime/ext_node/fs/fs_common.h +13 -527
- package/runtime/ext_node/fs/parts/buffer-bridge.inc +6 -0
- package/runtime/ext_node/fs/parts/builtins.inc +69 -0
- package/runtime/ext_node/fs/parts/dir.inc +47 -0
- package/runtime/ext_node/fs/parts/encoding.inc +186 -0
- package/runtime/ext_node/fs/parts/errors.inc +66 -0
- package/runtime/ext_node/fs/parts/flags.inc +39 -0
- package/runtime/ext_node/fs/parts/platform.inc +86 -0
- package/runtime/ext_node/fs/parts/promisify.inc +15 -0
- package/runtime/ext_node/fs/parts/time.inc +9 -0
- package/runtime/rt.h +33 -0
- package/runtime/xt_builtins.c +4 -0
- package/runtime/xt_containers/access.inc +168 -0
- package/runtime/xt_containers/arrays.inc +108 -0
- package/runtime/xt_containers/boxes.inc +11 -0
- package/runtime/xt_containers/objects.inc +326 -0
- package/runtime/xt_containers.c +8 -618
- package/runtime/xt_io/base64.inc +87 -0
- package/runtime/xt_io/console.inc +119 -0
- package/runtime/xt_io/exception.inc +142 -0
- package/runtime/xt_io/inspect.inc +212 -0
- package/runtime/xt_io.c +8 -553
- package/runtime/xt_loop.c +262 -24
- package/runtime/xt_regex/api.inc +58 -0
- package/runtime/xt_regex/helpers.inc +68 -0
- package/runtime/xt_regex/matcher.inc +248 -0
- package/runtime/xt_regex/parser.inc +236 -0
- package/runtime/xt_regex/types.inc +58 -0
- package/runtime/xt_regex.h +9 -672
- package/runtime/xt_values/arithmetic.inc +150 -0
- package/runtime/xt_values/comparison.inc +112 -0
- package/runtime/xt_values/constructors.inc +41 -0
- package/runtime/xt_values/conversions.inc +115 -0
- package/runtime/xt_values/number-format.inc +180 -0
- package/runtime/xt_values/strings.inc +22 -0
- package/runtime/xt_values.c +10 -626
- package/scripts/build-gui.ts +317 -0
- package/src/cli/main.ts +4 -3
- package/src/codegen/generator/state.ts +8 -0
- package/src/codegen/generator/tables.ts +8 -0
- package/src/driver/bundler/graph.ts +95 -0
- package/src/driver/bundler/merge.ts +312 -0
- package/src/driver/bundler/resolve.ts +240 -0
- package/src/driver/bundler/symbols.ts +55 -0
- package/src/driver/bundler/types.ts +37 -0
- package/src/driver/modules.ts +9 -693
- package/src/extensions/catalog.ts +2 -1
- package/src/extensions/gui/index.ts +107 -0
- package/dist/tests/e2e/compile.test.d.ts +0 -8
- package/dist/tests/e2e/compile.test.js +0 -893
- package/dist/tests/e2e/compile.test.js.map +0 -1
- package/dist/tests/e2e/differential.test.d.ts +0 -7
- package/dist/tests/e2e/differential.test.js.map +0 -1
- package/dist/tests/e2e/runtime-coverage.test.d.ts +0 -11
- package/dist/tests/e2e/runtime-coverage.test.js +0 -646
- package/dist/tests/e2e/runtime-coverage.test.js.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/* -- parser --------------------------------------------------------------- */
|
|
2
|
+
|
|
3
|
+
typedef struct {
|
|
4
|
+
const char *s;
|
|
5
|
+
size_t i;
|
|
6
|
+
int error;
|
|
7
|
+
int groupCount;
|
|
8
|
+
} xt_re_parser;
|
|
9
|
+
|
|
10
|
+
static void xt_re_free_alt(xt_re_alt *alt);
|
|
11
|
+
|
|
12
|
+
static xt_re_node *xt_re_new_node(int type) {
|
|
13
|
+
xt_re_node *n = (xt_re_node *)calloc(1, sizeof(xt_re_node));
|
|
14
|
+
if (n) n->type = type;
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static xt_re_node *xt_re_new_char(unsigned char c) {
|
|
19
|
+
xt_re_node *n = xt_re_new_node(XT_RE_CHAR);
|
|
20
|
+
if (n) n->ch = c;
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static xt_re_node *xt_re_new_class(const unsigned char *bits) {
|
|
25
|
+
xt_re_node *n = xt_re_new_node(XT_RE_CLASS);
|
|
26
|
+
if (!n) return NULL;
|
|
27
|
+
n->classbits = (unsigned char *)malloc(32);
|
|
28
|
+
if (!n->classbits) {
|
|
29
|
+
free(n);
|
|
30
|
+
return NULL;
|
|
31
|
+
}
|
|
32
|
+
memcpy(n->classbits, bits, 32);
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static void xt_re_push_piece(xt_re_concat *c, xt_re_node *node, int quant) {
|
|
37
|
+
if (c->count == c->capacity) {
|
|
38
|
+
int next = c->capacity ? c->capacity * 2 : 4;
|
|
39
|
+
xt_re_piece *grown = (xt_re_piece *)realloc(c->pieces, (size_t)next * sizeof(xt_re_piece));
|
|
40
|
+
if (!grown) return;
|
|
41
|
+
c->pieces = grown;
|
|
42
|
+
c->capacity = next;
|
|
43
|
+
}
|
|
44
|
+
c->pieces[c->count].node = node;
|
|
45
|
+
c->pieces[c->count].quant = quant;
|
|
46
|
+
c->count++;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static void xt_re_push_branch(xt_re_alt *alt, xt_re_concat c) {
|
|
50
|
+
if (alt->count == alt->capacity) {
|
|
51
|
+
int next = alt->capacity ? alt->capacity * 2 : 4;
|
|
52
|
+
xt_re_concat *grown = (xt_re_concat *)realloc(alt->branches, (size_t)next * sizeof(xt_re_concat));
|
|
53
|
+
if (!grown) return;
|
|
54
|
+
alt->branches = grown;
|
|
55
|
+
alt->capacity = next;
|
|
56
|
+
}
|
|
57
|
+
alt->branches[alt->count++] = c;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static xt_re_alt *xt_re_parse_alt(xt_re_parser *p);
|
|
61
|
+
|
|
62
|
+
static xt_re_node *xt_re_parse_escape(xt_re_parser *p) {
|
|
63
|
+
char c;
|
|
64
|
+
p->i++; /* consume backslash */
|
|
65
|
+
c = p->s[p->i];
|
|
66
|
+
if (!c) {
|
|
67
|
+
p->error = 1;
|
|
68
|
+
return NULL;
|
|
69
|
+
}
|
|
70
|
+
p->i++;
|
|
71
|
+
if (c == 'd' || c == 'D' || c == 'w' || c == 'W' || c == 's' || c == 'S') {
|
|
72
|
+
unsigned char bits[32];
|
|
73
|
+
xt_re_node *n;
|
|
74
|
+
memset(bits, 0, sizeof(bits));
|
|
75
|
+
xt_re_add_predefined(bits, c);
|
|
76
|
+
n = xt_re_new_class(bits);
|
|
77
|
+
if (!n) p->error = 1;
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
if (c == 'n') return xt_re_new_char('\n');
|
|
81
|
+
if (c == 't') return xt_re_new_char('\t');
|
|
82
|
+
if (c == 'r') return xt_re_new_char('\r');
|
|
83
|
+
if (c == 'f') return xt_re_new_char('\f');
|
|
84
|
+
if (c == 'v') return xt_re_new_char('\v');
|
|
85
|
+
if (c == '0') return xt_re_new_char('\0');
|
|
86
|
+
return xt_re_new_char((unsigned char)c);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static xt_re_node *xt_re_parse_class(xt_re_parser *p) {
|
|
90
|
+
unsigned char bits[32];
|
|
91
|
+
int negate = 0;
|
|
92
|
+
int first = 1;
|
|
93
|
+
xt_re_node *n;
|
|
94
|
+
|
|
95
|
+
memset(bits, 0, sizeof(bits));
|
|
96
|
+
p->i++; /* consume '[' */
|
|
97
|
+
if (p->s[p->i] == '^') {
|
|
98
|
+
negate = 1;
|
|
99
|
+
p->i++;
|
|
100
|
+
}
|
|
101
|
+
while (p->s[p->i] && (p->s[p->i] != ']' || first)) {
|
|
102
|
+
unsigned char lo;
|
|
103
|
+
first = 0;
|
|
104
|
+
if (p->s[p->i] == '\\' && p->s[p->i + 1]) {
|
|
105
|
+
char e;
|
|
106
|
+
p->i++;
|
|
107
|
+
e = p->s[p->i++];
|
|
108
|
+
if (xt_re_add_predefined(bits, e)) continue;
|
|
109
|
+
if (e == 'n') lo = '\n';
|
|
110
|
+
else if (e == 't') lo = '\t';
|
|
111
|
+
else if (e == 'r') lo = '\r';
|
|
112
|
+
else if (e == 'f') lo = '\f';
|
|
113
|
+
else if (e == 'v') lo = '\v';
|
|
114
|
+
else lo = (unsigned char)e;
|
|
115
|
+
} else {
|
|
116
|
+
lo = (unsigned char)p->s[p->i++];
|
|
117
|
+
}
|
|
118
|
+
if (p->s[p->i] == '-' && p->s[p->i + 1] && p->s[p->i + 1] != ']') {
|
|
119
|
+
unsigned char hi;
|
|
120
|
+
p->i++; /* consume '-' */
|
|
121
|
+
hi = (unsigned char)p->s[p->i++];
|
|
122
|
+
xt_re_add_range(bits, lo, hi);
|
|
123
|
+
} else {
|
|
124
|
+
xt_re_set_bit(bits, lo);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (p->s[p->i] != ']') {
|
|
128
|
+
p->error = 1;
|
|
129
|
+
return NULL;
|
|
130
|
+
}
|
|
131
|
+
p->i++;
|
|
132
|
+
if (negate) {
|
|
133
|
+
int c;
|
|
134
|
+
for (c = 0; c < 32; c++) bits[c] = (unsigned char)~bits[c];
|
|
135
|
+
}
|
|
136
|
+
n = xt_re_new_class(bits);
|
|
137
|
+
if (!n) p->error = 1;
|
|
138
|
+
return n;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static xt_re_node *xt_re_parse_atom(xt_re_parser *p) {
|
|
142
|
+
char c = p->s[p->i];
|
|
143
|
+
if (c == '(') {
|
|
144
|
+
xt_re_node *n;
|
|
145
|
+
xt_re_alt *group;
|
|
146
|
+
int index;
|
|
147
|
+
p->i++;
|
|
148
|
+
/* Number the group as soon as its '(' is seen so nested groups keep
|
|
149
|
+
* POSIX/JavaScript numbering (opening-paren order). */
|
|
150
|
+
index = ++p->groupCount;
|
|
151
|
+
group = xt_re_parse_alt(p);
|
|
152
|
+
if (p->error) return NULL;
|
|
153
|
+
if (p->s[p->i] != ')') {
|
|
154
|
+
p->error = 1;
|
|
155
|
+
xt_re_free_alt(group);
|
|
156
|
+
return NULL;
|
|
157
|
+
}
|
|
158
|
+
p->i++;
|
|
159
|
+
n = xt_re_new_node(XT_RE_GROUP);
|
|
160
|
+
if (!n) {
|
|
161
|
+
p->error = 1;
|
|
162
|
+
return NULL;
|
|
163
|
+
}
|
|
164
|
+
n->group = group;
|
|
165
|
+
n->groupIndex = index;
|
|
166
|
+
return n;
|
|
167
|
+
}
|
|
168
|
+
if (c == '[') return xt_re_parse_class(p);
|
|
169
|
+
if (c == '.') {
|
|
170
|
+
p->i++;
|
|
171
|
+
return xt_re_new_node(XT_RE_ANY);
|
|
172
|
+
}
|
|
173
|
+
if (c == '^') {
|
|
174
|
+
p->i++;
|
|
175
|
+
return xt_re_new_node(XT_RE_BOL);
|
|
176
|
+
}
|
|
177
|
+
if (c == '$') {
|
|
178
|
+
p->i++;
|
|
179
|
+
return xt_re_new_node(XT_RE_EOL);
|
|
180
|
+
}
|
|
181
|
+
if (c == '\\') return xt_re_parse_escape(p);
|
|
182
|
+
if (c == '\0') {
|
|
183
|
+
p->error = 1;
|
|
184
|
+
return NULL;
|
|
185
|
+
}
|
|
186
|
+
p->i++;
|
|
187
|
+
return xt_re_new_char((unsigned char)c);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static void xt_re_parse_concat(xt_re_parser *p, xt_re_concat *out) {
|
|
191
|
+
while (p->s[p->i] && p->s[p->i] != '|' && p->s[p->i] != ')') {
|
|
192
|
+
xt_re_node *node = xt_re_parse_atom(p);
|
|
193
|
+
int quant = XT_RE_Q_NONE;
|
|
194
|
+
if (p->error || !node) {
|
|
195
|
+
p->error = 1;
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (p->s[p->i] == '*') {
|
|
199
|
+
quant = XT_RE_Q_STAR;
|
|
200
|
+
p->i++;
|
|
201
|
+
} else if (p->s[p->i] == '+') {
|
|
202
|
+
quant = XT_RE_Q_PLUS;
|
|
203
|
+
p->i++;
|
|
204
|
+
} else if (p->s[p->i] == '?') {
|
|
205
|
+
quant = XT_RE_Q_QUEST;
|
|
206
|
+
p->i++;
|
|
207
|
+
}
|
|
208
|
+
xt_re_push_piece(out, node, quant);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static xt_re_alt *xt_re_parse_alt(xt_re_parser *p) {
|
|
213
|
+
xt_re_alt *alt = (xt_re_alt *)calloc(1, sizeof(xt_re_alt));
|
|
214
|
+
if (!alt) {
|
|
215
|
+
p->error = 1;
|
|
216
|
+
return NULL;
|
|
217
|
+
}
|
|
218
|
+
for (;;) {
|
|
219
|
+
xt_re_concat concat;
|
|
220
|
+
memset(&concat, 0, sizeof(concat));
|
|
221
|
+
xt_re_parse_concat(p, &concat);
|
|
222
|
+
if (p->error) {
|
|
223
|
+
free(concat.pieces);
|
|
224
|
+
free(alt->branches);
|
|
225
|
+
free(alt);
|
|
226
|
+
return NULL;
|
|
227
|
+
}
|
|
228
|
+
xt_re_push_branch(alt, concat);
|
|
229
|
+
if (p->s[p->i] == '|') {
|
|
230
|
+
p->i++;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
return alt;
|
|
236
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#define REG_EXTENDED 1
|
|
2
|
+
#define REG_ICASE 2
|
|
3
|
+
#define REG_NOSUB 4
|
|
4
|
+
|
|
5
|
+
typedef struct {
|
|
6
|
+
int rm_so;
|
|
7
|
+
int rm_eo;
|
|
8
|
+
} regmatch_t;
|
|
9
|
+
|
|
10
|
+
/* Node kinds. */
|
|
11
|
+
enum {
|
|
12
|
+
XT_RE_CHAR = 0,
|
|
13
|
+
XT_RE_ANY,
|
|
14
|
+
XT_RE_CLASS,
|
|
15
|
+
XT_RE_BOL,
|
|
16
|
+
XT_RE_EOL,
|
|
17
|
+
XT_RE_GROUP
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/* Quantifiers. */
|
|
21
|
+
enum {
|
|
22
|
+
XT_RE_Q_NONE = 0,
|
|
23
|
+
XT_RE_Q_STAR,
|
|
24
|
+
XT_RE_Q_PLUS,
|
|
25
|
+
XT_RE_Q_QUEST
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
typedef struct xt_re_alt xt_re_alt;
|
|
29
|
+
|
|
30
|
+
typedef struct {
|
|
31
|
+
int type;
|
|
32
|
+
unsigned char ch;
|
|
33
|
+
unsigned char *classbits; /* 256 bits == 32 bytes, for XT_RE_CLASS */
|
|
34
|
+
xt_re_alt *group; /* for XT_RE_GROUP */
|
|
35
|
+
int groupIndex; /* 1-based capture number, for XT_RE_GROUP */
|
|
36
|
+
} xt_re_node;
|
|
37
|
+
|
|
38
|
+
typedef struct {
|
|
39
|
+
xt_re_node *node;
|
|
40
|
+
int quant;
|
|
41
|
+
} xt_re_piece;
|
|
42
|
+
|
|
43
|
+
typedef struct {
|
|
44
|
+
xt_re_piece *pieces;
|
|
45
|
+
int count;
|
|
46
|
+
int capacity;
|
|
47
|
+
} xt_re_concat;
|
|
48
|
+
|
|
49
|
+
struct xt_re_alt {
|
|
50
|
+
xt_re_concat *branches;
|
|
51
|
+
int count;
|
|
52
|
+
int capacity;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
typedef struct {
|
|
56
|
+
xt_re_alt *root;
|
|
57
|
+
int icase;
|
|
58
|
+
} regex_t;
|