On 5/2/09, Marc Heiler <shevegen / linuxmail.org> wrote:
>> RubyLexer is a lexer library for Ruby, written in Ruby. Rubylexer is
>> meant as a lexer for Ruby that's complete and correct; all legal Ruby
>> code should be lexed correctly by RubyLexer as well.
>
> Would this allow one to create a "mini-irb", i.e. something that can
> interprete ruby code like irb does, but without the need to reuse that
> undercommented irb code?

So, irb has its own little lexer it uses internally, mostly so it can
tell whether you've typed a complete line of code or not. I presume
that's what you're referring to...? Irb's lexer could fairly easily be
replaced with RubyLexer, or you could write a whole new implementation
based on it.

I know irb's lexer is incomplete in various ways, but it seems to be
much better than it was
when I started writing RubyLexer. RubyLexer isn't totally perfect yet
either... it certainly isn't very readable... so now you've replaced
undercommented irb code with undercommented RubyLexer code... ;)

Is this answering your question? I'm not sure.