1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

reverting 63ab88

This commit is contained in:
Jeremy Ashkenas 2011-12-14 10:39:20 -05:00
parent b12be3188f
commit c9a0a33fa2
14 changed files with 48 additions and 2 deletions

View file

@ -72,4 +72,5 @@
} else { } else {
attachEvent('onload', runScripts); attachEvent('onload', runScripts);
} }
}).call(this); }).call(this);

View file

@ -95,4 +95,5 @@
if (parent !== dir) return cakefileDirectory(parent); if (parent !== dir) return cakefileDirectory(parent);
throw new Error("Cakefile not found in " + (process.cwd())); throw new Error("Cakefile not found in " + (process.cwd()));
}; };
}).call(this); }).call(this);

View file

@ -146,4 +146,5 @@
}; };
parser.yy = require('./nodes'); parser.yy = require('./nodes');
}).call(this); }).call(this);

View file

@ -316,4 +316,5 @@
version = function() { version = function() {
return printLine("CoffeeScript version " + CoffeeScript.VERSION); return printLine("CoffeeScript version " + CoffeeScript.VERSION);
}; };
}).call(this); }).call(this);

View file

@ -586,4 +586,5 @@
operators: operators.reverse(), operators: operators.reverse(),
startSymbol: 'Root' startSymbol: 'Root'
}); });
}).call(this); }).call(this);

View file

@ -68,4 +68,5 @@
exports.last = function(array, back) { exports.last = function(array, back) {
return array[array.length - (back || 0) - 1]; return array[array.length - (back || 0) - 1];
}; };
}).call(this); }).call(this);

View file

@ -6,4 +6,5 @@
val = _ref[key]; val = _ref[key];
exports[key] = val; exports[key] = val;
} }
}).call(this); }).call(this);

View file

@ -586,6 +586,7 @@
}; };
return Lexer; return Lexer;
})(); })();
JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super'];
@ -682,4 +683,5 @@
INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL'); INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL');
LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
}).call(this); }).call(this);

View file

@ -184,6 +184,7 @@
Base.prototype.assigns = NO; Base.prototype.assigns = NO;
return Base; return Base;
})(); })();
exports.Block = Block = (function() { exports.Block = Block = (function() {
@ -288,7 +289,7 @@
} }
if (top) { if (top) {
if (this.spaced) { if (this.spaced) {
return '\n' + codes.join('\n\n'); return "\n" + (codes.join('\n\n')) + "\n";
} else { } else {
return codes.join('\n'); return codes.join('\n');
} }
@ -382,6 +383,7 @@
}; };
return Block; return Block;
})(); })();
exports.Literal = Literal = (function() { exports.Literal = Literal = (function() {
@ -437,6 +439,7 @@
}; };
return Literal; return Literal;
})(); })();
exports.Return = Return = (function() { exports.Return = Return = (function() {
@ -470,6 +473,7 @@
}; };
return Return; return Return;
})(); })();
exports.Value = Value = (function() { exports.Value = Value = (function() {
@ -617,6 +621,7 @@
}; };
return Value; return Value;
})(); })();
exports.Comment = Comment = (function() { exports.Comment = Comment = (function() {
@ -639,6 +644,7 @@
}; };
return Comment; return Comment;
})(); })();
exports.Call = Call = (function() { exports.Call = Call = (function() {
@ -807,6 +813,7 @@
}; };
return Call; return Call;
})(); })();
exports.Extends = Extends = (function() { exports.Extends = Extends = (function() {
@ -825,6 +832,7 @@
}; };
return Extends; return Extends;
})(); })();
exports.Access = Access = (function() { exports.Access = Access = (function() {
@ -852,6 +860,7 @@
Access.prototype.isComplex = NO; Access.prototype.isComplex = NO;
return Access; return Access;
})(); })();
exports.Index = Index = (function() { exports.Index = Index = (function() {
@ -873,6 +882,7 @@
}; };
return Index; return Index;
})(); })();
exports.Range = Range = (function() { exports.Range = Range = (function() {
@ -951,6 +961,7 @@
}; };
return Range; return Range;
})(); })();
exports.Slice = Slice = (function() { exports.Slice = Slice = (function() {
@ -976,6 +987,7 @@
}; };
return Slice; return Slice;
})(); })();
exports.Obj = Obj = (function() { exports.Obj = Obj = (function() {
@ -1041,6 +1053,7 @@
}; };
return Obj; return Obj;
})(); })();
exports.Arr = Arr = (function() { exports.Arr = Arr = (function() {
@ -1088,6 +1101,7 @@
}; };
return Arr; return Arr;
})(); })();
exports.Class = Class = (function() { exports.Class = Class = (function() {
@ -1236,6 +1250,7 @@
}; };
return Class; return Class;
})(); })();
exports.Assign = Assign = (function() { exports.Assign = Assign = (function() {
@ -1433,6 +1448,7 @@
}; };
return Assign; return Assign;
})(); })();
exports.Code = Code = (function() { exports.Code = Code = (function() {
@ -1544,6 +1560,7 @@
}; };
return Code; return Code;
})(); })();
exports.Param = Param = (function() { exports.Param = Param = (function() {
@ -1582,6 +1599,7 @@
}; };
return Param; return Param;
})(); })();
exports.Splat = Splat = (function() { exports.Splat = Splat = (function() {
@ -1647,6 +1665,7 @@
}; };
return Splat; return Splat;
})(); })();
exports.While = While = (function() { exports.While = While = (function() {
@ -1718,6 +1737,7 @@
}; };
return While; return While;
})(); })();
exports.Op = Op = (function() { exports.Op = Op = (function() {
@ -1869,6 +1889,7 @@
}; };
return Op; return Op;
})(); })();
exports.In = In = (function() { exports.In = In = (function() {
@ -1940,6 +1961,7 @@
}; };
return In; return In;
})(); })();
exports.Try = Try = (function() { exports.Try = Try = (function() {
@ -1979,6 +2001,7 @@
}; };
return Try; return Try;
})(); })();
exports.Throw = Throw = (function() { exports.Throw = Throw = (function() {
@ -2002,6 +2025,7 @@
}; };
return Throw; return Throw;
})(); })();
exports.Existence = Existence = (function() { exports.Existence = Existence = (function() {
@ -2034,6 +2058,7 @@
}; };
return Existence; return Existence;
})(); })();
exports.Parens = Parens = (function() { exports.Parens = Parens = (function() {
@ -2071,6 +2096,7 @@
}; };
return Parens; return Parens;
})(); })();
exports.For = For = (function() { exports.For = For = (function() {
@ -2203,6 +2229,7 @@
}; };
return For; return For;
})(); })();
exports.Switch = Switch = (function() { exports.Switch = Switch = (function() {
@ -2277,6 +2304,7 @@
}; };
return Switch; return Switch;
})(); })();
exports.If = If = (function() { exports.If = If = (function() {
@ -2390,6 +2418,7 @@
}; };
return If; return If;
})(); })();
Closure = { Closure = {
@ -2481,4 +2510,5 @@
code = code.replace(/\n/g, '$&' + tab); code = code.replace(/\n/g, '$&' + tab);
return code.replace(/\s+$/, ''); return code.replace(/\s+$/, '');
}; };
}).call(this); }).call(this);

View file

@ -63,6 +63,7 @@
}; };
return OptionParser; return OptionParser;
})(); })();
LONG_FLAG = /^(--\w[\w\-]+)/; LONG_FLAG = /^(--\w[\w\-]+)/;
@ -117,4 +118,5 @@
} }
return result; return result;
}; };
}).call(this); }).call(this);

View file

@ -145,4 +145,5 @@
repl.setPrompt(REPL_PROMPT); repl.setPrompt(REPL_PROMPT);
repl.prompt(); repl.prompt();
}).call(this); }).call(this);

View file

@ -252,6 +252,7 @@
}; };
return Rewriter; return Rewriter;
})(); })();
BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']];
@ -285,4 +286,5 @@
SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
}).call(this); }).call(this);

View file

@ -117,5 +117,7 @@
}; };
return Scope; return Scope;
})(); })();
}).call(this); }).call(this);

View file

@ -232,7 +232,7 @@ exports.Block = class Block extends Base
codes.push node.compile o, LEVEL_LIST codes.push node.compile o, LEVEL_LIST
if top if top
if @spaced if @spaced
return '\n' + codes.join('\n\n') return "\n#{codes.join '\n\n'}\n"
else else
return codes.join '\n' return codes.join '\n'
code = codes.join(', ') or 'void 0' code = codes.join(', ') or 'void 0'