Some recoding.
This commit is contained in:
parent
ab6fde9252
commit
efe3183540
|
|
@ -1145,49 +1145,7 @@ Cola.AST_Toplevel.prototype.toJavaScript = function(options){
|
||||||
defs.push(new Cola.AST_Assign({
|
defs.push(new Cola.AST_Assign({
|
||||||
operator : node.operator,
|
operator : node.operator,
|
||||||
left : el,
|
left : el,
|
||||||
right : new Cola.AST_Conditional({
|
right : Cola.Constructions.SplatedConditional(symbol, uid, j, _.length - j - 1, _.length)
|
||||||
condition : new Cola.AST_Binary({
|
|
||||||
operator : "<=",
|
|
||||||
left : new Cola.AST_Number({ value : _.length }),
|
|
||||||
right : new Cola.AST_Dot({
|
|
||||||
expression : symbol,
|
|
||||||
property : "length"
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
consequent : new Cola.AST_Call({
|
|
||||||
expression : new Cola.AST_Dot({
|
|
||||||
property : "call",
|
|
||||||
expression : new Cola.AST_Dot({
|
|
||||||
property : "slice",
|
|
||||||
expression : new Cola.AST_Array({ elements : [] })
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
args : [
|
|
||||||
symbol,
|
|
||||||
new Cola.AST_Number({ value : j }),
|
|
||||||
new Cola.AST_Assign({
|
|
||||||
operator : '=',
|
|
||||||
left : new Cola.AST_SymbolVar({ name : "$_cola" + uid + "i" }),
|
|
||||||
right : new Cola.AST_Binary({
|
|
||||||
operator : '-',
|
|
||||||
left : new Cola.AST_Dot({
|
|
||||||
property : "length",
|
|
||||||
expression : symbol
|
|
||||||
}),
|
|
||||||
right : new Cola.AST_Number({ value : _.length - j - 1 })
|
|
||||||
})
|
|
||||||
})
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
alternative : new Cola.AST_Seq({
|
|
||||||
car : new Cola.AST_Assign({
|
|
||||||
operator : '=',
|
|
||||||
left : new Cola.AST_SymbolRef({ name : "$_cola" + uid + "i" }),
|
|
||||||
right : new Cola.AST_Number({ value : j })
|
|
||||||
}),
|
|
||||||
cdr : new Cola.AST_Array({ elements : [] })
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}));
|
}));
|
||||||
} else
|
} else
|
||||||
if(el instanceof Cola.AST_VarDef){
|
if(el instanceof Cola.AST_VarDef){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user