Skip to content
Snippets Groups Projects
Commit 953cd378 authored by Alan Schmitt's avatar Alan Schmitt Committed by Thomas Wood
Browse files

seq in correct order

parent 249d3d77
No related branches found
No related tags found
No related merge requests found
......@@ -597,14 +597,19 @@ function esprimaExprToAST(expr) {
function esprimaSeqToAST(stats) {
var state = {prog: stats, index: 0};
var res = esprimaStatsToAST(state);
var start = res.start;
var next;
var seql = [];
var prev;
while (state.index < state.prog.length) {
next = esprimaStatsToAST(state);
res = trm_seq(next.line, res, next);
res.start = start;
res.end = next.end;
seql.push(esprimaStatsToAST(state));
}
if (seql.length === 0) throw "Empty block";
var res = seql.pop();
var end = res.end;
while (seql.length > 0) {
prev = seql.pop();
res = trm_seq(prev.line, prev, res);
res.start = prev.start;
res.end = end;
}
return res;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment