Skip to content

Commit 3f74ed5

Browse files
committed
Perlito5 - fix a problem parsing empty statements in modules ("use" bug)
1 parent 7aadacf commit 3f74ed5

File tree

3 files changed

+39
-33
lines changed

3 files changed

+39
-33
lines changed

html/perlito5.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9352,19 +9352,21 @@ return r;
93529352
var v_comp_units = null;
93539353
(v_comp_units = ((new p5ArrayRef([]))));
93549354
p5for_lex(function (v_comp_unit) {
9355-
if ( p5bool(p5call(v_comp_unit, "isa", ['Perlito5::AST::Use'], 0)) ) {
9356-
p5pkg["Perlito5::Grammar::Use"].expand_use([v_comp_units, v_comp_unit], null);
9357-
}
9358-
else {
9359-
if ( p5bool(p5call(v_comp_unit, "isa", ['Perlito5::AST::CompUnit'], 0)) ) {
9360-
p5for_lex(function (v_stmt) {
9361-
if ( p5bool(p5call(v_stmt, "isa", ['Perlito5::AST::Use'], 0)) ) {
9362-
p5pkg["Perlito5::Grammar::Use"].expand_use([v_comp_units, v_stmt], null);
9363-
};
9364-
}, p5list_to_a((p5call(v_comp_unit, "body", [], p5want) || (p5call(v_comp_unit, "body", [], p5want) = new p5ArrayRef([])))._array_), false, "");
9355+
if ( (v_comp_unit != null) ) {
9356+
if ( p5bool(p5call(v_comp_unit, "isa", ['Perlito5::AST::Use'], 0)) ) {
9357+
p5pkg["Perlito5::Grammar::Use"].expand_use([v_comp_units, v_comp_unit], null);
9358+
}
9359+
else {
9360+
if ( p5bool(p5call(v_comp_unit, "isa", ['Perlito5::AST::CompUnit'], 0)) ) {
9361+
p5for_lex(function (v_stmt) {
9362+
if ( p5bool(p5call(v_stmt, "isa", ['Perlito5::AST::Use'], 0)) ) {
9363+
p5pkg["Perlito5::Grammar::Use"].expand_use([v_comp_units, v_stmt], null);
9364+
};
9365+
}, p5list_to_a((p5call(v_comp_unit, "body", [], p5want) || (p5call(v_comp_unit, "body", [], p5want) = new p5ArrayRef([])))._array_), false, "");
9366+
};
93659367
};
9368+
p5pkg["Perlito5::Grammar::Use"].push([(v_comp_units || (v_comp_units = new p5ArrayRef([])))._array_, [v_comp_unit]], null);
93669369
};
9367-
p5pkg["Perlito5::Grammar::Use"].push([(v_comp_units || (v_comp_units = new p5ArrayRef([])))._array_, [v_comp_unit]], null);
93689370
}, p5list_to_a((v_parse || (v_parse = new p5ArrayRef([])))._array_), false, "");
93699371
return (p5context([v_comp_units], p5want));
93709372
});

0 commit comments

Comments
 (0)