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:
parent
8566f86bfa
commit
01f5e30174
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue