Esempio n. 1
0
		public virtual void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)
		{
			DebugExpression(anonymousMethodExpression);
			var oldRef = currentMethodReference;
			currentMethodReference = new object();
			StartNode(anonymousMethodExpression);
			var builder = anonymousMethodExpression.Annotation<MethodDebugInfoBuilder>();
			if (builder != null)
				builder.StartPosition = writer.GetLocation();
			if (anonymousMethodExpression.IsAsync) {
				WriteKeyword(AnonymousMethodExpression.AsyncModifierRole);
				Space();
			}
			WriteKeyword(AnonymousMethodExpression.DelegateKeywordRole);
			if (anonymousMethodExpression.HasParameterList) {
				Space(policy.SpaceBeforeMethodDeclarationParentheses);
				WriteCommaSeparatedListInParenthesis(anonymousMethodExpression.Parameters, policy.SpaceWithinMethodDeclarationParentheses, CodeBracesRangeFlags.Parentheses);
			}
			anonymousMethodExpression.Body.AcceptVisitor(this);
			if (builder != null && builder.EndPosition == null)
				builder.EndPosition = writer.GetLocation();
			currentMethodReference = oldRef;
			EndNode(anonymousMethodExpression);
		}