From: Joachim Wuttke Date: 2004-10-07T07:19:19+09:00 Subject: Re: quality of error messages Thank you, Brian. This is quite a convincing example: I count not less than eight places where the "end" could be missing. Just for curiosity: why didn't Ruby borrow indentation semantics from Python ? Regards, Joachim > Consider: > > The error is obvious to you, right? But because identation is not signficant > in Ruby, the parser will read it as: > > class A > def m1 > end # "end" could be missing here > def m2 > end # "end" could be missing here > def m3(x) > if x == 3 > puts "hello" # "end" could be missing here > end # "end" could be missing here > end # "end" could be missing here > class B # nested class definition (A::B) > def m1 > end # "end" could be missing here > def m2 > end # "end" could be missing here > end > # missing 'end' error reported here