seattlerb/ruby_parser — pull request #79 by presidentbeef (2012-10-28 20:56:32+00:00)
Title: Use atomic group for ESC_RE

This solves the timeout problem in #36 and I believe still matches the same strings (first time I've used an "atomic group" thing).

Looking at `ESC_RE` like this:

```ruby
ESC_RE = /\\(
[0-7]{1,3}|
x[0-9a-fA-F]{1,2}|
M-[^\\]|
(C-|c)[^\\]|
[^0-7xMCc]
)/
```

None of the alternative patterns overlap, so if one is matched there is never a reason to go back and try another. So I went with the first regex optimization suggestion I saw, which is turning this into an atomic group. But since atomic groups don't capture the match, I put that group inside another group for use at [line 72](https://github.com/seattlerb/ruby_parser/blob/master/lib/ruby_lexer.rb#L772).