On Sun, Jan 18, 2004 at 08:37:49AM +0900, Jamis Buck wrote:
> messju mohr wrote:
> 
> >On Sun, Jan 18, 2004 at 08:10:01AM +0900, Rick Hu wrote:
> > 
> >
> >>why do I get a syntax error for
> >>
> >>   puts 1 if ( 1 == 2
> >>       or 1 == 1 )
> >>
> >>but there is no syntax error for
> >>
> >>   puts 1 if ( 1 == 2 or
> >>       1 == 1 )
> >>   
> >>
> >
> >i don't get one with the ruby-1.8.1 that's distributed in debian's
> >sid.
> > 
> >
> 
> I do, with Ruby 1.8.1.  But the reason (as far as I've been able to 
> ascertain) is that Ruby's grammar does not allow newlines before operators.

i also get one if i run
puts 1 if ( a == b
    or a == c )

maybe just because "or" is an operator and "a" isn't. i avoid newlines
inside ruby-statements because i don't know the rules i have to
obey. where are they stated?

> 
> -- 
> Jamis Buck
> jgb3 / email.byu.edu
> 
> ruby -h | ruby -e 
> 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << 
> r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'