Skip to content

Commit

Permalink
Add line numbers and file names to eval calls.
Browse files Browse the repository at this point in the history
Closes sass#528
  • Loading branch information
tenderlove authored and nex3 committed Sep 28, 2012
1 parent 3fc9279 commit 820b704
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/sass/callbacks.rb
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/sass/logger/log_level.rb
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/sass/script/parser.rb
Expand Up @@ -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}
Expand All @@ -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
Expand Down

0 comments on commit 820b704

Please sign in to comment.