Esempio n. 1
0
        static AnalyzerConfigOptionsWrapper()
        {
            WrappedType = WrapperHelper.GetWrappedType(typeof(AnalyzerConfigOptionsWrapper));

            KeyComparerAccessor = LightupHelpers.CreateStaticPropertyAccessor <StringComparer>(WrappedType, nameof(KeyComparer));
            TryGetValueAccessor = LightupHelpers.CreateTryGetValueAccessor <object, string, string>(WrappedType, typeof(string), nameof(TryGetValue));
        }
 static IObjectCreationOperationWrapper()
 {
     WrappedType         = WrapperHelper.GetWrappedType(typeof(IObjectCreationOperationWrapper));
     ConstructorAccessor = LightupHelpers.CreateOperationPropertyAccessor <IOperation, IMethodSymbol>(WrappedType, nameof(Constructor));
     InitializerAccessor = LightupHelpers.CreateOperationPropertyAccessor <IOperation, IOperation>(WrappedType, nameof(Initializer));
     ArgumentsAccessor   = LightupHelpers.CreateOperationListPropertyAccessor <IOperation>(WrappedType, nameof(Arguments));
 }
 static TupleElementSyntaxWrapper()
 {
     WrappedType            = WrapperHelper.GetWrappedType(typeof(TupleElementSyntaxWrapper));
     IdentifierAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(Identifier));
     TypeAccessor           = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, TypeSyntax>(WrappedType, nameof(Type));
     WithIdentifierAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(Identifier));
     WithTypeAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, TypeSyntax>(WrappedType, nameof(Type));
 }
 static DeclarationExpressionSyntaxWrapper()
 {
     WrappedType             = WrapperHelper.GetWrappedType(typeof(DeclarationExpressionSyntaxWrapper));
     TypeAccessor            = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, TypeSyntax>(WrappedType, nameof(Type));
     DesignationAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, CSharpSyntaxNode>(WrappedType, nameof(Designation));
     WithTypeAccessor        = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, TypeSyntax>(WrappedType, nameof(Type));
     WithDesignationAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, CSharpSyntaxNode>(WrappedType, nameof(Designation));
 }
Esempio n. 5
0
 static ThrowExpressionSyntaxWrapper()
 {
     WrappedType              = WrapperHelper.GetWrappedType(typeof(ThrowExpressionSyntaxWrapper));
     ThrowKeywordAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(ThrowKeyword));
     ExpressionAccessor       = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(Expression));
     WithThrowKeywordAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(ThrowKeyword));
     WithExpressionAccessor   = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(Expression));
 }
        static AnalyzerConfigOptionsProviderWrapper()
        {
            WrappedType = WrapperHelper.GetWrappedType(typeof(AnalyzerConfigOptionsProviderWrapper));

            GlobalOptionsAccessor            = LightupHelpers.CreateSyntaxPropertyAccessor <object, object>(WrappedType, nameof(GlobalOptions));
            GetOptionsSyntaxTreeAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <object, SyntaxTree, object>(WrappedType, typeof(SyntaxTree), nameof(GetOptions));
            GetOptionsAdditionalTextAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <object, AdditionalText, object>(WrappedType, typeof(AdditionalText), nameof(GetOptions));
        }
 static RefTypeSyntaxWrapper()
 {
     WrappedType            = WrapperHelper.GetWrappedType(typeof(RefTypeSyntaxWrapper));
     RefKeywordAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <TypeSyntax, SyntaxToken>(WrappedType, nameof(RefKeyword));
     TypeAccessor           = LightupHelpers.CreateSyntaxPropertyAccessor <TypeSyntax, TypeSyntax>(WrappedType, nameof(Type));
     WithRefKeywordAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <TypeSyntax, SyntaxToken>(WrappedType, nameof(RefKeyword));
     WithTypeAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <TypeSyntax, TypeSyntax>(WrappedType, nameof(Type));
 }
Esempio n. 8
0
 static WhenClauseSyntaxWrapper()
 {
     WrappedType             = WrapperHelper.GetWrappedType(typeof(WhenClauseSyntaxWrapper));
     WhenKeywordAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(WhenKeyword));
     ConditionAccessor       = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, ExpressionSyntax>(WrappedType, nameof(Condition));
     WithWhenKeywordAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(WhenKeyword));
     WithConditionAccessor   = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, ExpressionSyntax>(WrappedType, nameof(Condition));
 }
Esempio n. 9
0
        static SubpatternSyntaxWrapper()
        {
            WrappedType       = WrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper));
            NameColonAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, NameColonSyntax>(WrappedType, nameof(NameColon));
            PatternAccessor   = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Pattern));

            WithNameColonAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, NameColonSyntax>(WrappedType, nameof(NameColon));
            WithPatternAccessor   = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
        }
        static VarPatternSyntaxWrapper()
        {
            WrappedType         = WrapperHelper.GetWrappedType(typeof(VarPatternSyntaxWrapper));
            VarKeywordAccessor  = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(VarKeyword));
            DesignationAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Designation));

            WithVarKeywordAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(VarKeyword));
            WithDesignationAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Designation));
        }
 static TupleTypeSyntaxWrapper()
 {
     WrappedType                 = WrapperHelper.GetWrappedType(typeof(TupleTypeSyntaxWrapper));
     OpenParenTokenAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <TypeSyntax, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     ElementsAccessor            = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor <TypeSyntax, TupleElementSyntaxWrapper>(WrappedType, nameof(Elements));
     CloseParenTokenAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <TypeSyntax, SyntaxToken>(WrappedType, nameof(CloseParenToken));
     WithOpenParenTokenAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <TypeSyntax, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     WithElementsAccessor        = LightupHelpers.CreateSeparatedSyntaxListWithPropertyAccessor <TypeSyntax, TupleElementSyntaxWrapper>(WrappedType, nameof(Elements));
     WithCloseParenTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <TypeSyntax, SyntaxToken>(WrappedType, nameof(CloseParenToken));
 }
 static CommonForEachStatementSyntaxWrapper()
 {
     WrappedType             = WrapperHelper.GetWrappedType(typeof(CommonForEachStatementSyntaxWrapper));
     ForEachKeywordAccessor  = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(ForEachKeyword));
     OpenParenTokenAccessor  = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     InKeywordAccessor       = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(InKeyword));
     ExpressionAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, ExpressionSyntax>(WrappedType, nameof(Expression));
     CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(CloseParenToken));
     StatementAccessor       = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, StatementSyntax>(WrappedType, nameof(Statement));
 }
Esempio n. 13
0
 static CasePatternSwitchLabelSyntaxWrapper()
 {
     WrappedType            = WrapperHelper.GetWrappedType(typeof(CasePatternSwitchLabelSyntaxWrapper));
     PatternAccessor        = LightupHelpers.CreateSyntaxPropertyAccessor <SwitchLabelSyntax, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
     WhenClauseAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <SwitchLabelSyntax, CSharpSyntaxNode>(WrappedType, nameof(WhenClause));
     WithKeywordAccessor    = LightupHelpers.CreateSyntaxWithPropertyAccessor <SwitchLabelSyntax, SyntaxToken>(WrappedType, nameof(SwitchLabelSyntax.Keyword));
     WithColonTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <SwitchLabelSyntax, SyntaxToken>(WrappedType, nameof(SwitchLabelSyntax.ColonToken));
     WithPatternAccessor    = LightupHelpers.CreateSyntaxWithPropertyAccessor <SwitchLabelSyntax, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
     WithWhenClauseAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <SwitchLabelSyntax, CSharpSyntaxNode>(WrappedType, nameof(WhenClause));
 }
 static IsPatternExpressionSyntaxWrapper()
 {
     WrappedType            = WrapperHelper.GetWrappedType(typeof(IsPatternExpressionSyntaxWrapper));
     ExpressionAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(Expression));
     IsKeywordAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(IsKeyword));
     PatternAccessor        = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
     WithExpressionAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(Expression));
     WithIsKeywordAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(IsKeyword));
     WithPatternAccessor    = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
 }
Esempio n. 15
0
 static ParenthesizedVariableDesignationSyntaxWrapper()
 {
     WrappedType                 = WrapperHelper.GetWrappedType(typeof(ParenthesizedVariableDesignationSyntaxWrapper));
     OpenParenTokenAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     VariablesAccessor           = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor <CSharpSyntaxNode, VariableDesignationSyntaxWrapper>(WrappedType, nameof(Variables));
     CloseParenTokenAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(CloseParenToken));
     WithOpenParenTokenAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     WithVariablesAccessor       = LightupHelpers.CreateSeparatedSyntaxListWithPropertyAccessor <CSharpSyntaxNode, VariableDesignationSyntaxWrapper>(WrappedType, nameof(Variables));
     WithCloseParenTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(CloseParenToken));
 }
 static TupleExpressionSyntaxWrapper()
 {
     WrappedType                 = WrapperHelper.GetWrappedType(typeof(TupleExpressionSyntaxWrapper));
     OpenParenTokenAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     ArgumentsAccessor           = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SeparatedSyntaxList <ArgumentSyntax> >(WrappedType, nameof(Arguments));
     CloseParenTokenAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(CloseParenToken));
     WithOpenParenTokenAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     WithArgumentsAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SeparatedSyntaxList <ArgumentSyntax> >(WrappedType, nameof(Arguments));
     WithCloseParenTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(CloseParenToken));
 }
        static PositionalPatternClauseSyntaxWrapper()
        {
            WrappedType             = WrapperHelper.GetWrappedType(typeof(PositionalPatternClauseSyntaxWrapper));
            OpenParenTokenAccessor  = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(OpenParenToken));
            SubpatternsAccessor     = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor <CSharpSyntaxNode, SubpatternSyntaxWrapper>(WrappedType, nameof(Subpatterns));
            CloseParenTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(CloseParenToken));

            WithOpenParenTokenAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(OpenParenToken));
            WithSubpatternsAccessor     = LightupHelpers.CreateSeparatedSyntaxListWithPropertyAccessor <CSharpSyntaxNode, SubpatternSyntaxWrapper>(WrappedType, nameof(Subpatterns));
            WithCloseParenTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(CloseParenToken));
        }
Esempio n. 18
0
        static RangeExpressionSyntaxWrapper()
        {
            WrappedType           = WrapperHelper.GetWrappedType(typeof(RangeExpressionSyntaxWrapper));
            LeftOperandAccessor   = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(LeftOperand));
            OperatorTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OperatorToken));
            RightOperandAccessor  = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(RightOperand));

            WithLeftOperandAccessor   = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(LeftOperand));
            WithOperatorTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OperatorToken));
            WithRightOperandAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(RightOperand));
        }
Esempio n. 19
0
 static ImplicitStackAllocArrayCreationExpressionSyntaxWrapper()
 {
     WrappedType = WrapperHelper.GetWrappedType(typeof(ImplicitStackAllocArrayCreationExpressionSyntaxWrapper));
     StackAllocKeywordAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(StackAllocKeyword));
     OpenBracketTokenAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OpenBracketToken));
     CloseBracketTokenAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(CloseBracketToken));
     InitializerAccessor           = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, InitializerExpressionSyntax>(WrappedType, nameof(Initializer));
     WithStackAllocKeywordAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(StackAllocKeyword));
     WithOpenBracketTokenAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OpenBracketToken));
     WithCloseBracketTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(CloseBracketToken));
     WithInitializerAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, InitializerExpressionSyntax>(WrappedType, nameof(Initializer));
 }
 static ForEachVariableStatementSyntaxWrapper()
 {
     WrappedType                 = WrapperHelper.GetWrappedType(typeof(ForEachVariableStatementSyntaxWrapper));
     VariableAccessor            = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, ExpressionSyntax>(WrappedType, nameof(Variable));
     WithForEachKeywordAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(ForEachKeyword));
     WithOpenParenTokenAccessor  = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(OpenParenToken));
     WithVariableAccessor        = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, ExpressionSyntax>(WrappedType, nameof(Variable));
     WithInKeywordAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(InKeyword));
     WithExpressionAccessor      = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, ExpressionSyntax>(WrappedType, nameof(Expression));
     WithCloseParenTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(CloseParenToken));
     WithStatementAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, StatementSyntax>(WrappedType, nameof(Statement));
 }
        static SwitchExpressionArmSyntaxWrapper()
        {
            WrappedType                    = WrapperHelper.GetWrappedType(typeof(SwitchExpressionArmSyntaxWrapper));
            PatternAccessor                = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
            WhenClauseAccessor             = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(WhenClause));
            ExpressionAccessor             = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, ExpressionSyntax>(WrappedType, nameof(Expression));
            EqualsGreaterThanTokenAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(EqualsGreaterThanToken));

            WithPatternAccessor                = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Pattern));
            WithWhenClauseAccessor             = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(WhenClause));
            WithExpressionAccessor             = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, ExpressionSyntax>(WrappedType, nameof(Expression));
            WithEqualsGreaterThanTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(EqualsGreaterThanToken));
        }
        static RecursivePatternSyntaxWrapper()
        {
            WrappedType  = WrapperHelper.GetWrappedType(typeof(RecursivePatternSyntaxWrapper));
            TypeAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, TypeSyntax>(WrappedType, nameof(Type));
            PositionalPatternClauseAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(PositionalPatternClause));
            PropertyPatternClauseAccessor   = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(PropertyPatternClause));
            DesignationAccessor             = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Designation));

            WithTypeAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, TypeSyntax>(WrappedType, nameof(Type));
            WithPositionalPatternClauseAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(PositionalPatternClause));
            WithPropertyPatternClauseAccessor   = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(PropertyPatternClause));
            WithDesignationAccessor             = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, CSharpSyntaxNode>(WrappedType, nameof(Designation));
        }
        static SwitchExpressionSyntaxWrapper()
        {
            WrappedType  = WrapperHelper.GetWrappedType(typeof(SwitchExpressionSyntaxWrapper));
            ArmsAccessor = LightupHelpers.CreateSeparatedSyntaxListPropertyAccessor <ExpressionSyntax, SwitchExpressionArmSyntaxWrapper>(WrappedType, nameof(Arms));
            GoverningExpressionAccessor = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(GoverningExpression));
            OpenBraceTokenAccessor      = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OpenBraceToken));
            SwitchKeywordAccessor       = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(SwitchKeyword));
            CloseBraceTokenAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(CloseBraceToken));

            WithArmsAccessor = LightupHelpers.CreateSeparatedSyntaxListWithPropertyAccessor <ExpressionSyntax, SwitchExpressionArmSyntaxWrapper>(WrappedType, nameof(Arms));
            WithGoverningExpressionAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, ExpressionSyntax>(WrappedType, nameof(GoverningExpression));
            WithOpenBraceTokenAccessor      = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(OpenBraceToken));
            WithSwitchKeywordAccessor       = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(SwitchKeyword));
            WithCloseBraceTokenAccessor     = LightupHelpers.CreateSyntaxWithPropertyAccessor <ExpressionSyntax, SyntaxToken>(WrappedType, nameof(CloseBraceToken));
        }
Esempio n. 24
0
 static LocalFunctionStatementSyntaxWrapper()
 {
     WrappedType                   = WrapperHelper.GetWrappedType(typeof(LocalFunctionStatementSyntaxWrapper));
     ModifiersAccessor             = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxTokenList>(WrappedType, nameof(Modifiers));
     ReturnTypeAccessor            = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, TypeSyntax>(WrappedType, nameof(ReturnType));
     IdentifierAccessor            = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(Identifier));
     TypeParameterListAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, TypeParameterListSyntax>(WrappedType, nameof(TypeParameterList));
     ParameterListAccessor         = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, ParameterListSyntax>(WrappedType, nameof(ParameterList));
     ConstraintClausesAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxList <TypeParameterConstraintClauseSyntax> >(WrappedType, nameof(ConstraintClauses));
     BodyAccessor                  = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, BlockSyntax>(WrappedType, nameof(Body));
     ExpressionBodyAccessor        = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, ArrowExpressionClauseSyntax>(WrappedType, nameof(ExpressionBody));
     SemicolonTokenAccessor        = LightupHelpers.CreateSyntaxPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(SemicolonToken));
     WithModifiersAccessor         = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxTokenList>(WrappedType, nameof(Modifiers));
     WithReturnTypeAccessor        = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, TypeSyntax>(WrappedType, nameof(ReturnType));
     WithIdentifierAccessor        = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(Identifier));
     WithTypeParameterListAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, TypeParameterListSyntax>(WrappedType, nameof(TypeParameterList));
     WithParameterListAccessor     = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, ParameterListSyntax>(WrappedType, nameof(ParameterList));
     WithConstraintClausesAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxList <TypeParameterConstraintClauseSyntax> >(WrappedType, nameof(ConstraintClauses));
     WithBodyAccessor              = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, BlockSyntax>(WrappedType, nameof(Body));
     WithExpressionBodyAccessor    = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, ArrowExpressionClauseSyntax>(WrappedType, nameof(ExpressionBody));
     WithSemicolonTokenAccessor    = LightupHelpers.CreateSyntaxWithPropertyAccessor <StatementSyntax, SyntaxToken>(WrappedType, nameof(SemicolonToken));
 }
Esempio n. 25
0
 static PatternSyntaxWrapper()
 {
     WrappedType = WrapperHelper.GetWrappedType(typeof(PatternSyntaxWrapper));
 }
 static DiscardDesignationSyntaxWrapper()
 {
     WrappedType                 = WrapperHelper.GetWrappedType(typeof(DiscardDesignationSyntaxWrapper));
     UnderscoreTokenAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(UnderscoreToken));
     WithUnderscoreTokenAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(UnderscoreToken));
 }
 static ConstantPatternSyntaxWrapper()
 {
     WrappedType            = WrapperHelper.GetWrappedType(typeof(ConstantPatternSyntaxWrapper));
     ExpressionAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, ExpressionSyntax>(WrappedType, nameof(Expression));
     WithExpressionAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, ExpressionSyntax>(WrappedType, nameof(Expression));
 }
 static IObjectOrCollectionInitializerOperationWrapper()
 {
     WrappedType          = WrapperHelper.GetWrappedType(typeof(IObjectOrCollectionInitializerOperationWrapper));
     InitializersAccessor = LightupHelpers.CreateOperationPropertyAccessor <IOperation, ImmutableArray <IOperation> >(WrappedType, nameof(Initializers));
 }
        static SyntaxFactoryEx()
        {
            var positionalPatternClauseMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(PositionalPatternClause));
            var positionalPatternClauseMethod  = positionalPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList <>).MakeGenericType(WrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper))));

            if (positionalPatternClauseMethod is object)
            {
                var subpatternsParameter   = Expression.Parameter(typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>), "subpatterns");
                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper> .UnderlyingList));
                Expression <Func <SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, CSharpSyntaxNode> > expression =
                    Expression.Lambda <Func <SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, CSharpSyntaxNode> >(
                        Expression.Call(
                            positionalPatternClauseMethod,
                            Expression.Convert(
                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),
                                positionalPatternClauseMethod.GetParameters()[0].ParameterType)),
                        subpatternsParameter);
                PositionalPatternClauseAccessor1 = expression.Compile();
            }
            else
            {
                PositionalPatternClauseAccessor1 = ThrowNotSupportedOnFallback <SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(PositionalPatternClause));
            }

            positionalPatternClauseMethod = positionalPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 3 &&
                                                                                          method.GetParameters()[0].ParameterType == typeof(SyntaxToken) &&
                                                                                          method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList <>).MakeGenericType(WrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper))) &&
                                                                                          method.GetParameters()[2].ParameterType == typeof(SyntaxToken));
            if (positionalPatternClauseMethod is object)
            {
                var openParenTokenParameter  = Expression.Parameter(typeof(SyntaxToken), "openParenToken");
                var subpatternsParameter     = Expression.Parameter(typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>), "subpatterns");
                var closeParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), "closeParenToken");

                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper> .UnderlyingList));

                Expression <Func <SyntaxToken, SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode> > expression =
                    Expression.Lambda <Func <SyntaxToken, SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode> >(
                        Expression.Call(
                            positionalPatternClauseMethod,
                            openParenTokenParameter,
                            Expression.Convert(
                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),
                                positionalPatternClauseMethod.GetParameters()[1].ParameterType),
                            closeParenTokenParameter),
                        openParenTokenParameter,
                        subpatternsParameter,
                        closeParenTokenParameter);
                PositionalPatternClauseAccessor2 = expression.Compile();
            }
            else
            {
                PositionalPatternClauseAccessor2 = ThrowNotSupportedOnFallback <SyntaxToken, SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, SyntaxToken, TypeSyntax>(nameof(SyntaxFactory), nameof(PositionalPatternClause));
            }

            var propertyPatternClauseMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(PropertyPatternClause));
            var propertyPatternClauseMethod  = propertyPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList <>).MakeGenericType(WrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper))));

            if (propertyPatternClauseMethod is object)
            {
                var subpatternsParameter   = Expression.Parameter(typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>), "subpatterns");
                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper> .UnderlyingList));
                Expression <Func <SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, CSharpSyntaxNode> > expression =
                    Expression.Lambda <Func <SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, CSharpSyntaxNode> >(
                        Expression.Call(
                            propertyPatternClauseMethod,
                            Expression.Convert(
                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),
                                propertyPatternClauseMethod.GetParameters()[0].ParameterType)),
                        subpatternsParameter);
                PropertyPatternClauseAccessor1 = expression.Compile();
            }
            else
            {
                PropertyPatternClauseAccessor1 = ThrowNotSupportedOnFallback <SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(PropertyPatternClause));
            }

            propertyPatternClauseMethod = propertyPatternClauseMethods.FirstOrDefault(method => method.GetParameters().Length == 3 &&
                                                                                      method.GetParameters()[0].ParameterType == typeof(SyntaxToken) &&
                                                                                      method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList <>).MakeGenericType(WrapperHelper.GetWrappedType(typeof(SubpatternSyntaxWrapper))) &&
                                                                                      method.GetParameters()[2].ParameterType == typeof(SyntaxToken));
            if (propertyPatternClauseMethod is object)
            {
                var openBraceTokenParameter  = Expression.Parameter(typeof(SyntaxToken), "openBraceToken");
                var subpatternsParameter     = Expression.Parameter(typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>), "subpatterns");
                var closeBraceTokenParameter = Expression.Parameter(typeof(SyntaxToken), "closeBraceToken");

                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper> .UnderlyingList));

                Expression <Func <SyntaxToken, SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode> > expression =
                    Expression.Lambda <Func <SyntaxToken, SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, SyntaxToken, CSharpSyntaxNode> >(
                        Expression.Call(
                            propertyPatternClauseMethod,
                            openBraceTokenParameter,
                            Expression.Convert(
                                Expression.Call(subpatternsParameter, underlyingListProperty.GetMethod),
                                propertyPatternClauseMethod.GetParameters()[1].ParameterType),
                            closeBraceTokenParameter),
                        openBraceTokenParameter,
                        subpatternsParameter,
                        closeBraceTokenParameter);
                PropertyPatternClauseAccessor2 = expression.Compile();
            }
            else
            {
                PropertyPatternClauseAccessor2 = ThrowNotSupportedOnFallback <SyntaxToken, SeparatedSyntaxListWrapper <SubpatternSyntaxWrapper>, SyntaxToken, TypeSyntax>(nameof(SyntaxFactory), nameof(PropertyPatternClause));
            }

            var tupleElementMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(TupleElement));
            var tupleElementMethod  = tupleElementMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(TypeSyntax));

            if (tupleElementMethod is object)
            {
                var typeParameter = Expression.Parameter(typeof(TypeSyntax), "type");
                Expression <Func <TypeSyntax, CSharpSyntaxNode> > expression =
                    Expression.Lambda <Func <TypeSyntax, CSharpSyntaxNode> >(
                        Expression.Call(tupleElementMethod, typeParameter),
                        typeParameter);
                TupleElementAccessor1 = expression.Compile();
            }
            else
            {
                TupleElementAccessor1 = ThrowNotSupportedOnFallback <TypeSyntax, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(TupleElement));
            }

            tupleElementMethod = tupleElementMethods.FirstOrDefault(method => method.GetParameters().Length == 2 && method.GetParameters()[0].ParameterType == typeof(TypeSyntax) && method.GetParameters()[1].ParameterType == typeof(SyntaxToken));
            if (tupleElementMethod is object)
            {
                var typeParameter       = Expression.Parameter(typeof(TypeSyntax), "type");
                var identifierParameter = Expression.Parameter(typeof(SyntaxToken), "identifier");
                Expression <Func <TypeSyntax, SyntaxToken, CSharpSyntaxNode> > expression =
                    Expression.Lambda <Func <TypeSyntax, SyntaxToken, CSharpSyntaxNode> >(
                        Expression.Call(tupleElementMethod, typeParameter, identifierParameter),
                        typeParameter,
                        identifierParameter);
                TupleElementAccessor2 = expression.Compile();
            }
            else
            {
                TupleElementAccessor2 = ThrowNotSupportedOnFallback <TypeSyntax, SyntaxToken, CSharpSyntaxNode>(nameof(SyntaxFactory), nameof(TupleElement));
            }

            var tupleExpressionMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(TupleExpression));
            var tupleExpressionMethod  = tupleExpressionMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList <ArgumentSyntax>));

            if (tupleExpressionMethod is object)
            {
                var argumentsParameter = Expression.Parameter(typeof(SeparatedSyntaxList <ArgumentSyntax>), "arguments");
                Expression <Func <SeparatedSyntaxList <ArgumentSyntax>, ExpressionSyntax> > expression =
                    Expression.Lambda <Func <SeparatedSyntaxList <ArgumentSyntax>, ExpressionSyntax> >(
                        Expression.Call(tupleExpressionMethod, argumentsParameter),
                        argumentsParameter);
                TupleExpressionAccessor1 = expression.Compile();
            }
            else
            {
                TupleExpressionAccessor1 = ThrowNotSupportedOnFallback <SeparatedSyntaxList <ArgumentSyntax>, ExpressionSyntax>(nameof(SyntaxFactory), nameof(TupleExpression));
            }

            tupleExpressionMethod = tupleExpressionMethods.FirstOrDefault(method => method.GetParameters().Length == 3 &&
                                                                          method.GetParameters()[0].ParameterType == typeof(SyntaxToken) &&
                                                                          method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList <ArgumentSyntax>) &&
                                                                          method.GetParameters()[2].ParameterType == typeof(SyntaxToken));
            if (tupleExpressionMethod is object)
            {
                var openParenTokenParameter  = Expression.Parameter(typeof(SyntaxToken), "openParenToken");
                var argumentsParameter       = Expression.Parameter(typeof(SeparatedSyntaxList <ArgumentSyntax>), "arguments");
                var closeParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), "closeParenToken");
                Expression <Func <SyntaxToken, SeparatedSyntaxList <ArgumentSyntax>, SyntaxToken, ExpressionSyntax> > expression =
                    Expression.Lambda <Func <SyntaxToken, SeparatedSyntaxList <ArgumentSyntax>, SyntaxToken, ExpressionSyntax> >(
                        Expression.Call(tupleExpressionMethod, openParenTokenParameter, argumentsParameter, closeParenTokenParameter),
                        openParenTokenParameter,
                        argumentsParameter,
                        closeParenTokenParameter);
                TupleExpressionAccessor2 = expression.Compile();
            }
            else
            {
                TupleExpressionAccessor2 = ThrowNotSupportedOnFallback <SyntaxToken, SeparatedSyntaxList <ArgumentSyntax>, SyntaxToken, ExpressionSyntax>(nameof(SyntaxFactory), nameof(TupleExpression));
            }

            var tupleTypeMethods = typeof(SyntaxFactory).GetTypeInfo().GetDeclaredMethods(nameof(TupleType));
            var tupleTypeMethod  = tupleTypeMethods.FirstOrDefault(method => method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(SeparatedSyntaxList <>).MakeGenericType(WrapperHelper.GetWrappedType(typeof(TupleElementSyntaxWrapper))));

            if (tupleTypeMethod is object)
            {
                var elementsParameter      = Expression.Parameter(typeof(SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>), "elements");
                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper> .UnderlyingList));
                Expression <Func <SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>, TypeSyntax> > expression =
                    Expression.Lambda <Func <SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>, TypeSyntax> >(
                        Expression.Call(
                            tupleTypeMethod,
                            Expression.Convert(
                                Expression.Call(elementsParameter, underlyingListProperty.GetMethod),
                                tupleTypeMethod.GetParameters()[0].ParameterType)),
                        elementsParameter);
                TupleTypeAccessor1 = expression.Compile();
            }
            else
            {
                TupleTypeAccessor1 = ThrowNotSupportedOnFallback <SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>, TypeSyntax>(nameof(SyntaxFactory), nameof(TupleType));
            }

            tupleTypeMethod = tupleTypeMethods.FirstOrDefault(method => method.GetParameters().Length == 3 &&
                                                              method.GetParameters()[0].ParameterType == typeof(SyntaxToken) &&
                                                              method.GetParameters()[1].ParameterType == typeof(SeparatedSyntaxList <>).MakeGenericType(WrapperHelper.GetWrappedType(typeof(TupleElementSyntaxWrapper))) &&
                                                              method.GetParameters()[2].ParameterType == typeof(SyntaxToken));
            if (tupleTypeMethod is object)
            {
                var openParenTokenParameter  = Expression.Parameter(typeof(SyntaxToken), "openParenToken");
                var elementsParameter        = Expression.Parameter(typeof(SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>), "elements");
                var closeParenTokenParameter = Expression.Parameter(typeof(SyntaxToken), "closeParenToken");

                var underlyingListProperty = typeof(SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>).GetTypeInfo().GetDeclaredProperty(nameof(SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper> .UnderlyingList));

                Expression <Func <SyntaxToken, SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax> > expression =
                    Expression.Lambda <Func <SyntaxToken, SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax> >(
                        Expression.Call(
                            tupleTypeMethod,
                            openParenTokenParameter,
                            Expression.Convert(
                                Expression.Call(elementsParameter, underlyingListProperty.GetMethod),
                                tupleTypeMethod.GetParameters()[1].ParameterType),
                            closeParenTokenParameter),
                        openParenTokenParameter,
                        elementsParameter,
                        closeParenTokenParameter);
                TupleTypeAccessor2 = expression.Compile();
            }
            else
            {
                TupleTypeAccessor2 = ThrowNotSupportedOnFallback <SyntaxToken, SeparatedSyntaxListWrapper <TupleElementSyntaxWrapper>, SyntaxToken, TypeSyntax>(nameof(SyntaxFactory), nameof(TupleType));
            }
        }
Esempio n. 30
0
 static SingleVariableDesignationSyntaxWrapper()
 {
     WrappedType            = WrapperHelper.GetWrappedType(typeof(SingleVariableDesignationSyntaxWrapper));
     IdentifierAccessor     = LightupHelpers.CreateSyntaxPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(Identifier));
     WithIdentifierAccessor = LightupHelpers.CreateSyntaxWithPropertyAccessor <CSharpSyntaxNode, SyntaxToken>(WrappedType, nameof(Identifier));
 }