embedded document meets end of file

S

Simon Strandgaard

I am curious to what that message means?

server> ruby a.rb
a.rb:5: embedded document meets end of file
server> cat a.rb
p 'before'
=begin p 1
im a comment
=end; p 2
p 'after'
server>


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

server> ruby a.rb
"before"
"after"
server> cat a.rb
p 'before'
=begin p 1
im a comment
=end p 2
p 'after'
server>
 
N

nobu.nokada

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.
 
S

Simon Strandgaard

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.

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
 
H

Hal Fulton

Simon said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top