public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node) { if (node.Declaration.Variables.Count == 1) { IDSLHandler dsl = null; dsl = ctx_.CreateDSL(node.Declaration.Type.ToString()); if (dsl != null) { if (node.Declaration.Variables.Count != 1) { //td: error return(node); } var variable = node.Declaration.Variables[0]; DSLContext dctx = new DSLContext { MainNode = variable, Surroundings = DSLSurroundings.Code, Assign = false, ExtraMembers = members_ }; Debug.Assert(pending_ == null); pending_ = new ResolveDSLCode(dsl, ctx_, dctx); return(dsl.compile(ctx_, dctx)); } } return(base.VisitLocalDeclarationStatement(node)); }
private SyntaxNode rewriteInvocation(InvocationExpressionSyntax node, bool assign) { IDSLHandler dsl = ctx_.CreateDSL(node.Expression.ToString()); if (dsl != null) { DSLContext dctx = new DSLContext { MainNode = node, Surroundings = DSLSurroundings.Code, Assign = assign, ExtraMembers = members_ }; Debug.Assert(pending_ == null); pending_ = new ResolveDSLCode(dsl, ctx_, dctx); return(dsl.compile(ctx_, dctx)); } else if (node.ArgumentList.GetDiagnostics().Any()) { return(SyntaxFactory.InvocationExpression(node.Expression, (ArgumentListSyntax)Visit(node.ArgumentList))); } return(node); }