From: Caleb Clausen Date: 2009-07-20T06:03:14+09:00 Subject: Re: Block Comments On 7/18/09, yesteray wrote: > What text, if any, is allowed on the the line after the =begin and > =end delimiters of block comments? > > I have code that looks like this: > > =begin Hello > =end Goodbye > p "I work" > > and it prints "I work" on these versions of Ruby: > > ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] > ruby 1.9.0 (2008-07-25 revision 18217) [i686-darwin9.5.2] > jruby 1.3.0 (ruby 1.8.6p287) (2009-06-03 5dc2e22) (Java HotSpot(TM) > Client VM 1.5.0_19) [i386-java] > > Normally I wouldn't think about this anymore, but he ruby-parser gem > (2.0.2) throws an error: > > ruby_parser-2.0.2/lib/ruby_lexer.rb:385:in `rb_compile_error': > embedded document meets end of file. near line 1: " > Hello" (SyntaxError) > > although it works if you remove the text after the =end. RedParse doesn't have this bug, tho there is a more obscure problem with =begin blocks that I haven't figured out yet.