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

Make css2sass error messages more descriptive.

This commit is contained in:
Nathan Weizenbaum 2008-03-09 12:57:38 -07:00
parent 8566f86bfa
commit 01f5e30174

View file

@ -191,7 +191,10 @@ module Sass
def assert_match(re)
if !@template.scan(re)
raise Exception.new("Invalid CSS!")
line = @template.string[0..@template.pos].count "\n"
# Display basic regexps as plain old strings
expected = re.source == Regexp.escape(re.source) ? "\"#{re.source}\"" : re.inspect
raise Exception.new("Invalid CSS on line #{line}: expected #{expected}")
end
whitespace
end