combineMaxSource property

int combineMaxSource
final

Scanners whose patterns add up to more Oniguruma source than this search pattern by pattern, even with combinePatterns.

Each scanner compiles its own alternation regex, so a large pattern shared by many rules is compiled again for every rule. For grammars with patterns of thousands of characters, such as TypeScript, that made the first highlight take over a second, and on the web several seconds and hundreds of megabytes. Single patterns are compiled once and shared.

Implementation

final int combineMaxSource;