public override bool Visit(UnifiedLambda element, VisitorArgument arg)
 {
     element.Parameters.TryAccept(this, arg);
     Writer.Write(" => ");
     element.Body.Accept(this, arg);
     return true;
 }
 public override bool Visit(UnifiedLambda element, VisitorArgument arg)
 {
     element.Parameters.TryAccept(this, arg);
     Writer.Write(" => ");
     element.Body.Accept(this, arg);
     return(true);
 }
Beispiel #3
0
        public UnifiedElement VisitLambdaExpression(
            LambdaExpression lambda, object data)
        {
            var parameters = lambda.Parameters.AcceptVisitorAsParams(this, data);
            var body       = lambda.Body.TryAcceptForExpression(this).ToBlock();

            return(UnifiedLambda.Create(parameters: parameters, body: body));
        }
Beispiel #4
0
        public UnifiedElement VisitAnonymousMethodExpression(
            AnonymousMethodExpression expr, object data)
        {
            var parameters = expr.Parameters.AcceptVisitorAsParams(this, data);
            var body       = expr.Body.TryAcceptForExpression(this).ToBlock();

            return(UnifiedLambda.Create(parameters: parameters, body: body));
        }
Beispiel #5
0
 //ラムダ式(無名関数)
 public override bool Visit(UnifiedLambda element, VisitorArgument arg)
 {
     //λ式の場合、即時発火があり得るので全体を()で囲っておく
     WriteIndent(arg.IndentDepth);
     Writer.Write("(");
     Writer.Write("function ");
     //TODO ラムダ式は名前があるのかどうか確認
     element.Name.TryAccept(this, arg);
     element.Parameters.TryAccept(this, arg);
     element.Body.TryAccept(this, arg.Set(ForBlock));
     Writer.Write(")");
     return(element.Body == null);
 }
 //ラムダ式(無名関数)
 public override bool Visit(UnifiedLambda element, VisitorArgument arg)
 {
     //λ式の場合、即時発火があり得るので全体を()で囲っておく
     WriteIndent(arg.IndentDepth);
     Writer.Write("(");
     Writer.Write("function ");
     //TODO ラムダ式は名前があるのかどうか確認
     element.Name.TryAccept(this, arg);
     element.Parameters.TryAccept(this, arg);
     element.Body.TryAccept(this, arg.Set(ForBlock));
     Writer.Write(")");
     return element.Body == null;
 }