internal OptionalNode(PatternNode node) { CheckValue(node, nameof(node)); Node = node is OptionalNode optionalNode ? optionalNode.Node : node; }
private Regex BuildCore(PatternNode pattern, bool exactMatch) { Visit(pattern); if (exactMatch) { builder.AppendDollar(); } return(RegexFactory.Create(builder.ToString())); }
private ISet <string> ExtractCore(PatternNode node) { Visit(node); return(names); }
internal static ISet <string> Extract(PatternNode node) => new VariableNamesExtractor().ExtractCore(node);
internal static Regex Build(PatternNode pattern, bool exactMatch) => new PatternRegexBuilder().BuildCore(pattern, exactMatch);