Function regex_automata::meta::literal::alternation_literals
source · pub(crate) fn alternation_literals(
info: &RegexInfo,
hirs: &[&Hir],
) -> Option<Vec<Vec<u8>>>
Expand description
Pull out an alternation of literals from the given sequence of HIR expressions.
There are numerous ways for this to fail. Generally, this only applies to regexes of the form ‘foo|bar|baz|…|quux’. It can also fail if there are “too few” alternates, in which case, the regex engine is likely faster.
And currently, this only returns something when ‘hirs.len() == 1’.