tangled
alpha
login
or
join now
kitten.sh
/
reghex
0
fork
atom
Mirror: The magical sticky regex-based parser generator 🧙
0
fork
atom
overview
issues
pulls
pipelines
Add special case to keep codegen output small
kitten.sh
4 years ago
f73492b4
9dce12c5
+15
-11
2 changed files
expand all
collapse all
unified
split
src
babel
__snapshots__
plugin.test.js.snap
codegen.js
+7
-11
src/babel/__snapshots__/plugin.test.js.snap
···
328
328
break group_2;
329
329
}
330
330
331
331
-
group_4: {
332
332
-
var y4 = state.y,
333
333
-
x4 = state.x;
331
331
+
var y4 = state.y,
332
332
+
x4 = state.x;
334
333
335
335
-
if ((x = _node_expression4(state)) != null) {
336
336
-
node.push(x);
337
337
-
} else {
338
338
-
state.y = y4;
339
339
-
state.x = x4;
340
340
-
node.length = ln2;
341
341
-
break group_4;
342
342
-
}
334
334
+
if ((x = _node_expression4(state)) != null) {
335
335
+
node.push(x);
336
336
+
} else {
337
337
+
state.y = y4;
338
338
+
state.x = x4;
343
339
}
344
340
345
341
if ((x = _node_expression5(state)) != null) {
+8
src/codegen.js
···
98
98
${astChild(ast, depth, opts)}
99
99
}
100
100
`;
101
101
+
} else if (ast.quantifier === '?' && ast.expression) {
102
102
+
opts.index = depth;
103
103
+
opts.abort = '';
104
104
+
105
105
+
child = js`
106
106
+
${assignIndex(depth)}
107
107
+
${astChild(ast, depth, opts)}
108
108
+
`;
101
109
} else if (ast.quantifier === '?') {
102
110
opts.index = depth;
103
111
opts.abort = js`break ${group}`;