(German translation on Ruby-Mine.)
Now, I’m about to write the Java Scanner for CodeRay (ticket #42 btw), and I thought it would be nice to have a list of built-in types highlighted – like String or IllegalStateException. I knew that TextMate had quite good highlighting for Java, so I checked the bundle for something to use.
Indeed, some smart guy included a very long regular expression into the token definitions, it looks like this:
support-type-built-ins-java = {
name = 'support.type.built-ins.java';
match = '\b(R(GBImageFilter|MI(S(ocketFactory|e(curity(Manager|Exception)|
rver(SocketFactory|Impl(_Stub)?)?))|C(onnect(ion(Impl(_Stub)?)?|
or(Server)?)|l(ientSocketFactory|assLoader(Spi)?))|IIOPServerImpl|
JRMPServerImpl|FailureHandler)|SA(MultiPrimePrivateCrtKey(Spec)?|
...this goes on for several screens...
Apparently, they converted a long list of types into a minimal regexp, surely using a script for this. But that wasn’t exactly what I had searched for. How could I convert this back into the original plain list?