mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Better warning message for implicit strings with line number and character offset.
This commit is contained in:
parent
e32b76746e
commit
6193c96a65
2 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ RUBY
|
||||||
return paren unless name = try_tok(:ident)
|
return paren unless name = try_tok(:ident)
|
||||||
# An identifier without arguments is just a string
|
# An identifier without arguments is just a string
|
||||||
unless try_tok(:lparen)
|
unless try_tok(:lparen)
|
||||||
warn %Q{WARNING: Implicit strings are deprecated. '#{name.value}' was not quoted. Please add double quotes. E.g. "#{name.value}".}
|
warn %Q{WARNING: Implicit strings are deprecated. '#{name.value}' found at line #{name.line}, character #{name.offset} was not quoted. Please add double quotes. E.g. "#{name.value}".}
|
||||||
Script::String.new(name.value)
|
Script::String.new(name.value)
|
||||||
else
|
else
|
||||||
args = arglist || []
|
args = arglist || []
|
||||||
|
|
|
@ -719,7 +719,7 @@ SASS
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_inaccessible_functions
|
def test_inaccessible_functions
|
||||||
assert_warning %Q{WARNING: Implicit strings are deprecated. 'to_s' was not quoted. Please add double quotes. E.g. \"to_s\".} do
|
assert_warning %Q{WARNING: Implicit strings are deprecated. 'to_s' found at line 2, character 11 was not quoted. Please add double quotes. E.g. \"to_s\".} do
|
||||||
assert_equal("a {\n b: send(to_s); }\n", render("a\n b = send(to_s)"))
|
assert_equal("a {\n b: send(to_s); }\n", render("a\n b = send(to_s)"))
|
||||||
end
|
end
|
||||||
assert_equal("a {\n b: public_instance_methods(); }\n", render("a\n b = public_instance_methods()"))
|
assert_equal("a {\n b: public_instance_methods(); }\n", render("a\n b = public_instance_methods()"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue