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

From: matz@... (Yukihiro Matsumoto)
Date: 2000-04-08 14:47:34 UTC
List: ruby-talk #2398
Hi,

In message "[ruby-talk:02397] Could missing 'end' be reported better?"
    on 00/04/08, mrilu <mrilu@ale.cx> writes:

|I'm not sure one could easily parse, or moreover report, this error better.

Yeah, I'd like to improve if possible.  But since the parser parses like:

|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?

# notice how indentation goes.

And this is a perfectly legal program, except that LAST `end' to the
class clause is missing.  How can I find this error at proper place?
Using indentation information?

							matz.

In This Thread