public ITypeDeclaration VisitTemplateParameterSymbol(TemplateParameterSymbol t) { if (t.Base != null) { return(AcceptType(t.Base)); } return(t.DeclarationOrExpressionBase as ITypeDeclaration ?? new IdentifierDeclaration(t.Parameter.NameHash)); }
public void VisitTemplateParameterSymbol(TemplateParameterSymbol t) { if (t.ParameterValue != null) { sb.Append(t.ParameterValue.ToCode()); } else if (t.Base == null) { sb.Append(t.Parameter == null ? "(unknown template parameter)" : t.Parameter.Name); } else { AcceptType(t.Base); //FIXME: It's not actually code but currently needed for correct ToString() representation in e.g. parameter insight } }
public bool GetTemplateParam(int idHash, out TemplateParameterSymbol tps) { tps = null; Stack <ContextFrame> backup = null; bool ret = false; while (stack.Count != 0) { var cur = stack.Peek(); foreach (var kv in cur.DeducedTemplateParameters) { if (kv.Key.NameHash == idHash) { tps = kv.Value; ret = true; break; } } if (backup == null) { backup = new Stack <ContextFrame> (); } backup.Push(stack.Pop()); if (cur.ScopedBlock == null || stack.Count == 0 || cur.ScopedBlock.Parent != stack.Peek().ScopedBlock) { break; } } if (backup != null) { while (backup.Count != 0) { stack.Push(backup.Pop()); } } return(ret); }
public void VisitTemplateParameterSymbol(TemplateParameterSymbol tps) { if (tps.Base != null) tps.Base.Accept(this); else { var tpp = tps.Parameter is TemplateThisParameter ? (tps.Parameter as TemplateThisParameter).FollowParameter : tps.Parameter; if (tpp is TemplateTupleParameter) StaticProperties.ListProperties(CompletionDataGenerator, MemberFilter, tps, true); } }
public void VisitTemplateParameterSymbol(TemplateParameterSymbol t) { if (t.ParameterValue != null) sb.Append(t.ParameterValue.ToCode()); else if(t.Base == null) sb.Append(t.Parameter == null ? "(unknown template parameter)" : t.Parameter.Name); else AcceptType(t.Base); //FIXME: It's not actually code but currently needed for correct ToString() representation in e.g. parameter insight }