mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Better general error message for sass parsing.
This commit is contained in:
parent
17fdd86be8
commit
2abedba0d6
2 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ module Sass
|
|||
|
||||
value = variable || string || number || color || bool || op || ident
|
||||
unless value
|
||||
raise SyntaxError.new("Syntax error in '#{@scanner.string}' at '#{@scanner.rest}'.")
|
||||
raise SyntaxError.new("Syntax error in '#{@scanner.string}' at character #{current_position}.")
|
||||
end
|
||||
Token.new(value.first, value.last, @line, last_match_position)
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ class SassEngineTest < Test::Unit::TestCase
|
|||
"@import foo.sass" => "File to import not found or unreadable: foo.sass.",
|
||||
"@import templates/basic\n foo" => "Illegal nesting: Nothing may be nested beneath import directives.",
|
||||
"foo\n @import templates/basic" => "Import directives may only be used at the root of a document.",
|
||||
"!foo = bar baz !" => "Syntax error in 'bar baz !' at '!'.",
|
||||
"!foo = bar baz !" => "Syntax error in 'bar baz !' at character 8.",
|
||||
"=foo\n :color red\n.bar\n +bang" => "Undefined mixin 'bang'.",
|
||||
".bar\n =foo\n :color red\n" => ["Mixins may only be defined at the root of a document.", 2],
|
||||
"=foo\n :color red\n.bar\n +foo\n :color red" => "Illegal nesting: Nothing may be nested beneath mixin directives.",
|
||||
|
|
Loading…
Add table
Reference in a new issue