private static string Prefix(AbcTraitKind kind) { switch (kind) { case AbcTraitKind.Slot: case AbcTraitKind.Const: return("f:"); case AbcTraitKind.Method: case AbcTraitKind.Function: return("m:"); case AbcTraitKind.Getter: return("g:"); case AbcTraitKind.Setter: return("s:"); case AbcTraitKind.Class: return("t:"); default: throw new ArgumentOutOfRangeException("kind"); } }
public AbcTrait FindSuperTrait(AbcMultiname name, AbcTraitKind kind) { var st = BaseInstance; while (st != null) { var t = st.Traits.Find(name, kind); if (t != null) { return(t); } st = st.BaseInstance; } return(null); }
public AbcTrait(AbcTraitKind kind, AbcMethod method) { Kind = kind; Method = method; }
public AbcTrait(AbcTraitKind kind) { Kind = kind; }
internal static string MakeKey(AbcTraitKind kind, AbcMultiname name) { return((int)kind + ":" + name.Key); }
public bool Contains(AbcMultiname name, AbcTraitKind kind) { return(Find(name, kind) != null); }
public AbcTrait Find(string name, AbcTraitKind kind) { return(_list.FirstOrDefault(t => t.Kind == kind && t.NameString == name)); }
public AbcTrait Find(AbcMultiname name, AbcTraitKind kind) { string key = AbcTrait.MakeKey(kind, name); return(_cache[key] as AbcTrait); }
public AbcTrait[] GetRange(AbcTraitKind kind) { return(this.Where(trait => trait.Kind == kind).ToArray()); }