Match compiler: Split _replaceTokenMatch() into two small functions