On 5/11/06, Angelo removed_email_address@domain.invalid wrote:

```
if
end
```

end

It’s bugging at the first and only elsif. (syntax error, unexpected

kELSIF, expecting kEND)

I’m guessing it’s actually a problem with your elided (not shown)

code. If I take you structure and add in some simple conditions and

statements, it runs fine:

for i in (1…10).to_a

if i > 5

if i < 8

puts “i is 6 or 7”

else

puts “i is 8, 9 or 19”

end

elsif i < 2

puts “i is 1”

end

if (i % 2).zero?

puts “#{i} is even”

end

end

produces:

i is 1

2 is even

4 is even

i is 6 or 7

6 is even

i is 6 or 7

i is 8, 9 or 19

8 is even

i is 8, 9 or 19

i is 8, 9 or 19

10 is even

My guess is you have some other construct requiring an ‘end’ (while

loop, block, etc.) that is missing its ‘end’ between the first ‘end’

(of the nested if) and the ‘elsif’ in question. Since you’re still in

the other construct, the parser is expecting to see that construct

closed (with a kEND token) before seeing the kELSIF token of the

enclosing if statement.

Jacob F.