MagLev / maglev

GemStone Maglev Ruby Repository
http://maglev.github.io
517 stars 41 forks source link

Parser: Stabby Lambda #410

Open johnnyt opened 9 years ago

johnnyt commented 9 years ago

MRI 1.9.3

ruby -e 'p ->{ }'
#<Proc:0x007f9edb10d520@-e:1 (lambda)>

MagLev

maglev-ruby -e 'p ->{ }'
-e:3, syntax error, unexpected '>'
ERROR 2702 , a RubyParseError occurred (error 2702), WARNING, line 3: ambiguous first argument; put parentheses or even spaces
-e:3: syntax error, unexpected '>'
unexpected EOF at line 6 (RubyParseError)
topaz 1> exit
zenspider commented 9 years ago

I believe I have this fixed in my branch. Double checking...

zenspider commented 9 years ago

I have it finished on the parser side but have a bug in the lexer that I was unable to resolve at the time.

zenspider commented 9 years ago

Yeah. Hitting the same problem I hit before. I'm adding:

  ps->paren_nest = 0;
  ps->lpar_beg = 0;

to the rb_parse_state and it causes segfaults left and right. I'm not sure why adding 2 ints to the struct will create such havoc.... but I suspect something hinky is going on. I have yet to attach with a debugger to poke deeper.

@AllenOtis any hints?

AllenOtis commented 9 years ago

I need to see a diff of what you changed. Note that C++ classes YyStackElement and YyStackData can't be changed without also recompiling the server with the same changes (see comments about "must agree ... with om.hf" ).

On Tue, Jul 21, 2015 at 4:29 PM, Ryan Davis notifications@github.com wrote:

Yeah. Hitting the same problem I hit before. I'm adding:

ps->paren_nest = 0; ps->lpar_beg = 0;

to the rb_parse_state and it causes segfaults left and right. I'm not sure why adding 2 ints to the struct will create such havoc.... but I suspect something hinky is going on. I have yet to attach with a debugger to poke deeper.

@AllenOtis https://github.com/AllenOtis any hints?

— Reply to this email directly or view it on GitHub https://github.com/MagLev/maglev/issues/410#issuecomment-123507180.

johnnyt commented 9 years ago

Hey @zenspider - do you have the branch/code available for us to look at?