예제 #1
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter        = emitter;
     this.Name           = operatorDeclaration.Name;
     this.JsName         = this.Emitter.GetEntityName(operatorDeclaration);
     this.Inherit        = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static         = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member         = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type           = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.Cache.AddNode(operatorDeclaration, false, this);
 }
예제 #2
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter        = emitter;
     this.Name           = operatorDeclaration.Name;
     this.JsName         = this.Emitter.GetEntityName(operatorDeclaration, false, true);
     this.Inherit        = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static         = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member         = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type           = this.Member.DeclaringType;
     this.InitMembers();
     //this.Emitter.OverloadsCache[operatorDeclaration.GetHashCode().ToString()] = this;
 }
예제 #3
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter        = emitter;
     this.Name           = operatorDeclaration.Name;
     this.JsName         = this.Emitter.GetEntityName(operatorDeclaration, false, true);
     this.Inherit        = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static         = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member         = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type           = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.OverloadsCacheNodes[new Tuple <AstNode, bool>(operatorDeclaration, false)] = this;
 }
예제 #4
0
        public override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)
        {
            if (this.HasInline(operatorDeclaration))
            {
                return;
            }

            this.FixMethodParameters(operatorDeclaration.Parameters, operatorDeclaration.Body);

            bool isStatic = operatorDeclaration.HasModifier(Modifiers.Static);

            Dictionary <OperatorType, List <OperatorDeclaration> > dict = this.CurrentType.Operators;

            var key = operatorDeclaration.OperatorType;

            if (dict.ContainsKey(key))
            {
                dict[key].Add(operatorDeclaration);
            }
            else
            {
                dict.Add(key, new List <OperatorDeclaration>(new[] { operatorDeclaration }));
            }
        }
예제 #5
0
        public override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)
        {
            if (this.HasInline(operatorDeclaration))
            {
                return;
            }

            this.FixMethodParameters(operatorDeclaration.Parameters, operatorDeclaration.Body);

            bool isStatic = operatorDeclaration.HasModifier(Modifiers.Static);

            Dictionary<OperatorType, List<OperatorDeclaration>> dict = this.CurrentType.Operators;

            var key = operatorDeclaration.OperatorType;
            if (dict.ContainsKey(key))
            {
                dict[key].Add(operatorDeclaration);
            }
            else
            {
                dict.Add(key, new List<OperatorDeclaration>(new[] { operatorDeclaration }));
            }
        }
예제 #6
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter = emitter;
     this.Name = operatorDeclaration.Name;
     this.JsName = this.Emitter.GetEntityName(operatorDeclaration, false, true);
     this.Inherit = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.OverloadsCache[operatorDeclaration.GetHashCode().ToString()] = this;
 }