Ruby `parser` gem

1 · Nelson Elhage · Feb. 13, 2016, 4:07 a.m.
The ruby parser gem is an implementation of a Ruby parser in Ruby itself, which allows for Ruby code to parse and introspect Ruby code. It’s used in a number of places, but perhaps most prominently by rubocop, a Ruby linter and style checker. In parser versions <= 2.3.0.4, the parser is quadratic in the length of the input string, for any input containing >0 unicode codepoints outside of the ASCII range. The problem arises initially in the lexer, which turns the source input into a sequence of t...