Example #1
0
        protected virtual void EmitOperatorGroup(List <OperatorDeclaration> group)
        {
            if (group.Count == 1)
            {
                if (!group[0].Body.IsNull)
                {
                    Emitter.VisitOperatorDeclaration(group[0]);
                }
            }
            else
            {
                var name       = group[0].Name;
                var methodsDef = Emitter.GetTypeDefinition().Methods.Where(m => m.Name == name);
                Emitter.MethodsGroup        = methodsDef;
                Emitter.MethodsGroupBuilder = new Dictionary <int, StringBuilder>();

                foreach (var method in group)
                {
                    if (!method.Body.IsNull)
                    {
                        Emitter.VisitOperatorDeclaration(method);
                    }
                }

                Emitter.MethodsGroup        = null;
                Emitter.MethodsGroupBuilder = null;
            }
        }