1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Fix a bizarre parser error with SCSS and interpolation.

This commit is contained in:
Nathan Weizenbaum 2010-04-26 14:36:09 -07:00
parent 89c9c8a44f
commit dbccadba45
2 changed files with 17 additions and 2 deletions

View file

@ -149,10 +149,10 @@ module Sass
# @return [Boolean]
def whitespace?(tok = @tok)
if tok
@scanner.string[0...tok.pos] =~ /\s$/
@scanner.string[0...tok.pos] =~ /\s\Z/
else
@scanner.string[@scanner.pos, 1] =~ /^\s/ ||
@scanner.string[@scanner.pos - 1, 1] =~ /\s$/
@scanner.string[@scanner.pos - 1, 1] =~ /\s\Z/
end
end

View file

@ -970,6 +970,21 @@ SCSS
flim {
&& {a: b}
}
SCSS
end
# Regression
def test_weird_added_space
assert_equal <<CSS, render(<<SCSS)
foo {
bar: -moz-bip; }
CSS
$value : bip;
foo {
bar: -moz-\#{$value};
}
SCSS
end
end