Exemplo n.º 1
0
        protected static bool RecursiveMerge(ref ScopeMember res, ScopeMember level)
        {
            if(level != null && res != null)
            {
                if(res.IsTypeGroup() && level.IsTypeGroup())
                {
                    // Merge type groups.
                    TypeGroup lower = (TypeGroup)res;
                    TypeGroup next = (TypeGroup)level;
                    if(!lower.IsMergedGroup())
                        res = lower.CreateMerged(next, false);
                    else
                        lower.AppendLevel(next, false);
                }
                else if(res.IsFunctionGroup() && level.IsFunctionGroup())
                {
                    // Merge function groups.
                    FunctionGroup lower = (FunctionGroup)res;
                    FunctionGroup next = (FunctionGroup)level;
                    if(!lower.IsMergedGroup())
                        res = lower.CreateMerged(next, false);
                    else
                        lower.AppendLevel(next, false);
                }
            }
            else if(res == null)
            {
                // Set the result to the next level.
                res = level;
            }

            return IsRecursiveContinue(res);
        }
Exemplo n.º 2
0
        protected static bool RecursiveMerge(ref ScopeMember res, ScopeMember level)
        {
            if (level != null && res != null)
            {
                if (res.IsTypeGroup() && level.IsTypeGroup())
                {
                    // Merge type groups.
                    TypeGroup lower = (TypeGroup)res;
                    TypeGroup next  = (TypeGroup)level;
                    if (!lower.IsMergedGroup())
                    {
                        res = lower.CreateMerged(next, false);
                    }
                    else
                    {
                        lower.AppendLevel(next, false);
                    }
                }
                else if (res.IsFunctionGroup() && level.IsFunctionGroup())
                {
                    // Merge function groups.
                    FunctionGroup lower = (FunctionGroup)res;
                    FunctionGroup next  = (FunctionGroup)level;
                    if (!lower.IsMergedGroup())
                    {
                        res = lower.CreateMerged(next, false);
                    }
                    else
                    {
                        lower.AppendLevel(next, false);
                    }
                }
            }
            else if (res == null)
            {
                // Set the result to the next level.
                res = level;
            }

            return(IsRecursiveContinue(res));
        }
Exemplo n.º 3
0
 protected static bool IsRecursiveContinue(ScopeMember member)
 {
     return(member == null || member.IsTypeGroup() || member.IsFunctionGroup());
 }
Exemplo n.º 4
0
 protected static bool IsRecursiveContinue(ScopeMember member)
 {
     return member == null || member.IsTypeGroup() || member.IsFunctionGroup();
 }