recompiling with latest jison (modified) and passing codenode generation

This commit is contained in:
Jeremy Ashkenas
2010-02-12 13:35:34 -05:00
parent 3f765c356a
commit 12859e575a
6 changed files with 26 additions and 40 deletions

View File

@@ -847,7 +847,7 @@
return this;
},
compile_node: function compile_node(o) {
var __a, __b, code, func, inner, name_part, param, shared_scope, splat, top;
var __a, __b, __c, __d, __e, code, func, inner, name_part, param, params, shared_scope, splat, top;
shared_scope = del(o, 'shared_scope');
top = del(o, 'top');
o.scope = shared_scope || new Scope(o.scope, this.body, this);
@@ -861,14 +861,22 @@
splat.index = this.params.length;
this.body.unshift(splat);
}
__a = this.params;
for (__b = 0; __b < __a.length; __b++) {
param = __a[__b];
params = ((function() {
__a = []; __b = this.params;
for (__c = 0; __c < __b.length; __c++) {
param = __b[__c];
__a.push(param.compile(o));
}
return __a;
}).call(this));
__d = params;
for (__e = 0; __e < __d.length; __e++) {
param = __d[__e];
(o.scope.parameter(param));
}
code = this.body.expressions.length ? '\n' + this.body.compile_with_declarations(o) + '\n' : '';
name_part = this.name ? ' ' + this.name : '';
func = 'function' + (this.bound ? '' : name_part) + '(' + this.params.join(', ') + ') {' + code + this.idt(this.bound ? 1 : 0) + '}';
func = 'function' + (this.bound ? '' : name_part) + '(' + params.join(', ') + ') {' + code + this.idt(this.bound ? 1 : 0) + '}';
if (top && !this.bound) {
func = '(' + func + ')';
}