fix for bug introduced in 63cbb643

This commit is contained in:
Michael Ficarra 2010-12-05 13:10:14 -05:00
parent ed70b9d4d0
commit dc5854689b
3 changed files with 8 additions and 8 deletions

View File

@ -208,7 +208,7 @@
return regex.length; return regex.length;
}; };
Lexer.prototype.heregexToken = function(match) { Lexer.prototype.heregexToken = function(match) {
var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref, _ref2, _ref3; var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref, _ref2, _ref3, _ref4;
heregex = match[0], body = match[1], flags = match[2]; heregex = match[0], body = match[1], flags = match[2];
if (0 > body.indexOf('#{')) { if (0 > body.indexOf('#{')) {
re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/'); re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
@ -238,7 +238,7 @@
if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') { if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') {
this.tokens.push(['STRING', '""'], ['+', '+']); this.tokens.push(['STRING', '""'], ['+', '+']);
} }
(_ref = this.tokens).push.apply(_ref, tokens); (_ref4 = this.tokens).push.apply(_ref4, tokens);
if (flags) { if (flags) {
this.tokens.push([',', ','], ['STRING', '"' + flags + '"']); this.tokens.push([',', ','], ['STRING', '"' + flags + '"']);
} }
@ -478,7 +478,7 @@
throw new Error("unterminated " + (stack.pop()[0]) + " on line " + (this.line + 1)); throw new Error("unterminated " + (stack.pop()[0]) + " on line " + (this.line + 1));
}; };
Lexer.prototype.interpolateString = function(str, options) { Lexer.prototype.interpolateString = function(str, options) {
var expr, heredoc, i, inner, interpolated, letter, nested, pi, regex, tag, tokens, value, _len, _ref, _ref2; var expr, heredoc, i, inner, interpolated, letter, nested, pi, regex, tag, tokens, value, _len, _ref, _ref2, _ref3;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -537,7 +537,7 @@
this.token('+', '+'); this.token('+', '+');
} }
if (tag === 'TOKENS') { if (tag === 'TOKENS') {
(_ref = this.tokens).push.apply(_ref, value); (_ref3 = this.tokens).push.apply(_ref3, value);
} else { } else {
this.token('STRING', this.makeString(value, '"', heredoc)); this.token('STRING', this.makeString(value, '"', heredoc));
} }

View File

@ -625,7 +625,7 @@
} }
base = new Value(this.variable); base = new Value(this.variable);
if ((name = base.properties.pop()) && base.isComplex()) { if ((name = base.properties.pop()) && base.isComplex()) {
ref = o.scope.temporary('ref'); ref = o.scope.freeVariable('ref');
fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o)); fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o));
} else { } else {
fun = base.compile(o, LEVEL_ACCESS); fun = base.compile(o, LEVEL_ACCESS);
@ -1198,7 +1198,7 @@
return !!this.ctor; return !!this.ctor;
}; };
Code.prototype.compileNode = function(o) { Code.prototype.compileNode = function(o) {
var code, exprs, i, idt, lit, p, param, ref, scope, sharedScope, splats, v, val, vars, wasEmpty, _i, _j, _k, _len, _len2, _len3, _len4, _ref, _ref2, _ref3, _results; var code, exprs, i, idt, lit, p, param, ref, scope, sharedScope, splats, v, val, vars, wasEmpty, _i, _j, _k, _len, _len2, _len3, _len4, _ref, _ref2, _ref3, _ref4, _results;
sharedScope = del(o, 'sharedScope'); sharedScope = del(o, 'sharedScope');
o.scope = scope = sharedScope || new Scope(o.scope, this.body, this); o.scope = scope = sharedScope || new Scope(o.scope, this.body, this);
o.indent += TAB; o.indent += TAB;
@ -1248,7 +1248,7 @@
exprs.unshift(splats); exprs.unshift(splats);
} }
if (exprs.length) { if (exprs.length) {
(_ref = this.body.expressions).unshift.apply(_ref, exprs); (_ref4 = this.body.expressions).unshift.apply(_ref4, exprs);
} }
if (!splats) { if (!splats) {
for (i = 0, _len4 = vars.length; i < _len4; i++) { for (i = 0, _len4 = vars.length; i < _len4; i++) {

View File

@ -513,7 +513,7 @@ exports.Call = class Call extends Base
""" """
base = new Value @variable base = new Value @variable
if (name = base.properties.pop()) and base.isComplex() if (name = base.properties.pop()) and base.isComplex()
ref = o.scope.temporary 'ref' ref = o.scope.freeVariable 'ref'
fun = "(#{ref} = #{ base.compile o, LEVEL_LIST })#{ name.compile o }" fun = "(#{ref} = #{ base.compile o, LEVEL_LIST })#{ name.compile o }"
else else
fun = base.compile o, LEVEL_ACCESS fun = base.compile o, LEVEL_ACCESS