public void Add(TypeCompilationContext type, StrengthKind strength) { var frame = new OrderingFrame { Previous = Stack.FirstOrDefault(), Type = type, Strength = strength }; if (frame.Previous != null && frame.Previous.Type != null && frame.Previous.Type != frame.Type) { StrengthKind priorStrength; if (!frame.Previous.Type.Requires.TryGetValue(type, out priorStrength) || priorStrength < strength) { frame.Previous.Type.Requires[type] = strength; } } if (Ordered.Contains(type) || frame.IsPrevented()) { return; } Stack.Push(frame); type.SymbolUsage(ShallowUsage, DeepUsage); if (!Ordered.Contains(type)) { Ordered.Add(type); } Stack.Pop(); }
public void Add(TypeCompilationContext type, StrengthKind strength) { var frame = new OrderingFrame { Previous = Stack.FirstOrDefault(), Type = type, Strength = strength }; if (frame.Previous != null && frame.Previous.Type != null && frame.Previous.Type != frame.Type) { StrengthKind priorStrength; if (!frame.Previous.Type.Requires.TryGetValue(type, out priorStrength) || priorStrength < strength) { frame.Previous.Type.Requires[type] = strength; } } if (Ordered.Contains(type) || frame.IsPrevented()) { return; } Stack.Push(frame); type.SymbolUsage(ShallowUsage, DeepUsage); if (!Ordered.Contains(type)) { Ordered.Add(type); } Stack.Pop(); }