mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
fixing the extends keyword when the expressions are complex, and should only be run once -- not that it's good style -- ticket #143
This commit is contained in:
@@ -249,11 +249,14 @@
|
||||
};
|
||||
// Matches and consumes non-meaningful whitespace.
|
||||
lex.prototype.whitespace_token = function whitespace_token() {
|
||||
var space;
|
||||
var prev, space;
|
||||
if (!((space = this.match(WHITESPACE, 1)))) {
|
||||
return false;
|
||||
}
|
||||
this.tokens[this.tokens.length - 1].spaced = true;
|
||||
prev = this.tokens[this.tokens.length - 1];
|
||||
if (prev) {
|
||||
prev.spaced = true;
|
||||
}
|
||||
this.i += space.length;
|
||||
return true;
|
||||
};
|
||||
@@ -276,7 +279,7 @@
|
||||
// Multi-character operators are also literal tokens, so that Racc can assign
|
||||
// the proper order of operations.
|
||||
lex.prototype.literal_token = function literal_token() {
|
||||
var match, tag, value;
|
||||
var match, prev, tag, value;
|
||||
match = this.chunk.match(OPERATOR);
|
||||
value = match && match[1];
|
||||
if (value && value.match(CODE)) {
|
||||
@@ -287,7 +290,8 @@
|
||||
if (value === ';') {
|
||||
tag = 'TERMINATOR';
|
||||
}
|
||||
if (!this.tokens[this.tokens.length - 1].spaced && CALLABLE.indexOf(this.tag()) >= 0) {
|
||||
prev = this.tokens[this.tokens.length - 1];
|
||||
if (CALLABLE.indexOf(this.tag()) >= 0 && (!prev || !prev.spaced)) {
|
||||
if (value === '(') {
|
||||
tag = 'CALL_START';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user