Exemplo n.º 1
0
        /// <remarks>
        /// Used to determine whether it would be appropriate to use the binder for the statement (if any).
        /// Not used to determine whether the position is syntactically within the statement.
        /// </remarks>
        internal static bool IsInCatchFilterScope(
            int position,
            CatchFilterClauseSyntax filterClause
            )
        {
            Debug.Assert(filterClause != null);

            return(IsBetweenTokens(
                       position,
                       filterClause.OpenParenToken,
                       filterClause.CloseParenToken
                       ));
        }
Exemplo n.º 2
0
 public override void VisitCatchFilterClause(CatchFilterClauseSyntax node)
 {
     // No variables can be defined in a filter atm. 
     // Note - this needs to be updated when declaration expressions are implemented.
 }
Exemplo n.º 3
0
        private BoundExpression BindCatchFilter(CatchFilterClauseSyntax filter, DiagnosticBag diagnostics)
        {
            BoundExpression boundFilter = this.BindBooleanExpression(filter.FilterExpression, diagnostics);
            if (boundFilter.ConstantValue != ConstantValue.NotAvailable)
            {
                Error(diagnostics, ErrorCode.WRN_FilterIsConstant, filter.FilterExpression);
            }

            boundFilter = new BoundSequencePointExpression(filter, boundFilter, boundFilter.Type);
            return boundFilter;
        }
Exemplo n.º 4
0
 public override void VisitCatchFilterClause(CatchFilterClauseSyntax node)
 {
     Visit(node.FilterExpression);
 }
            private IEnumerable<ITypeSymbol> InferTypeInCatchFilterClause(CatchFilterClauseSyntax catchFilterClause, SyntaxToken? previousToken = null)
            {
                // If we have a position, it has to be after "if ("
                if (previousToken.HasValue && previousToken.Value != catchFilterClause.OpenParenToken)
                {
                    return SpecializedCollections.EmptyEnumerable<ITypeSymbol>();
                }

                return SpecializedCollections.SingletonEnumerable(this.Compilation.GetSpecialType(SpecialType.System_Boolean));
            }
Exemplo n.º 6
0
        /// <remarks>
        /// Used to determine whether it would be appropriate to use the binder for the statement (if any).
        /// Not used to determine whether the position is syntactically within the statement.
        /// </remarks>
        internal static bool IsInCatchFilterScope(int position, CatchFilterClauseSyntax filterClause)
        {
            Debug.Assert(filterClause != null);

            return IsBetweenTokens(position, filterClause.OpenParenToken, filterClause.CloseParenToken);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitCatchFilterClause(CatchFilterClauseSyntax node)
 {
     this.OnNodeVisited(node, this.type.IsInstanceOfType(node));
     base.VisitCatchFilterClause(node);
 }
Exemplo n.º 8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitCatchFilterClause(CatchFilterClauseSyntax node)
 {
     this.OnNodeVisited(node);
     if (!this.traverseRootOnly) base.VisitCatchFilterClause(node);
 }
 //
 // Summary:
 //     Called when the visitor visits a CatchFilterClauseSyntax node.
 public virtual void VisitCatchFilterClause(CatchFilterClauseSyntax node);