chriswailes/RLTK — Issue #4: capture groups in lexers
Author: jayferd
Created: 2012-01-18 22:02:15+00:00
State: open

Hey there.

This is awesome. I'm wondering if there's a way to get access to the groups captured by a particular rule's regex, as in `String#scan`. For example:

``` ruby
class MyLexer < RLTK::Lexer
rule(/\.(\w+)\[/) { [:THING, $1] }
end
```

Currently it looks like the block is being passed only the whole match. I'm happy to patch it to be more like the core ruby matching methods, but I wanted to check first :)