1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
This commit is contained in:
Michael Ficarra 2011-06-17 11:32:08 -04:00
commit 277e82bd03
3 changed files with 7 additions and 2 deletions

View file

@ -478,7 +478,7 @@
end = stack[stack.length - 1];
continue;
}
if (end === '}' && (letter === '"' || letter === "'")) {
if (end === '}' && (letter === '"' || letter === "'" || letter === '/')) {
stack.push(end = letter);
} else if (end === '}' && letter === '{') {
stack.push(end = '}');

View file

@ -414,7 +414,7 @@ exports.Lexer = class Lexer
return str.slice 0, i + 1
end = stack[stack.length - 1]
continue
if end is '}' and letter in ['"', "'"]
if end is '}' and letter in ['"', "'", '/']
stack.push end = letter
else if end is '}' and letter is '{'
stack.push end = '}'

View file

@ -20,6 +20,11 @@ eq "#{ "{" }", "{"
eq "#{ '#{}}' } }", '#{}} }'
eq "#{"'#{ ({a: "b#{1}"}['a']) }'"}", "'b1'"
# Issue 1150: String interpolation regression
eq "#{/'/.test ''}", 'false'
eq "#{"'/" + '/"' + /"'/.test ''}", '\'//"false'
eq "#{"'/"}#{'/"'}#{/"'/.test ''}", '\'//"false'
hello = 'Hello'
world = 'World'
ok '#{hello} #{world}!' is '#{hello} #{world}!'