bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions fo


From: Dmitry Gutov
Subject: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly
Date: Sat, 01 Feb 2014 17:19:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Bozhidar Batsov <bozhidar@batsov.com> writes:

> In the following snippet `format` is font-locked as the built-in
> function, but it's actually a variable.
>
> respond_to do |format|
>   format.json do
>     # ...
>   end
> end
>
> This problem obviously exists for all built-ins, but it's not a big
> issue in general, since most of them don't have names that are likely to
> be used as variable names. Not sure if we can have a simple solution for
> this problem without a parser, though. I guess we can have a check if
> the built-in methods have arguments (as most of them have).

A lot of them don't, though (or have no required arguments): __callee__,
__dir__, __method__, binding, caller, block_given?, exit, exit!, raise,
(s)rand, readline(s), sleep.

Guess we can separate these, and for all others, check if they're
followed by " *[]|,.)}]\\|$".





reply via email to

[Prev in Thread] Current Thread [Next in Thread]