4 ms·
> (also note that pygments chokes on my perfectly valid ruby file, at `%r(\\\\)`) Pygments was actually better at lexing ruby at one point but the regular expr
by the_mitsuhiko 14y ago
> (also note that pygments chokes on my perfectly valid ruby file, at `%r(\\\\)`)
Pygments was actually better at lexing ruby at one point but the regular expressions were too complex and some other bug fixes broke other stuff. I think at the moment it's good enough.
But yeah, I was in the same boat. I learned Ruby for Pygments.
//EDIT: vim does considerably worse on that file btw.
- jayferd 14y agoYep. It's surprising how many things can be missing from a lexer and still be "good enough" for most people. I don't know anybody who's actually used that heredoc-stacking thing. :D I guess you're the author of all those frustrated "wtf ruby" comments I found in the pygments lexer, then :). I seriously doubt I could have done it at all without pygments as a reference. My vim does fine on that file: http://imgur.com/VSYr4aa http://imgur.com/VSYr4aa . Maybe I'm using a more recent version...? It misses some of the `end` keywords, but that's just a quirk that it has ;) Another example that bit me - this took the longest, I think: foo = 10 foo %(2) # call method foo with string "2" foo % 2 # the value of foo modulo 2 % 2 # the string "2"