Exemplo n.º 1
0
        private static void AddParentToChild(string fromTag, string toTag, TagRule rule, Dictionary <string, ImmutableDictionary <string, TagRule> > map)
        {
            if (!map.TryGetValue(fromTag, out var parents))
            {
                parents = ImmutableDictionary <string, TagRule> .Empty;
            }

            if (!parents.ContainsKey(toTag))
            {
                map[fromTag] = parents.Add(toTag, rule);
            }
        }
Exemplo n.º 2
0
 public static RuleResult <TResult> Create <TResult>(TagRule rule, TResult result) => new RuleResult <TResult>(new[] { rule }, result);