given_ToExpr_Regex
Embeds the value's already-computed RegexEncoder.Encoded shape, reconstructed by RegexDecoder, instead of regenerating it through the public smart constructors (concat, alt, inter, star, unary_!, lookahead) at every call site - the same spirit as TokenMatcher's ToExpr embedding its DFA tables as plain data. The smart constructors exist to (re-)establish ACI normalization and merge Chars sets when building a tree from scratch; a Regex value reaching this given is already normalized, so re-running them at every macro call site - and again at every class load, since the generated code re-executes them - would just redo that work for a result that's already known. See RegexEncoder for why the encoding is flat data rather than nested constructor calls.
Attributes
- Source
- Regex.scala
- Graph
-
- Supertypes
- Self type
-
given_ToExpr_Regex.type