On Sun, 18 Dec 2005 18:10:08 -0000, Martin DeMello  
<martindemello / yahoo.com> wrote:

> James Edward Gray II <james / grayproductions.net> wrote:
>> On Dec 16, 2005, at 10:36 AM, Paul Battley wrote:
>>
>> >> So I'm going to write an end matching program. Could somebody please
>> >> list all the keywords that are ended by "end"? Do any of these
>> >> keywords ever not end in "end"?
>> >
>> > One wrinkle: 'do' does not always end in 'end'.  It can be a method,
>> > and is used as such in DBI (e.g. 'dbh.do(...)').  It should be easy
>> > enough to handle that case by checking for a preceding period,
>> > however.
>>
>> I imagine all the words in that list have the same issue.
>>
>> Checking for the period is a good start, but watch out for edge cases:
>>
>>    send(:do, *args)
>
> Would probablly be better to check for everything that *can* precede the
> 'do' and have it be a real end-ended do.
>
> martin

Guys, take a look at Vim's implementation. On my system the pertinent  
files are:

	 /usr/share/vim/vim63/indent/ruby.vim
	 /usr/share/vim/vim63/syntax/ruby.vim

The indent one seems to have everything you need, but the syntax is  
concerned with end matching too (for colouring ends belonging to ifs  
different to ends belonging to blocks, and what have you).

Now all you need is to port it to Ruby ;)

-- 
Ross Bamford - rosco / roscopeco.remove.co.uk