From: Brian Candler Date: 2009-12-05T06:45:27+09:00 Subject: Re: ruby language parser in ruby Ryan Davis wrote: > I think your best bet at this time is ruby_parser. Question for you: as far as I can make out, the handling of embeeded linebreaks such as a = b + c is handled via state kept in the lexer. Can I ask why you did it this way? I am thinking it ought to be possible to do this in the grammar, e.g. expr: expr '+' opt_nl expr | expr '-' opt_nl expr opt_nl: | nl but if you've found out the hard way that it isn't, it could save me following a dead end. Also: can you summarise how you're handling expressions nested within string literals, e.g. "abc #{foo} def" ? Thanks, Brian. -- Posted via http://www.ruby-forum.com/.