getting rid of excessive spaces after `Class.name = "Class"` assignment

This commit is contained in:
Michael Ficarra 2011-12-24 06:49:21 -05:00
parent 8d5f800e2f
commit 0c4cb309b0
6 changed files with 8 additions and 30 deletions

View File

@ -7,6 +7,7 @@
_ref2 = require('./helpers'), count = _ref2.count, starts = _ref2.starts, compact = _ref2.compact, last = _ref2.last;
exports.Lexer = Lexer = (function() {
Lexer.name = 'Lexer';
function Lexer() {}

View File

@ -30,6 +30,7 @@
};
exports.Base = Base = (function() {
Base.name = 'Base';
function Base() {}
@ -194,7 +195,6 @@
Block.name = 'Block';
function Block(nodes) {
this.expressions = compact(flatten(nodes || []));
}
@ -395,7 +395,6 @@
Literal.name = 'Literal';
function Literal(value) {
this.value = value;
}
@ -454,7 +453,6 @@
Return.name = 'Return';
function Return(expr) {
if (expr && !expr.unwrap().isUndefined) this.expression = expr;
}
@ -491,7 +489,6 @@
Value.name = 'Value';
function Value(base, props, tag) {
if (!props && base instanceof Value) return base;
this.base = base;
@ -642,7 +639,6 @@
Comment.name = 'Comment';
function Comment(comment) {
this.comment = comment;
}
@ -668,7 +664,6 @@
Call.name = 'Call';
function Call(variable, args, soak) {
this.args = args != null ? args : [];
this.soak = soak;
@ -840,7 +835,6 @@
Extends.name = 'Extends';
function Extends(child, parent) {
this.child = child;
this.parent = parent;
@ -862,7 +856,6 @@
Access.name = 'Access';
function Access(name, tag) {
this.name = name;
this.name.asKey = true;
@ -893,7 +886,6 @@
Index.name = 'Index';
function Index(index) {
this.index = index;
}
@ -918,7 +910,6 @@
Range.name = 'Range';
Range.prototype.children = ['from', 'to'];
function Range(from, to, tag) {
@ -1004,7 +995,6 @@
Slice.name = 'Slice';
Slice.prototype.children = ['range'];
function Slice(range) {
@ -1033,7 +1023,6 @@
Obj.name = 'Obj';
function Obj(props, generated) {
this.generated = generated != null ? generated : false;
this.objects = this.properties = props || [];
@ -1102,7 +1091,6 @@
Arr.name = 'Arr';
function Arr(objs) {
this.objects = objs || [];
}
@ -1153,7 +1141,6 @@
Class.name = 'Class';
function Class(variable, parent, body) {
this.variable = variable;
this.parent = parent;
@ -1287,7 +1274,7 @@
this.body.spaced = true;
if (!(this.ctor instanceof Code)) this.body.expressions.unshift(this.ctor);
if (decl) {
this.body.expressions.unshift(new Literal("" + name + ".name = '" + name + "'"));
this.body.expressions.unshift(new Assign(new Value(new Literal(name), [new Access(new Literal('name'))]), new Literal("'" + name + "'")));
}
this.body.expressions.push(lname);
this.addBoundFunctions(o);
@ -1313,7 +1300,6 @@
Assign.name = 'Assign';
function Assign(variable, value, context, options) {
this.variable = variable;
this.value = value;
@ -1514,7 +1500,6 @@
Code.name = 'Code';
function Code(params, body, tag) {
this.params = params || [];
this.body = body || new Block;
@ -1629,7 +1614,6 @@
Param.name = 'Param';
function Param(name, value, splat) {
this.name = name;
this.value = value;
@ -1671,7 +1655,6 @@
Splat.name = 'Splat';
Splat.prototype.children = ['name'];
Splat.prototype.isAssignable = YES;
@ -1740,7 +1723,6 @@
While.name = 'While';
function While(condition, options) {
this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition;
this.guard = options != null ? options.guard : void 0;
@ -1816,7 +1798,6 @@
Op.name = 'Op';
function Op(op, first, second, flip) {
if (op === 'in') return new In(first, second);
if (op === 'do') return this.generateDo(first);
@ -1984,7 +1965,6 @@
In.name = 'In';
function In(object, array) {
this.object = object;
this.array = array;
@ -2059,7 +2039,6 @@
Try.name = 'Try';
function Try(attempt, error, recovery, ensure) {
this.attempt = attempt;
this.error = error;
@ -2102,7 +2081,6 @@
Throw.name = 'Throw';
function Throw(expression) {
this.expression = expression;
}
@ -2129,7 +2107,6 @@
Existence.name = 'Existence';
function Existence(expression) {
this.expression = expression;
}
@ -2165,7 +2142,6 @@
Parens.name = 'Parens';
function Parens(body) {
this.body = body;
}
@ -2206,7 +2182,6 @@
For.name = 'For';
function For(body, source) {
var _ref2;
this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index;
@ -2348,7 +2323,6 @@
Switch.name = 'Switch';
function Switch(subject, cases, otherwise) {
this.subject = subject;
this.cases = cases;
@ -2426,7 +2400,6 @@
If.name = 'If';
function If(condition, body, options) {
this.body = body;
if (options == null) options = {};

View File

@ -2,6 +2,7 @@
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
exports.OptionParser = OptionParser = (function() {
OptionParser.name = 'OptionParser';
function OptionParser(rules, banner) {

View File

@ -4,6 +4,7 @@
__slice = Array.prototype.slice;
exports.Rewriter = (function() {
Rewriter.name = 'Rewriter';
function Rewriter() {}

View File

@ -4,6 +4,7 @@
_ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
exports.Scope = Scope = (function() {
Scope.name = 'Scope';
Scope.root = null;

View File

@ -942,7 +942,8 @@ exports.Class = class Class extends Base
@ensureConstructor name
@body.spaced = yes
@body.expressions.unshift @ctor unless @ctor instanceof Code
@body.expressions.unshift new Literal "#{name}.name = '#{name}'" if decl
if decl
@body.expressions.unshift new Assign (new Value (new Literal name), [new Access new Literal 'name']), (new Literal "'#{name}'")
@body.expressions.push lname
@addBoundFunctions o