[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1593: ruby-mode: problems with font-lock
From: |
Chong Yidong |
Subject: |
bug#1593: ruby-mode: problems with font-lock |
Date: |
Sat, 20 Dec 2008 02:37:38 -0500 |
Hi Phil,
If you have time, could you take a look at this bug report? Thanks.
"Pietro Giorgianni" <giorgian@gmail.com> wrote:
The syntax %{#{'?'}} , while legal (it is equivalent to '?'), makes
all the following text appear in font-lock-string-face.
The same happens with %{#{"?"}} , and seems to rise from the ?" or ?'
part: if I put a space (or whatever) after the ? , things work.
Real life example (from the sources of rubyonrails):
self.class_eval %{
def self.#{method_id}(*args)
guard_protected_attributes = false
if args[0].is_a?(Hash)
guard_protected_attributes = true
attributes = args[0].with_indifferent_access
find_attributes =
attributes.slice(*[:#{attribute_names.join(',:')}])
else
find_attributes = attributes =
construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
end
options = { :conditions => find_attributes }
set_readonly_option!(options)
record = find_initial(options)
if record.nil?
record = self.new { |r| r.send(:attributes=, attributes,
guard_protected_attributes) }
#{'yield(record) if block_given?'}
#{'record.save' if instantiator == :create}
record
else
record
end
end
}, __FILE__, __LINE__