[ruby-talk:02403] Re: Could missing 'end' be reported better?

From: Hideto ISHIBASHI <hideto-i@...4u.or.jp>
Date: 2000-04-08 14:59:16 UTC
List: ruby-talk #2403
I tried the next code...

> class Foo
>   def bar
>     p "missing end at next line"
> #  end
> end
> 
> k = Foo.new()
> k.bar()
> # causes 'sample.rb:9: parse error' here, how informative, isn't it?

But it's too simpler than the practice.

More practical :-) example...

  class Foo
    def foo
    #end
    def bar
    end
  end

  f = Foo.new
  f.bar

This code will cause:
  test.rb:4: nested method definition
  test.rb:9: parse error

A bug, missing "end", is reported as a "nested method definition".
The report is not satisfactory yet but the reported line is correct.

Then it's not a matter when at least two methods are defined in a class.
I hope this could be some relief even nothing has changed :-)

--
Hideto "rubyholic" ISHIBASHI

In This Thread

Prev Next