示例#1
0
        FullNamedExpression ResolveMemberName(IMemberContext context, MemberName mn)
        {
            // FIXME: Default namespace lookups to C# resolution semantics (for now).  Need a way to determine if PlayScript absolute
            // namespace lookups should be used here.
            bool absolute_ns = false;

            if (mn.Left == null)
            {
                return(context.LookupNamespaceOrType(mn.Name, mn.Arity, LookupMode.Probing, absolute_ns, Location.Null));
            }

            var left = ResolveMemberName(context, mn.Left);
            var ns   = left as Namespace;

            if (ns != null)
            {
                return(ns.LookupTypeOrNamespace(context, mn.Name, mn.Arity, LookupMode.Probing, Location.Null));
            }

            TypeExpr texpr = left as TypeExpr;

            if (texpr != null)
            {
                var found = MemberCache.FindNestedType(texpr.Type, ParsedName.Name, ParsedName.Arity);
                if (found != null)
                {
                    return(new TypeExpression(found, Location.Null));
                }

                return(null);
            }

            return(left);
        }
示例#2
0
        FullNamedExpression ResolveMemberName(IMemberContext context, MemberName mn)
        {
            if (mn.Left == null)
            {
                return(context.LookupNamespaceOrType(mn.Name, mn.Arity, LookupMode.Probing, Location.Null));
            }

            var left = ResolveMemberName(context, mn.Left);
            var ns   = left as NamespaceExpression;

            if (ns != null)
            {
                return(ns.LookupTypeOrNamespace(context, mn.Name, mn.Arity, LookupMode.Probing, Location.Null));
            }

            TypeExpr texpr = left as TypeExpr;

            if (texpr != null)
            {
                var found = MemberCache.FindNestedType(texpr.Type, mn.Name, mn.Arity);
                if (found != null)
                {
                    return(new TypeExpression(found, Location.Null));
                }

                return(null);
            }

            return(left);
        }
示例#3
0
        FullNamedExpression ResolveMemberName(IMemberContext context, MemberName mn)
        {
            if (mn.Left == null)
            {
                return(context.LookupNamespaceOrType(mn.Name, mn.Arity, Location.Null, /*ignore_cs0104=*/ false));
            }

            var left = ResolveMemberName(context, mn.Left);
            var ns   = left as Namespace;

            if (ns != null)
            {
                return(ns.Lookup(context, mn.Name, mn.Arity, Location.Null));
            }

            TypeExpr texpr = left as TypeExpr;

            if (texpr != null)
            {
                var found = MemberCache.FindNestedType(texpr.Type, ParsedName.Name, ParsedName.Arity);
                if (found != null)
                {
                    return(new TypeExpression(found, Location.Null));
                }

                return(null);
            }

            return(left);
        }