handle AST_Seq elements in AST_Seq.from_array()

This commit is contained in:
alexlamsl 2017-02-02 03:18:16 +08:00
parent 5088aeedac
commit 3232dd4d89

View File

@ -610,7 +610,13 @@ var AST_Seq = DEFNODE("Seq", "car cdr", {
var i = array.length - 1;
var list = array[i];
while (--i >= 0) {
list = AST_Seq.cons(array[i], list);
var node = array[i];
if (node instanceof AST_Seq) {
node.add(list);
list = node;
} else {
list = AST_Seq.cons(array[i], list);
}
}
return list;
},