Hi,

2010/4/9 caleb clausen <redmine / ruby-lang.org>:
>> BTW, how about the following? :-)
>>
>> # ok
>> while (((((((((((((((((((((((((((((((false)))))))))))))))))))))))))))))))
>> do; end
>>
>> # parse error
>> while ((((((((((((((((((((((((((((((((false))))))))))))))))))))))))))))))))
>> do; end
>
> Ooooo! Both of those don't parse right in redparse. But not for the reason you seem to expect; it's objecting to the do on its own line. That is to say, this also doesn't parse:
>
> ?while false
> ?do; end
>
> Thanks for the bug. I'll fix it right away.
>
> Taking out the newline before do makes them parse right again. (For MRI too, tho.)
>
> Incidentally, all the ruby versions I have (1.8.6, 1.9.0, 1.9.1) also object to do after a newline. I guess this was added (relatively) recently?


Ahh, the newline is accidentally inserted by Gmail.
The code (do after a newline) does not parse even in trunk.
This is never what I meant.


>> If your CPU is 64 bit, please run after 32 '(' and ')' are added :-p
>
> This was on a 32 bit cpu. I wouldn't anticipate any problems with any number of nested parentheses. (Until, that is, you run out of memory.)

Try 63-paren version and 64-paren one (without newline).
The former does parse and the latter does not, I think.


This is overflow problem of stack_type (which is an integer
representing bit stack of lexer state).
In trunk, stack_type was defined as LONG_LONG (64 bit), but
it was changed to VALUE (32 bit) since r22887.

-- 
Yusuke ENDOH <mame / tsg.ne.jp>