LeaVerou/prism — pull request #444 by zeitgeist87 (2014-12-21 11:12:17+00:00)
Title: Combine regexes in arrays if possible

It is often useful to split up a big regex into separate logical
units. Unfortunately this is bad for performance, because the input
string has to be separately traversed for every unit.

This patch adds a simple optimization function, which walks through a
grammar and combines regexes that are split up in an array into one
single regex.

This can only be done, if the array contains only regexes, which all
have the same modifiers and no back references.