Embedded document meets end of file

I am curious to what that message means?

ruby a.rb

a.rb:5: embedded document meets end of file

cat a.rb

p 'before'
=begin p 1
im a comment
=end; p 2
p 'after'

I have noticed that you can type text on the same line as =begin/=end
as long its not semicolon.. without semicolon it works.

ruby a.rb

"before"
"after"

cat a.rb

p 'before'
=begin p 1
im a comment
=end p 2
p 'after'

···

--
Simon Strandgaard

Hi,

At Wed, 23 Jun 2004 21:09:21 +0900,
Simon Strandgaard wrote in [ruby-talk:104411]:

I have noticed that you can type text on the same line as =begin/=end
as long its not semicolon.. without semicolon it works.

=end line must not be followed by non-space characters. It is
not a part of ordinary syntax.

···

--
Nobu Nakada

if it isn't part of the syntax.. wouldn't it then be better if Ruby rejected
such lines?

=begin reject me
=end reject me too

···

On Wednesday 23 June 2004 16:07, nobu.nokada@softhome.net wrote:

At Wed, 23 Jun 2004 21:09:21 +0900,

Simon Strandgaard wrote in [ruby-talk:104411]:
> I have noticed that you can type text on the same line as =begin/=end
> as long its not semicolon.. without semicolon it works.

=end line must not be followed by non-space characters. It is
not a part of ordinary syntax.

--
Simon Strandgaard

Simon Strandgaard wrote:

if it isn't part of the syntax.. wouldn't it then be better if Ruby rejected such lines?

=begin reject me
=end reject me too

I thought rdoc made use of this behavior?

Hal

Hi,

At Wed, 23 Jun 2004 23:16:16 +0900,
Simon Strandgaard wrote in [ruby-talk:104416]:

> > I have noticed that you can type text on the same line as =begin/=end
> > as long its not semicolon.. without semicolon it works.
>
> =end line must not be followed by non-space characters. It is
> not a part of ordinary syntax.

if it isn't part of the syntax.. wouldn't it then be better if Ruby rejected
such lines?

It is a part, but quite different from other parts. And
documentation tools can select enabled portion by them.

···

--
Nobu Nakada

On the =begin

Cheers

Dave

···

On Jun 23, 2004, at 12:58, Hal Fulton wrote:

Simon Strandgaard wrote:

if it isn't part of the syntax.. wouldn't it then be better if Ruby rejected such lines?
=begin reject me
=end reject me too

I thought rdoc made use of this behavior?