Permalink
Browse files

Add line numbers and file names to eval calls.

Closes #528
  • Loading branch information...
1 parent 3fc9279 commit 820b70492cb6418c4ac5c6949fe9a338323ea845 @tenderlove committed with nex3 Sep 25, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/sass/callbacks.rb
  2. +3 −3 lib/sass/logger/log_level.rb
  3. +2 −2 lib/sass/script/parser.rb
View
@@ -48,7 +48,7 @@ def clear_callbacks!
# @param name [Symbol] The name of the callback
# @return [void]
def define_callback(name)
- class_eval <<RUBY
+ class_eval <<RUBY, __FILE__, __LINE__ + 1
def on_#{name}(&block)
@_sass_callbacks ||= {}
(@_sass_callbacks[#{name.inspect}] ||= []) << block
@@ -36,14 +36,14 @@ def log_level(name, options = {})
end
def define_logger(name, options = {})
- class_eval %Q{
+ class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{name}(message)
#{options.fetch(:to, :log)}(#{name.inspect}, message)
end
- }
+ RUBY
end
end
end
end
-end
+end
@@ -203,7 +203,7 @@ def associative?(op)
# sub is the name of the production beneath it,
# and ops is a list of operators for this precedence level
def production(name, sub, *ops)
- class_eval <<RUBY
+ class_eval <<RUBY, __FILE__, __LINE__ + 1
def #{name}
interp = try_ops_after_interp(#{ops.inspect}, #{name.inspect}) and return interp
return unless e = #{sub}
@@ -223,7 +223,7 @@ def #{name}
end
def unary(op, sub)
- class_eval <<RUBY
+ class_eval <<RUBY, __FILE__, __LINE__ + 1
def unary_#{op}
return #{sub} unless tok = try_tok(:#{op})
interp = try_op_before_interp(tok) and return interp

0 comments on commit 820b704

Please sign in to comment.