Revert "Merge https://github.com/ngn/coffee-script"
This reverts commit277e82bd03
, reversing changes made to0f523de212
.
This commit is contained in:
parent
277e82bd03
commit
25e7eeac8f
|
@ -190,9 +190,7 @@
|
||||||
if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
|
if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
script = match[0];
|
this.token('JS', (script = match[0]).slice(1, -1));
|
||||||
this.line += count(script, '\n');
|
|
||||||
this.token('JS', script.slice(1, -1));
|
|
||||||
return script.length;
|
return script.length;
|
||||||
};
|
};
|
||||||
Lexer.prototype.regexToken = function() {
|
Lexer.prototype.regexToken = function() {
|
||||||
|
@ -478,7 +476,7 @@
|
||||||
end = stack[stack.length - 1];
|
end = stack[stack.length - 1];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (end === '}' && (letter === '"' || letter === "'" || letter === '/')) {
|
if (end === '}' && (letter === '"' || letter === "'")) {
|
||||||
stack.push(end = letter);
|
stack.push(end = letter);
|
||||||
} else if (end === '}' && letter === '{') {
|
} else if (end === '}' && letter === '{') {
|
||||||
stack.push(end = '}');
|
stack.push(end = '}');
|
||||||
|
|
|
@ -181,9 +181,7 @@ exports.Lexer = class Lexer
|
||||||
# Matches JavaScript interpolated directly into the source via backticks.
|
# Matches JavaScript interpolated directly into the source via backticks.
|
||||||
jsToken: ->
|
jsToken: ->
|
||||||
return 0 unless @chunk.charAt(0) is '`' and match = JSTOKEN.exec @chunk
|
return 0 unless @chunk.charAt(0) is '`' and match = JSTOKEN.exec @chunk
|
||||||
script = match[0]
|
@token 'JS', (script = match[0]).slice 1, -1
|
||||||
@line += count script, '\n'
|
|
||||||
@token 'JS', script[1...-1]
|
|
||||||
script.length
|
script.length
|
||||||
|
|
||||||
# Matches regular expression literals. Lexing regular expressions is difficult
|
# Matches regular expression literals. Lexing regular expressions is difficult
|
||||||
|
@ -414,7 +412,7 @@ exports.Lexer = class Lexer
|
||||||
return str.slice 0, i + 1
|
return str.slice 0, i + 1
|
||||||
end = stack[stack.length - 1]
|
end = stack[stack.length - 1]
|
||||||
continue
|
continue
|
||||||
if end is '}' and letter in ['"', "'", '/']
|
if end is '}' and letter in ['"', "'"]
|
||||||
stack.push end = letter
|
stack.push end = letter
|
||||||
else if end is '}' and letter is '{'
|
else if end is '}' and letter is '{'
|
||||||
stack.push end = '}'
|
stack.push end = '}'
|
||||||
|
|
|
@ -20,11 +20,6 @@ eq "#{ "{" }", "{"
|
||||||
eq "#{ '#{}}' } }", '#{}} }'
|
eq "#{ '#{}}' } }", '#{}} }'
|
||||||
eq "#{"'#{ ({a: "b#{1}"}['a']) }'"}", "'b1'"
|
eq "#{"'#{ ({a: "b#{1}"}['a']) }'"}", "'b1'"
|
||||||
|
|
||||||
# Issue 1150: String interpolation regression
|
|
||||||
eq "#{/'/.test ''}", 'false'
|
|
||||||
eq "#{"'/" + '/"' + /"'/.test ''}", '\'//"false'
|
|
||||||
eq "#{"'/"}#{'/"'}#{/"'/.test ''}", '\'//"false'
|
|
||||||
|
|
||||||
hello = 'Hello'
|
hello = 'Hello'
|
||||||
world = 'World'
|
world = 'World'
|
||||||
ok '#{hello} #{world}!' is '#{hello} #{world}!'
|
ok '#{hello} #{world}!' is '#{hello} #{world}!'
|
||||||
|
|
Loading…
Reference in New Issue