Exemplo n.º 1
0
        private bool IsValidRowScopedDottedNameNode(DottedNameNode node, TexlBinding binding, OperationCapabilityMetadata metadata, out bool isRowScopedDelegationExempted)
        {
            Contracts.AssertValue(node);
            Contracts.AssertValue(binding);

            isRowScopedDelegationExempted = false;
            if (node.Left.Kind == NodeKind.FirstName &&
                binding.IsDelegationExempted(node.Left as FirstNameNode) &&
                binding.IsLambdaScoped(node.Left as FirstNameNode))
            {
                isRowScopedDelegationExempted = true;

                return(true);
            }

            if (node.Left.Kind == NodeKind.DottedName)
            {
                return(IsValidRowScopedDottedNameNode(node.Left.AsDottedName(), binding, metadata, out isRowScopedDelegationExempted));
            }

            if (node.Left.Kind == NodeKind.Call && binding.GetInfo(node.Left as CallNode).Function is AsTypeFunction)
            {
                return(IsValidCallNode(node.Left as CallNode, binding, metadata));
            }

            // We only allow dotted or firstname node on LHS for now, with exception of AsType.
            return(node.Left.Kind == NodeKind.FirstName);
        }