diff --git a/Shared/Globals.cs b/Shared/Globals.cs index 6a2c811..41093e0 100644 --- a/Shared/Globals.cs +++ b/Shared/Globals.cs @@ -12,6 +12,8 @@ public static class FormatterNames { public const string VisualBasic = "Visual Basic"; public const string FactoryMethods = "Factory methods"; public const string ObjectNotation = "Object notation"; + public const string DebugView = "DebugView"; + public const string ToStringName = "ToString"; } public static class Globals { diff --git a/Shared/Util/Functions.cs b/Shared/Util/Functions.cs index 308a17a..ab020cb 100644 --- a/Shared/Util/Functions.cs +++ b/Shared/Util/Functions.cs @@ -297,5 +297,7 @@ public static object ResolvePath(object o, string path) { } return o; } + + public static string NewLines(int count = 2) => Enumerable.Repeat(Environment.NewLine, count).Joined(""); } } diff --git a/Tests.Common/CompilerGenerated/Binary.cs b/Tests.Common/CompilerGenerated/Binary.cs index fae7b89..5317556 100644 --- a/Tests.Common/CompilerGenerated/Binary.cs +++ b/Tests.Common/CompilerGenerated/Binary.cs @@ -5,16 +5,7 @@ namespace ExpressionToString.Tests { public partial class CompilerGeneratedBase { [Fact] [Trait("Category", Binary)] - public void Add() { - double x = 0, y = 0; - RunTest( - () => x + y, - "() => x + y", - "Function() x + y", - @"Lambda( - Add(x, y) -)"); - } + public void Add() => PreRunTest(); [Fact] [Trait("Category", Binary)] diff --git a/Tests.Common/CompilerGenerated/Default.cs b/Tests.Common/CompilerGenerated/Default.cs index 381b494..24444d7 100644 --- a/Tests.Common/CompilerGenerated/Default.cs +++ b/Tests.Common/CompilerGenerated/Default.cs @@ -1,12 +1,13 @@ using Xunit; using static ExpressionToString.Tests.Categories; +using ExpressionToString.Tests.Objects; namespace ExpressionToString.Tests { public partial class CompilerGeneratedBase { [Fact] [Trait("Category", Defaults)] public void DefaultRefType() => RunTest( - () => default(string), + CSCompiler.DefaultRefType, "() => null", "Function() Nothing", @"Lambda( @@ -19,7 +20,7 @@ public void DefaultRefType() => RunTest( [Fact] [Trait("Category", Defaults)] public void DefaultValueType() => RunTest( - () => default(int), + CSCompiler.DefaultValueType, "() => 0", "Function() 0", @"Lambda( diff --git a/Tests.Common/CompilerGenerated/Indexer.cs b/Tests.Common/CompilerGenerated/Indexer.cs index f15c30f..3dffca5 100644 --- a/Tests.Common/CompilerGenerated/Indexer.cs +++ b/Tests.Common/CompilerGenerated/Indexer.cs @@ -1,15 +1,16 @@ using System.Collections.Generic; using Xunit; using static ExpressionToString.Tests.Categories; +using ExpressionToString.Tests.Objects; namespace ExpressionToString.Tests { public partial class CompilerGeneratedBase { [Fact] [Trait("Category",Indexer)] public void ArraySingleIndex() { - var arr = new string[] { }; + //var arr = new string[] { }; RunTest( - () => arr[5], + CSCompiler.ArraySingleIndex, "() => arr[5]", "Function() arr(5)", @"Lambda( @@ -23,9 +24,9 @@ public void ArraySingleIndex() { [Fact] [Trait("Category", Indexer)] public void ArrayMultipleIndex() { - var arr = new string[,] { }; + //var arr = new string[,] { }; RunTest( - () => arr[5, 6], + CSCompiler.ArrayMultipleIndex, "() => arr[5, 6]", "Function() arr(5, 6)", @"Lambda( @@ -40,9 +41,9 @@ public void ArrayMultipleIndex() { [Fact] [Trait("Category", Indexer)] public void TypeIndexer() { - var lst = new List(); + //var lst = new List(); RunTest( - () => lst[3], + CSCompiler.TypeIndexer, "() => lst[3]", "Function() lst(3)", @"Lambda( diff --git a/Tests.Common/CompilerGenerated/Member.cs b/Tests.Common/CompilerGenerated/Member.cs index 1848dbf..3b98444 100644 --- a/Tests.Common/CompilerGenerated/Member.cs +++ b/Tests.Common/CompilerGenerated/Member.cs @@ -1,14 +1,15 @@ using Xunit; using static ExpressionToString.Tests.Categories; +using ExpressionToString.Tests.Objects; namespace ExpressionToString.Tests { public partial class CompilerGeneratedBase { [Fact] [Trait("Category", Member)] public void InstanceMember() { - var s = ""; + //var s = ""; RunTest( - () => s.Length, + CSCompiler.InstanceMember, "() => s.Length", "Function() s.Length", @"Lambda( @@ -22,9 +23,9 @@ public void InstanceMember() { [Fact] [Trait("Category", Member)] public void ClosedVariable() { - var s = ""; + //var s = ""; RunTest( - () => s, + CSCompiler.ClosedVariable, "() => s", "Function() s", "Lambda(s)" @@ -34,7 +35,7 @@ public void ClosedVariable() { [Fact] [Trait("Category", Member)] public void StaticMember() => RunTest( - () => string.Empty, + CSCompiler.StaticMember, "() => string.Empty", "Function() String.Empty", @"Lambda( diff --git a/Tests.Common/CompilerGenerated/Misc.cs b/Tests.Common/CompilerGenerated/Misc.cs index fafaa10..20b5abf 100644 --- a/Tests.Common/CompilerGenerated/Misc.cs +++ b/Tests.Common/CompilerGenerated/Misc.cs @@ -1,13 +1,14 @@ using System; using Xunit; using static ExpressionToString.Tests.Categories; +using ExpressionToString.Tests.Objects; namespace ExpressionToString.Tests { public partial class CompilerGeneratedBase { [Fact] [Trait("Category", Conditionals)] public void Conditional() => RunTest( - (int i) => i > 10 ? i : i + 10, + CSCompiler.Conditional, "(int i) => i > 10 ? i : i + 10", "Function(i As Integer) If(i > 10, i, i + 10)", @"Lambda( @@ -29,9 +30,9 @@ public void Conditional() => RunTest( [Fact] public void TypeCheck() { - object o = ""; + //object o = ""; RunTest( - () => o is string, + CSCompiler.TypeCheck, "() => o is string", "Function() TypeOf o Is String", @"Lambda( @@ -45,9 +46,9 @@ public void TypeCheck() { [Fact] [Trait("Category", Invocation)] public void InvocationNoArguments() { - Func del = () => DateTime.Now.Day; + //Func del = () => DateTime.Now.Day; RunTest( - () => del(), + CSCompiler.InvocationNoArguments, "() => del()", "Function() del()", @"Lambda( @@ -59,9 +60,9 @@ public void InvocationNoArguments() { [Fact] [Trait("Category", Invocation)] public void InvocationOneArgument() { - Func del = (int i) => DateTime.Now.Day; + //Func del = (int i) => DateTime.Now.Day; RunTest( - () => del(5), + CSCompiler.InvocationOneArgument, "() => del(5)", "Function() del(5)", @"Lambda( diff --git a/Tests.Common/FormatterData.cs b/Tests.Common/FormatterData.cs new file mode 100644 index 0000000..e569c25 --- /dev/null +++ b/Tests.Common/FormatterData.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Xunit.Sdk; + +namespace Tests.Common { + public class FormatterData : DataAttribute { + private readonly string _fromatter; + + public FormatterData(string Formatter) { + _fromatter = Formatter; + } + + public override IEnumerable GetData(MethodInfo testMethod) { + // resolve path from current dll + formatter name + + // parse file + // for each line in File.ReadAllLines(path) + // if line.StartsWith("---") - new test + // (test name embedded in ---- lines) + // add to TheoryData + // expression name + // formatter name + // result + + // return TheoryData + + throw new NotImplementedException(); + } + } +} +/* +test objects + namespace: ExpressionToString.Tests.Objects + ExpressionToString.Tests.Common + CSCompiler + FactoryMethods + ExpressionToString.Tests.Common.VB + VBCompiler + spread across partial static classes/modules, based on category + decorate with category custom attribute + +base abstract class + overridable RunTest + parameters - object to test, object name + protected PreRunTest + parameters - caller member name + resolve object from type of 'this' and member name + calls RunTest with object, object name + +three abstract classes, by source + decorate class with source trait + each one spread across multiple files, using partial + each test method + decorate with category trait + corresponds to expression object + calls PreRunTest + +formatter tests + static dictionary with results + for each registered formatter, load from files + inherits three abstract classes + RunTest calls static RunToStringTest, passing in object name and object + + get results + pathspans from ToString("Factory methods") + + for each formatter + get expected using the formatter and the object name as a multipart key, against the static dictionary + get actual using ToString(formatter) on the object + if formatter == factory methods, use above + Assert.Equals + + do pathspans checks against factory methods pathspans + +visualizer data tests + inherits three abstract classes + RunTest calls static VisualizerDataTest, passing in object + static method creaates new VisualizerData from object + +validation of test methods vs expressions - each expression object must have a corresponding test method + +*/ diff --git a/Tests.Common/Functions.cs b/Tests.Common/Functions.cs new file mode 100644 index 0000000..99af698 --- /dev/null +++ b/Tests.Common/Functions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace ExpressionToString.Tests { + public static class Functions { + public static Expression Expr(Expression> expr) => expr; + public static Expression Expr(Expression> expr) => expr; + public static T IIFE(Func fn) => fn(); + public static string GetFullFilename(string filename) { + string executable = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath; + return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(executable), filename)); + } + } +} diff --git a/Tests.Common/Objects/CSCompiler/Binary.cs b/Tests.Common/Objects/CSCompiler/Binary.cs new file mode 100644 index 0000000..f42a688 --- /dev/null +++ b/Tests.Common/Objects/CSCompiler/Binary.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static ExpressionToString.Tests.Functions; +using static ExpressionToString.Tests.Categories; +using System.Linq.Expressions; +using ExpressionToString.Tests.Objects; + +namespace ExpressionToString.Tests.Objects { + partial class CSCompiler { + [Category(Binary)] + public static readonly Expression Add = IIFE(() => { + double x = 0, y = 0; + return Expr(() => x + y); + }); + + [Category(Binary)] + public static readonly Expression Divide = IIFE(() => { + double x = 0, y = 0; + return Expr(() => x / y); + }); + + [Category(Binary)] + public static readonly Expression Modulo = IIFE(() => { + double x = 0, y = 0; + return Expr(() => x % y); + }); + + [Category(Binary)] + public static readonly Expression Multiply = IIFE(() => { + double x = 0, y = 0; + return Expr(() => x * y); + }); + + [Category(Binary)] + public static readonly Expression Subtract = IIFE(() => { + double x = 0, y = 0; + return Expr(() => x - y); + }); + + [Category(Binary)] + public static readonly Expression AndBitwise = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i & j); + }); + + [Category(Binary)] + public static readonly Expression OrBitwise = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i | j); + }); + + [Category(Binary)] + public static readonly Expression ExclusiveOrBitwise = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i ^ j); + }); + + [Category(Binary)] + public static readonly Expression AndLogical = IIFE(() => { + bool b1 = true, b2 = true; + return Expr(() => b1 & b2); + }); + + [Category(Binary)] + public static readonly Expression OrLogical = IIFE(() => { + bool b1 = true, b2 = true; + return Expr(() => b1 | b2); + }); + + [Category(Binary)] + public static readonly Expression ExclusiveOrLogical = IIFE(() => { + bool b1 = true, b2 = true; + return Expr(() => b1 ^ b2); + }); + + [Category(Binary)] + public static readonly Expression AndAlso = IIFE(() => { + bool b1 = true, b2 = true; + return Expr(() => b1 && b2); + }); + + [Category(Binary)] + public static readonly Expression OrElse = IIFE(() => { + bool b1 = true, b2 = true; + return Expr(() => b1 || b2); + }); + + [Category(Binary)] + public static readonly Expression Equal = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i == j); + }); + + [Category(Binary)] + public static readonly Expression NotEqual = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i != j); + }); + + [Category(Binary)] + public static readonly Expression GreaterThanOrEqual = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i >= j); + }); + + [Category(Binary)] + public static readonly Expression GreaterThan = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i > j); + }); + + [Category(Binary)] + public static readonly Expression LessThan = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i < j); + }); + + [Category(Binary)] + public static readonly Expression LessThanOrEqual = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i <= j); + }); + + [Category(Binary)] + public static readonly Expression Coalesce = IIFE(() => { + string s1 = null, s2 = null; + return Expr(() => s1 ?? s2); + }); + + [Category(Binary)] + public static readonly Expression LeftShift = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i << j); + }); + + [Category(Binary)] + public static readonly Expression RightShift = IIFE(() => { + int i = 0, j = 0; + return Expr(() => i >> j); + }); + + [Category(Binary)] + public static readonly Expression ArrayIndex = IIFE(() => { + var arr = new string[] { }; + return Expr(() => arr[0]); + }); + } +} diff --git a/Tests.Common/Objects/CSCompiler/CSCompiler.cs b/Tests.Common/Objects/CSCompiler/CSCompiler.cs new file mode 100644 index 0000000..9a13917 --- /dev/null +++ b/Tests.Common/Objects/CSCompiler/CSCompiler.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using static ExpressionToString.Tests.Functions; +using static ExpressionToString.Tests.Categories; + +namespace ExpressionToString.Tests.Objects { + public static partial class CSCompiler { + [Category(Defaults)] + public static readonly Expression DefaultRefType = Expr(() => default(string)); + + [Category(Defaults)] + public static readonly Expression DefaultValueType = Expr(() => default(int)); + + [Category(Conditionals)] + public static readonly Expression Conditional = Expr((int i) => i > 10 ? i : i + 10); + + public static readonly Expression TypeCheck = IIFE(() => { + object o = ""; + return Expr(() => o is string); + }); + + [Category(Invocation)] + public static readonly Expression InvocationNoArguments = IIFE(() => { + Func del = () => DateTime.Now.Day; + return Expr(() => del()); + }); + + [Category(Invocation)] + public static readonly Expression InvocationOneArgument = IIFE(() => { + Func del = (int i) => DateTime.Now.Day; + return Expr(() => del(5)); + }); + + [Category(Member)] + public static readonly Expression InstanceMember = IIFE(() => { + var s = ""; + return Expr(() => s.Length); + }); + + [Category(Member)] + public static readonly Expression ClosedVariable = IIFE(() => { + var s = ""; + return Expr(() => s); + }); + + [Category(Member)] + public static readonly Expression StaticMember = Expr(() => string.Empty); + + [Category(Indexer)] + public static readonly Expression ArraySingleIndex = IIFE(() => { + var arr = new string[] { }; + return Expr(() => arr[5]); + }); + + [Category(Indexer)] + public static readonly Expression ArrayMultipleIndex = IIFE(() => { + var arr = new string[,] { }; + return Expr(() => arr[5, 6]); + }); + + [Category(Indexer)] + public static readonly Expression TypeIndexer = IIFE(() => { + var lst = new List(); + return Expr(() => lst[3]); + }); + } +} diff --git a/Tests.Common/Objects/CategoryAttribute.cs b/Tests.Common/Objects/CategoryAttribute.cs new file mode 100644 index 0000000..5282b03 --- /dev/null +++ b/Tests.Common/Objects/CategoryAttribute.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static System.AttributeTargets; + +namespace ExpressionToString.Tests.Objects { + [AttributeUsage(Field, Inherited = false, AllowMultiple = false)] + public class CategoryAttribute : Attribute { + public CategoryAttribute(string category) { + Category = category; + } + + public string Category { get; set; } + } +} diff --git a/Tests.Common/Objects/FactoryMethods/FactoryMethods.cs b/Tests.Common/Objects/FactoryMethods/FactoryMethods.cs new file mode 100644 index 0000000..946df12 --- /dev/null +++ b/Tests.Common/Objects/FactoryMethods/FactoryMethods.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExpressionToString.Tests.Objects { + public static partial class FactoryMethods { + + } +} diff --git a/Tests.Common/TestsBase.cs b/Tests.Common/TestsBase.cs index 5b16b5b..062d19b 100644 --- a/Tests.Common/TestsBase.cs +++ b/Tests.Common/TestsBase.cs @@ -1,20 +1,39 @@ -using System; +using ExpressionToString.Tests.Objects; +using ExpressionToString.Util; +using System; +using System.Linq; using System.Linq.Expressions; +using System.Runtime.CompilerServices; +using Xunit; namespace ExpressionToString.Tests { public abstract class TestsBase { - protected void RunTest(Expression expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); + [Obsolete] protected void RunTest(Expression expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); - protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); + [Obsolete] protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); - protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); + [Obsolete] protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); - protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); + [Obsolete] protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); - protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); + [Obsolete] protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); - protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); + [Obsolete] protected void RunTest(Expression> expr, string csharp, string vb, string factoryMethods) => RunTest(expr as Expression, csharp, vb, factoryMethods); - protected abstract void RunTest(object o, string csharp, string vb, string factoryMethods); + [Obsolete] protected abstract void RunTest(object o, string csharp, string vb, string factoryMethods); + + protected abstract void RunTest(object o, string objectName); + + protected void PreRunTest([CallerMemberName] string methodName = null) { + var t = GetObjectContainerType(); + var o = t.GetField(methodName).GetValue(null); + var objectName = $"{t.Name}.{methodName}"; + RunTest(o, objectName); + } + + protected virtual Type GetObjectContainerType() => + this is CompilerGeneratedBase ? typeof(CSCompiler) : + this is ConstructedBase ? typeof(FactoryMethods) : + throw new InvalidOperationException(); } } diff --git a/Tests.DataGenerator/Runner.cs b/Tests.DataGenerator/Runner.cs index 0f70e2a..055e0a3 100644 --- a/Tests.DataGenerator/Runner.cs +++ b/Tests.DataGenerator/Runner.cs @@ -12,10 +12,18 @@ namespace Tests.DataGenerator { public static class Runner { public static int total = 0; private static string formatter = ObjectNotation; - private static string language = VisualBasic; + private static string language = CSharp; public static readonly List lines = new List(); //public static NodeTypeExpressionTypeMapper visitor = new NodeTypeExpressionTypeMapper(); - public static void WriteData(object o, string testData) { + + private static Dictionary typenameMapping = new[] { + ("CompilerGeneratedBase", "CSCompiler"), + ("ConstructedBase","FactoryMethods"), + ("VBCompilerGeneratedBase","VBCompiler") + }.ToDictionary(); + [Obsolete] public static void WriteData(object o, string testData) { + lines.Add($"---- {TestMethodName()}"); + string toWrite; switch (o) { case Expression expr: @@ -39,18 +47,15 @@ public static void WriteData(object o, string testData) { default: throw new NotImplementedException(); } + lines.Add(toWrite); - lines.AddRange(new[] { - "\"" + toWrite.Replace("\"", "\"\"") + "\"", - $"{TestMethodName()}", - "" - }); + //lines.Add(testData); //visitor.VisitExt(o); string TestMethodName() { var mi = new StackTrace().GetFrames().Select(x => x.GetMethod()).FirstOrDefault(x => x.DeclaringType.BaseType == typeof(TestsBase)); - return $"{mi.ReflectedType.Name}.{mi.Name}"; + return $"{typenameMapping[mi.ReflectedType.Name]}.{mi.Name}"; } } } diff --git a/Tests.DataGenerator/TestClasses.cs b/Tests.DataGenerator/TestClasses.cs index c600c74..2fe7fbd 100644 --- a/Tests.DataGenerator/TestClasses.cs +++ b/Tests.DataGenerator/TestClasses.cs @@ -7,12 +7,16 @@ namespace Tests.DataGenerator { class CompilerGeneratedTestData : CompilerGeneratedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.WriteData(o, factoryMethods); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.WriteData(o, factoryMethods); + protected override void RunTest(object o, string objectName) { } } + class ConstructedTestData : ConstructedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.WriteData(o, factoryMethods); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.WriteData(o, factoryMethods); + protected override void RunTest(object o, string objectName) { } } class VBCompilerGeneratedTestData : VBCompilerGeneratedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.WriteData(o, factoryMethods); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.WriteData(o, factoryMethods); + protected override void RunTest(object o, string objectName) { } } } diff --git a/Tests.DotNetCore/Classes.cs b/Tests.DotNetCore/Classes.cs index 525ad59..cf9ba46 100644 --- a/Tests.DotNetCore/Classes.cs +++ b/Tests.DotNetCore/Classes.cs @@ -1,11 +1,16 @@ -namespace ExpressionToString.Tests { +using System; + +namespace ExpressionToString.Tests { public class CompilerGenerated : CompilerGeneratedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o, csharp, vb, factoryMethods); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o, csharp, vb, factoryMethods); + protected override void RunTest(object o, string objectName) => Runner.RunTest(o, objectName); } public class Constructed : ConstructedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o, csharp, vb, factoryMethods); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o, csharp, vb, factoryMethods); + protected override void RunTest(object o, string objectName) => Runner.RunTest(o, objectName); } public class VBCompilerGenerated : VBCompilerGeneratedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o, csharp, vb, factoryMethods); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o, csharp, vb, factoryMethods); + protected override void RunTest(object o, string objectName) => Runner.RunTest(o, objectName); } } diff --git a/Tests.DotNetCore/Runner.cs b/Tests.DotNetCore/Runner.cs index c570d87..7784afa 100644 --- a/Tests.DotNetCore/Runner.cs +++ b/Tests.DotNetCore/Runner.cs @@ -6,13 +6,18 @@ using Pather.CSharp; using ExpressionToString.Util; using System; +using System.IO; +using static ExpressionToString.Tests.Functions; +using static ExpressionToString.Util.Functions; +using static System.Environment; namespace ExpressionToString.Tests { public static class Runner { + [Obsolete] public static void RunTest(object o, string csharp, string vb, string factoryMethods) { - string testCSharpCode=""; + string testCSharpCode = ""; Dictionary csharpPathSpans = null; - string testVBCode=""; + string testVBCode = ""; Dictionary vbPathSpans = null; string testFactoryMethods = ""; Dictionary factoryMethodsPathSpans = null; @@ -53,13 +58,13 @@ public static void RunTest(object o, string csharp, string vb, string factoryMet // check that the string results are equivalent, for both C# and VB code Assert.Equal(csharp, testCSharpCode); Assert.Equal(vb, testVBCode); - factoryMethods = FactoryMethodsFormatter.CSharpUsing + Environment.NewLine + Environment.NewLine + factoryMethods; + factoryMethods = FactoryMethodsFormatter.CSharpUsing + NewLine + NewLine + factoryMethods; Assert.Equal(factoryMethods, testFactoryMethods); - // using factory methods formatter as source for paths; other formatters may skip paths or introduce new onee + // using paths from factory methods formatter as a reference; other formatters may skip paths or introduce new onee var paths = factoryMethodsPathSpans.Keys.ToHashSet(); - // check that all the paths can resolve against the original object + // check that all the reference paths can resolve against the original object var resolver = new Resolver(); Assert.All(paths, path => Assert.NotNull(resolver.Resolve(o, path))); @@ -71,5 +76,92 @@ public static void RunTest(object o, string csharp, string vb, string factoryMet Assert.True(paths.IsSupersetOf(csharpPaths)); Assert.True(paths.IsSupersetOf(vbPaths)); } + + private static readonly string[] Formatters = new[] { CSharp, VisualBasic, FactoryMethods, ObjectNotation }; + + // TODO write this as a collection fixture (https://xunit.net/docs/shared-context) + public static Lazy> allExpected = new Lazy>(() => { + var ret = new Dictionary<(string formatter, string objectName), string>(); + + foreach (var formatter in Formatters.Except(new[] { DebugView, ToStringName })) { + var filename = formatter == CSharp ? "CSharp" : formatter; + var expectedDataPath = GetFullFilename($"{filename.ToLower()}-testdata.txt"); + string testName = ""; + string expected = ""; + // TODO this might be made more efficient, instead of building up multiple strings + foreach (var line in File.ReadLines(expectedDataPath)) { + if (line.StartsWith("----")) { + if (testName != "") { + if (formatter == FactoryMethods) { + expected = FactoryMethodsFormatter.CSharpUsing + NewLines(2) + expected; + } + ret.Add((formatter, testName), expected.Trim()); + } + testName = line.Substring(5); // ---- testMethod + } else { + expected += line + NewLine; + } + } + } + + return ret; + }); + + public static void RunTest(object o, string objectName) { + var actual = Formatters.Select(formatter => { + string singleResult; + Dictionary pathSpans; + switch (o) { + case Expression expr: + singleResult = expr.ToString(formatter, out pathSpans); + break; + case MemberBinding mbind: + singleResult = mbind.ToString(formatter, out pathSpans); + break; + case ElementInit init: + singleResult = init.ToString(formatter, out pathSpans); + break; + case SwitchCase switchCase: + singleResult = switchCase.ToString(formatter, out pathSpans); + break; + case CatchBlock catchBlock: + singleResult = catchBlock.ToString(formatter, out pathSpans); + break; + case LabelTarget labelTarget: + singleResult = labelTarget.ToString(formatter, out pathSpans); + break; + default: + throw new InvalidOperationException(); + } + + var selector = + formatter == FactoryMethods ? x => x : + (Func)(x => x.Replace("_0", "")); + + var paths = pathSpans.Keys.Select(selector).ToHashSet(); + + return (formatter, (singleResult, paths)); + }).ToDictionary(); + + var expectedPaths = actual[FactoryMethods].paths; + + // check that all the expected paths can resolve against the original object + var resolver = new Resolver(); + Assert.All(expectedPaths, path => Assert.NotNull(resolver.Resolve(o, path))); + + foreach (var formatter in Formatters) { + var expected = allExpected.Value[(formatter, objectName)]; + var actualSingle = actual[formatter].singleResult; + + // check that the actual matches the expected + Assert.Equal(expected, actualSingle); + + if (formatter != FactoryMethods) { // we're using the paths of the FactoryMethodsFormatter as reference paths + var referencePaths = actual[FactoryMethods].paths; + var actualPaths = actual[formatter].paths; + Assert.True(referencePaths.IsSupersetOf(actualPaths)); + } + } + } } } diff --git a/Tests.DotNetCore/Tests.DotNetCore.csproj b/Tests.DotNetCore/Tests.DotNetCore.csproj index fd6f451..7a12435 100644 --- a/Tests.DotNetCore/Tests.DotNetCore.csproj +++ b/Tests.DotNetCore/Tests.DotNetCore.csproj @@ -26,4 +26,19 @@ + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + diff --git a/Tests.DotNetCore/csharp-testdata.txt b/Tests.DotNetCore/csharp-testdata.txt new file mode 100644 index 0000000..bb51208 --- /dev/null +++ b/Tests.DotNetCore/csharp-testdata.txt @@ -0,0 +1,1113 @@ +---- CSCompiler.Add +() => x + y +---- CSCompiler.AndAlso +() => b1 && b2 +---- CSCompiler.AndBitwise +() => i & j +---- CSCompiler.AndLogical +() => b1 & b2 +---- CSCompiler.AnonymousType +() => new { + Bar = "abcd", + Baz = "efgh" +} +---- CSCompiler.AnonymousTypeFromVariables +() => new { + Bar, + Baz +} +---- CSCompiler.ArrayIndex +() => arr[0] +---- CSCompiler.ArrayLength +() => arr.Length +---- CSCompiler.ArrayMultipleIndex +() => arr[5, 6] +---- CSCompiler.ArrayOfMultidimensionalArray +() => new string[5][,] +---- CSCompiler.ArraySingleIndex +() => arr[5] +---- CSCompiler.BitwiseNot +() => ~i +---- CSCompiler.ClosedVariable +() => s +---- CSCompiler.Coalesce +() => s1 ?? s2 +---- CSCompiler.CollectionTypeWithInitializer +() => new List() { + "abcd", + "efgh" +} +---- CSCompiler.CollectionTypeWithMultipleElementsInitializers +() => new Wrapper() { + { + "ab", + "cd" + }, + { + "ef", + "gh" + } +} +---- CSCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +() => new Wrapper() { + { + "ab", + "cd" + }, + "ef" +} +---- CSCompiler.Conditional +(int i) => i > 10 ? i : i + 10 +---- CSCompiler.Convert +() => (object)lst +---- CSCompiler.DefaultRefType +() => null +---- CSCompiler.DefaultValueType +() => 0 +---- CSCompiler.Divide +() => x / y +---- CSCompiler.Equal +() => i == j +---- CSCompiler.EscapedString +() => "\'\"\\\0\a\b\f\n\r\t\v" +---- CSCompiler.ExclusiveOrBitwise +() => i ^ j +---- CSCompiler.ExclusiveOrLogical +() => b1 ^ b2 +---- CSCompiler.ExtensionMethod0Arguments +() => lst.Count() +---- CSCompiler.ExtensionMethod1Argument +() => lst.Take(1) +---- CSCompiler.ExtensionMethod2Arguments +() => lst.OrderBy((string x) => x, StringComparer.OrdinalIgnoreCase) +---- CSCompiler.False +() => false +---- CSCompiler.GreaterThan +() => i > j +---- CSCompiler.GreaterThanOrEqual +() => i >= j +---- CSCompiler.InstanceMember +() => s.Length +---- CSCompiler.InstanceMethod0Arguments +() => s.ToString() +---- CSCompiler.InstanceMethod1Argument +() => s.CompareTo("") +---- CSCompiler.InstanceMethod2Arguments +() => s.IndexOf('a', 2) +---- CSCompiler.Integer +() => 5 +---- CSCompiler.InterpolatedString +() => $"{(object)new DateTime(2001, 1, 1)}" +---- CSCompiler.InvocationNoArguments +() => del() +---- CSCompiler.InvocationOneArgument +() => del(5) +---- CSCompiler.JaggedWithBounds +() => new string[5][] +---- CSCompiler.JaggedWithElementsExplicitType +() => new object[][] { new[] { "ab", "cd" }, new[] { "ef", "gh" } } +---- CSCompiler.JaggedWithElementsImplicitType +() => new string[][] { new[] { "ab", "cd" }, new[] { "ef", "gh" } } +---- CSCompiler.LeftShift +() => i << j +---- CSCompiler.LessThan +() => i < j +---- CSCompiler.LessThanOrEqual +() => i <= j +---- CSCompiler.ListBinding +() => new Node() { + Children = { + new Node(), + new Node() + } +} +---- CSCompiler.LogicalNot +() => !b +---- CSCompiler.MathPow +(double x, double y) => Math.Pow(x, y) +---- CSCompiler.MemberMemberBinding +() => new Node() { + Data = { + Name = "abcd" + } +} +---- CSCompiler.Modulo +() => x % y +---- CSCompiler.MultidimensionalArrayOfArray +() => new string[3, 2][] +---- CSCompiler.MultidimensionWithBounds +() => new string[2, 3] +---- CSCompiler.Multiply +() => x * y +---- CSCompiler.NamedType +() => new Random() +---- CSCompiler.NamedTypeConstructorParameters +() => new Foo("ijkl") +---- CSCompiler.NamedTypeConstructorParametersWithInitializers +() => new Foo("ijkl") { + Bar = "abcd", + Baz = "efgh" +} +---- CSCompiler.NamedTypeWithInitializer +() => new Foo() { + Bar = "abcd" +} +---- CSCompiler.NamedTypeWithInitializers +() => new Foo() { + Bar = "abcd", + Baz = "efgh" +} +---- CSCompiler.Negate +() => -i +---- CSCompiler.NonInteger +() => 7.32 +---- CSCompiler.NoParametersNonVoidReturn +() => "abcd" +---- CSCompiler.NoParametersVoidReturn +() => Console.WriteLine() +---- CSCompiler.NotEqual +() => i != j +---- CSCompiler.Nothing +() => null +---- CSCompiler.OneParameterNonVoidReturn +(string s) => s +---- CSCompiler.OneParameterVoidReturn +(string s) => Console.WriteLine(s) +---- CSCompiler.OrBitwise +() => i | j +---- CSCompiler.OrElse +() => b1 || b2 +---- CSCompiler.OrLogical +() => b1 | b2 +---- CSCompiler.RightShift +() => i >> j +---- CSCompiler.SingleDimensionInit +() => new[] { "" } +---- CSCompiler.SingleDimensionInitExplicitType +() => new object[] { "" } +---- CSCompiler.SingleDimensionWithBounds +() => new string[5] +---- CSCompiler.StaticMember +() => string.Empty +---- CSCompiler.StaticMethod0Arguments +() => Dummy.DummyMethod() +---- CSCompiler.StaticMethod1Argument +() => string.Intern("") +---- CSCompiler.StaticMethod2Arguments +() => string.Join(",", new[] { "a", "b" }) +---- CSCompiler.String +() => "abcd" +---- CSCompiler.StringConcat +(string s1, string s2) => s1 + s2 +---- CSCompiler.Subtract +() => x - y +---- CSCompiler.True +() => true +---- CSCompiler.TwoParametersNonVoidReturn +(string s1, string s2) => s1 + s2 +---- CSCompiler.TwoParametersVoidReturn +(string s1, string s2) => Console.WriteLine(s1 + s2) +---- CSCompiler.Type +() => typeof(string) +---- CSCompiler.TypeAs +() => o as string +---- CSCompiler.TypeCheck +() => o is string +---- CSCompiler.TypeIndexer +() => lst[3] +---- FactoryMethods.Array +new[] { "abcd", 5, #Random } +---- FactoryMethods.ArrayOfMultidimensionalArray +new string[5][,] +---- FactoryMethods.BlockMultipleVariable +( + int i, + string s1, + true, + true +) +---- FactoryMethods.BlockNoVariables +( + true, + true +) +---- FactoryMethods.BlockSingleVariable +( + int i, + true, + true +) +---- FactoryMethods.CollectionTypeWithInitializer +new List() { + "abcd", + "efgh" +} +---- FactoryMethods.CollectionTypeWithMultiElementInitializers +new Wrapper() { + { + "ab", + "cd" + }, + { + "ef", + "gh" + } +} +---- FactoryMethods.CollectionTypeWithSingleOrMultiElementInitializers +new Wrapper() { + { + "ab", + "cd" + }, + "ef" +} +---- FactoryMethods.ConstructAdd +x + y +---- FactoryMethods.ConstructAddAssign +i += j +---- FactoryMethods.ConstructAddAssignChecked +i += j +---- FactoryMethods.ConstructAddChecked +x + y +---- FactoryMethods.ConstructAndAlso +b1 && b2 +---- FactoryMethods.ConstructAndAssign +b1 &= b2 +---- FactoryMethods.ConstructAndBitwise +i & j +---- FactoryMethods.ConstructAndLogical +b1 & b2 +---- FactoryMethods.ConstructArrayIndex +arr[i] +---- FactoryMethods.ConstructArrayLength +arr.Length +---- FactoryMethods.ConstructAssign +x = 5.2 +---- FactoryMethods.ConstructBitwiseNot +~i +---- FactoryMethods.ConstructCatchMultiStatement +catch (Exception ex) { + Console.WriteLine(true); + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCatchMultiStatementWithFilter +catch (Exception ex) when (true) { + Console.WriteLine(true); + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCatchMultiStatementWithType +catch (InvalidCastException) { + Console.WriteLine(true); + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCatchSingleStatement +catch (Exception ex) { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCatchSingleStatementWithFilter +catch (Exception ex) when (true) { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCatchSingleStatementWithType +catch (InvalidCastException) { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCatchWithMultiStatementFilter +catch (Exception ex) when ( + true, + true +) { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructCoalesce +s1 ?? s2 +---- FactoryMethods.ConstructConvert +(object)arr +---- FactoryMethods.ConstructConvertChecked +(float)5 +---- FactoryMethods.ConstructConvertCheckedForReferenceType +(object)arr +---- FactoryMethods.ConstructDecrement +i -= 1 +---- FactoryMethods.ConstructDivide +x / y +---- FactoryMethods.ConstructDivideAssign +i /= j +---- FactoryMethods.ConstructEmptyLabelTarget + +---- FactoryMethods.ConstructEqual +x == y +---- FactoryMethods.ConstructExclusiveOrAssign +b1 ^= b2 +---- FactoryMethods.ConstructExclusiveOrBitwise +i ^ j +---- FactoryMethods.ConstructExclusiveOrLogical +b1 ^ b2 +---- FactoryMethods.ConstructGetIndex +obj["key"] +---- FactoryMethods.ConstructGetIndexMultipleKeys +obj["key", 1] +---- FactoryMethods.ConstructGetMember +obj.Data +---- FactoryMethods.ConstructGreaterThan +x > y +---- FactoryMethods.ConstructGreaterThanOrEqual +x >= y +---- FactoryMethods.ConstructIncrement +i += 1 +---- FactoryMethods.ConstructInvocationNoArguments +obj() +---- FactoryMethods.ConstructInvocationWithArguments +obj("arg1", 15) +---- FactoryMethods.ConstructIsFalse +!b1 +---- FactoryMethods.ConstructIsTrue +b1 +---- FactoryMethods.ConstructLabel +( + int i, + ( + int j, + true, +target: + true + ) +) +---- FactoryMethods.ConstructLabel1 +( + int i, + ( + int j, +target: + true + ) +) +---- FactoryMethods.ConstructLabelTarget +target +---- FactoryMethods.ConstructLeftShift +i << j +---- FactoryMethods.ConstructLeftShiftAssign +i <<= j +---- FactoryMethods.ConstructLessThan +x < y +---- FactoryMethods.ConstructLessThanOrEqual +x <= y +---- FactoryMethods.ConstructLogicalNot +!b1 +---- FactoryMethods.ConstructMemberInvocationNoArguments +obj.Method() +---- FactoryMethods.ConstructMemberInvocationWithArguments +obj.Method("arg1", 15) +---- FactoryMethods.ConstructModulo +x % y +---- FactoryMethods.ConstructModuloAssign +i %= j +---- FactoryMethods.ConstructMultiply +x * y +---- FactoryMethods.ConstructMultiplyAssign +i *= j +---- FactoryMethods.ConstructMultiplyAssignChecked +i *= j +---- FactoryMethods.ConstructMultiplyChecked +x * y +---- FactoryMethods.ConstructNegate +-i +---- FactoryMethods.ConstructNotEqual +x != y +---- FactoryMethods.ConstructOrAssign +b1 |= b2 +---- FactoryMethods.ConstructOrBitwise +i | j +---- FactoryMethods.ConstructOrElse +b1 || b2 +---- FactoryMethods.ConstructOrLogical +b1 | b2 +---- FactoryMethods.ConstructPostDecrementAssign +i-- +---- FactoryMethods.ConstructPostIncrementAssign +i++ +---- FactoryMethods.ConstructPower +Math.Pow(x, y) +---- FactoryMethods.ConstructPowerAssign +x = Math.Pow(x, y) +---- FactoryMethods.ConstructPreDecrementAssign +--i +---- FactoryMethods.ConstructPreIncrementAssign +++i +---- FactoryMethods.ConstructReferenceEqual +lstString == lstString +---- FactoryMethods.ConstructReferenceNotEqual +lstString != lstString +---- FactoryMethods.ConstructRethrow +throw +---- FactoryMethods.ConstructRightShift +i >> j +---- FactoryMethods.ConstructRightShiftAssign +i >>= j +---- FactoryMethods.ConstructRuntimeVariables +// variables -- double x, string s1 +---- FactoryMethods.ConstructSetIndex +obj["key"] = 42 +---- FactoryMethods.ConstructSetIndexMultipleKeys +obj["key", 1] = 42 +---- FactoryMethods.ConstructSetMember +obj.Data = 42 +---- FactoryMethods.ConstructSimpleCatch +catch { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructSubtract +x - y +---- FactoryMethods.ConstructSubtractAssign +i -= j +---- FactoryMethods.ConstructSubtractAssignChecked +i -= j +---- FactoryMethods.ConstructSubtractChecked +x - y +---- FactoryMethods.ConstructThrow +throw #Random +---- FactoryMethods.ConstructTryCatch +try { + true; +} catch { + true; +} +---- FactoryMethods.ConstructTryCatchFinally +try { + true; +} catch (Exception ex) { + true; +} finally { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructTryFault +try { + Console.WriteLine(true); +} fault { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructTryFinally +try { + Console.WriteLine(true); +} finally { + Console.WriteLine(true); +} +---- FactoryMethods.ConstructTypeAs +arr as object +---- FactoryMethods.DateTime +#DateTime +---- FactoryMethods.DifferentTypeForNodeAndValue +#List +---- FactoryMethods.EmptyLoop +while (true) { + true; +} +---- FactoryMethods.EmptyLoop1 +while (true) { + true; + true; +} +---- FactoryMethods.ExtensionMethod0Arguments +lstString.Count() +---- FactoryMethods.ExtensionMethod1Argument +lstString.Take(1) +---- FactoryMethods.ExtensionMethod2Arguments +lstString.OrderBy((string x) => x, StringComparer.OrdinalIgnoreCase) +---- FactoryMethods.InstanceIndexer +lstString[0] +---- FactoryMethods.InstanceMember +"".Length +---- FactoryMethods.InstanceMethod0Arguments +s.ToString() +---- FactoryMethods.InstanceMethod1Argument +s.CompareTo("") +---- FactoryMethods.InstanceMethod2Arguments +s.IndexOf('a', 2) +---- FactoryMethods.JaggedWithBounds +new string[5][] +---- FactoryMethods.JaggedWithElementsExplicitType +new object[][] { new[] { "ab", "cd" }, new[] { "ef", "gh" } } +---- FactoryMethods.JaggedWithElementsImplicitType +new string[][] { new[] { "ab", "cd" }, new[] { "ef", "gh" } } +---- FactoryMethods.LambdaMultilineBlockNonvoidReturn +() => { + true; + return true; +} +---- FactoryMethods.LambdaMultilineNestedBlockNonvoidReturn +() => { + true; + { + string s1; + string s2; + true; + return true; + } +} +---- FactoryMethods.MakeArrayAccess +arr[0] +---- FactoryMethods.MakeArrayIndex +arr[0] +---- FactoryMethods.MakeArrayMultipleIndex +arr2d[0, 1] +---- FactoryMethods.MakeBreak +break target +---- FactoryMethods.MakeBreakWithValue +break target 5 +---- FactoryMethods.MakeByRefParameter +(ref string s4) => true +---- FactoryMethods.MakeClearDebugInfo +// Clear debug info from source.txt +---- FactoryMethods.MakeConditional +i > 10 ? i : i + 10 +---- FactoryMethods.MakeContinue +continue target +---- FactoryMethods.MakeDebugInfo +// Debug to source.txt -- L1C2 : L3C4 +---- FactoryMethods.MakeDefaultRefType +default(string) +---- FactoryMethods.MakeDefaultValueType +default(int) +---- FactoryMethods.MakeElementInit +"abcd" +---- FactoryMethods.MakeElementInit2Arguments +{ + "abcd", + "efgh" +} +---- FactoryMethods.MakeGotoWithoutValue +goto target +---- FactoryMethods.MakeGotoWithValue +goto target 5 +---- FactoryMethods.MakeInvocation +(() => 5)() +---- FactoryMethods.MakeListBinding +Children = { + new Node(), + new Node() +} +---- FactoryMethods.MakeMemberBind +Foo = "abcd" +---- FactoryMethods.MakeMemberMemberBind +Data = { + Name = "abcd" +} +---- FactoryMethods.MakeQuoted +( + double x, + // --- Quoted - begin + () => Console.WriteLine(true) + // --- Quoted - end +) +---- FactoryMethods.MakeQuoted1 +() => +// --- Quoted - begin + () => Console.WriteLine(true) +// --- Quoted - end +---- FactoryMethods.MakeReturn +return target +---- FactoryMethods.MakeReturnWithValue +return target 5 +---- FactoryMethods.MakeTypeCheck +"" is string +---- FactoryMethods.MakeTypeEqual +"".GetType() == typeof(IEnumerable) +---- FactoryMethods.MultidimensionalArrayOfArray +new string[3, 2][] +---- FactoryMethods.MultidimensionWithBounds +new string[2, 3] +---- FactoryMethods.MultilineIfFalse +if (true) { + Console.WriteLine(true); +} else { + Console.WriteLine(false); + Console.WriteLine(false); +} +---- FactoryMethods.MultilineIfTrue +if (true) { + Console.WriteLine(true); + Console.WriteLine(true); +} +---- FactoryMethods.MultilineLambda +() => { + if (true) { + Console.WriteLine(true); + } +} +---- FactoryMethods.MultilineTestPart +( + true, + true +) ? "true".Length : "false".Length +---- FactoryMethods.MultilineTestPart1 +if ( + true, + true +) { + Console.WriteLine(true); +} +---- FactoryMethods.MultiValueSwitchCase +case 5: +case 6: + Console.WriteLine(true); + Console.WriteLine(true); + break; +---- FactoryMethods.MultiValueSwitchCase1 +case 5: +case 6: + Console.WriteLine(true); + break; +---- FactoryMethods.NamedLambda +(string s1, string s2) => s1 + s2 +---- FactoryMethods.NamedType +new Random() +---- FactoryMethods.NamedTypeConstructorParameters +new Foo("ijkl") +---- FactoryMethods.NamedTypeConstructorParametersWithInitializers +new Foo("ijkl") { + Bar = "abcd", + Baz = "efgh" +} +---- FactoryMethods.NamedTypeWithInitializer +new Foo() { + Bar = "abcd" +} +---- FactoryMethods.NamedTypeWithInitializers +new Foo() { + Bar = "abcd", + Baz = "efgh" +} +---- FactoryMethods.NestedBlockInBlockSyntax +if (true) { + true; + true; + true; + true; +} +---- FactoryMethods.NestedBlockInBlockSyntaxWithVariable +if (true) { + true; + { + string s1; + true; + true; + } + true; +} +---- FactoryMethods.NestedBlockInTest +if ( + true, + true, + true, + true +) { + true; +} +---- FactoryMethods.NestedBlockInTestWithVariables +if ( + true, + ( + string s1, + true, + true + ), + true +) { + true; +} +---- FactoryMethods.NestedElse +if (true) { + Console.WriteLine(true); +} else if (true) { + Console.WriteLine(true); +} +---- FactoryMethods.NestedIfThen +if (true) { + if (true) { + Console.WriteLine(true); + } +} +---- FactoryMethods.NestedInlineBlock +( + true, + true, + true, + true +) +---- FactoryMethods.NestedInlineBlockWithVariable +( + true, + ( + string s1, + true, + true + ), + true +) +---- FactoryMethods.NestedLambda +() => { + return (string s1, string s2) => s1 + s2; +} +---- FactoryMethods.NonVoidConditionalWithElse +true ? "true".Length : "false".Length +---- FactoryMethods.NonVoidConditionalWithoutElse +true ? "true".Length : default(int) +---- FactoryMethods.NoParametersNonVoidReturn +() => "abcd" +---- FactoryMethods.NoParametersVoidReturn +() => Console.WriteLine() +---- FactoryMethods.OldTuple +("abcd", 5) +---- FactoryMethods.OneParameterNonVoidReturn +(string s) => s +---- FactoryMethods.OneParameterVoidReturn +(string s) => Console.WriteLine(s) +---- FactoryMethods.PropertyIndexer +lstString[0] +---- FactoryMethods.Random +#Random +---- FactoryMethods.RuntimeVariablesWithinBlock +( + string s2, + true + // variables -- double x, string s1 +) +---- FactoryMethods.SingleDimensionInit +new[] { "" } +---- FactoryMethods.SingleDimensionInitExplicitType +new object[] { "" } +---- FactoryMethods.SingleDimensionWithBounds +new string[5] +---- FactoryMethods.SingleValueSwitchCase +case 5: + Console.WriteLine(true); + Console.WriteLine(true); + break; +---- FactoryMethods.SingleValueSwitchCase1 +case 5: + Console.WriteLine(true); + break; +---- FactoryMethods.StaticMember +string.Empty +---- FactoryMethods.StaticMethod0Arguments +Dummy.DummyMethod() +---- FactoryMethods.StaticMethod1Argument +string.Intern("") +---- FactoryMethods.StaticMethod2Arguments +string.Join(",", new[] { "a", "b" }) +---- FactoryMethods.StringConcat +s1 + s2 +---- FactoryMethods.SwitchOnExpressionWithDefaultMultiStatement +switch (i) { + case 4: + Console.WriteLine(true); + break; + case 5: + Console.WriteLine(false); + break; + default: + true; + true; + break; +} +---- FactoryMethods.SwitchOnExpressionWithDefaultSingleStatement +switch (i) { + case 4: + Console.WriteLine(true); + break; + case 5: + Console.WriteLine(false); + break; + default: + default(void); + break; +} +---- FactoryMethods.SwitchOnExpressionWithoutDefault +switch (i) { + case 4: + Console.WriteLine(true); + break; + case 5: + Console.WriteLine(false); + break; +} +---- FactoryMethods.SwitchOnMultipleStatementsWithDefault +switch ( + i, + j +) { + case 4: + Console.WriteLine(true); + break; + case 5: + Console.WriteLine(false); + break; + default: + true; + true; + break; +} +---- FactoryMethods.SwitchOnMultipleStatementsWithoutDefault +switch ( + i, + j +) { + case 4: + Console.WriteLine(true); + break; + case 5: + Console.WriteLine(false); + break; +} +---- FactoryMethods.TimeSpan +#TimeSpan +---- FactoryMethods.TwoParametersNonVoidReturn +(string s1, string s2) => s1 + s2 +---- FactoryMethods.TwoParametersVoidReturn +(string s1, string s2) => Console.WriteLine(s1 + s2) +---- FactoryMethods.Type +typeof(string) +---- FactoryMethods.ValueTuple +("abcd", 5) +---- FactoryMethods.VoidConditional1WithElse +if (true) { + Console.WriteLine(true); +} else { + Console.WriteLine(false); +} +---- FactoryMethods.VoidConditional1WithoutElse +if (true) { + Console.WriteLine(true); +} +---- FactoryMethods.VoidConditionalWithElse +if (true) { + Console.WriteLine(true); +} else { + Console.WriteLine(false); +} +---- FactoryMethods.VoidConditionalWithoutElse +if (true) { + Console.WriteLine(true); +} +---- VBCompiler.Add +() => x + y +---- VBCompiler.AndAlso +() => b1 && b2 +---- VBCompiler.AndBitwise +() => i & j +---- VBCompiler.AndLogical +() => b1 & b2 +---- VBCompiler.AnonymousType +() => new { + Bar = "abcd", + Baz = "efgh" +} +---- VBCompiler.AnonymousTypeFromVariables +() => new { + Bar, + Baz +} +---- VBCompiler.ArrayIndex +() => arr[0] +---- VBCompiler.ArrayLength +() => arr.Length +---- VBCompiler.ArrayMultipleIndex +() => arr[5, 6] +---- VBCompiler.ArrayOfMultidimensionalArray +() => new string[5][,] +---- VBCompiler.ArraySingleIndex +() => arr[5] +---- VBCompiler.BitwiseNot +() => ~i +---- VBCompiler.ClosedVariable +() => s +---- VBCompiler.Coalesce +() => s1 ?? s2 +---- VBCompiler.CObject +() => (object)lst +---- VBCompiler.CollectionTypeWithInitializer +() => new List() { + "abcd", + "efgh" +} +---- VBCompiler.CollectionTypeWithMultipleElementsInitializers +() => new Wrapper() { + { + "ab", + "cd" + }, + { + "ef", + "gh" + } +} +---- VBCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +() => new Wrapper() { + { + "ab", + "cd" + }, + "ef" +} +---- VBCompiler.Conditional +(int i) => i > 10 ? i : i + 10 +---- VBCompiler.ConstantNothingToObject +() => null +---- VBCompiler.ConstantNothingToReferenceType +() => null +---- VBCompiler.ConstantNothingToValueType +() => 0 +---- VBCompiler.Convert +() => (Random)o +---- VBCompiler.DateTime +() => #DateTime +---- VBCompiler.Divide +() => x / y +---- VBCompiler.Equal +() => i == j +---- VBCompiler.EscapedString +() => "\"" +---- VBCompiler.ExclusiveOrBitwise +() => i ^ j +---- VBCompiler.ExclusiveOrLogical +() => b1 ^ b2 +---- VBCompiler.ExtensionMethod0Arguments +() => lst.Distinct() +---- VBCompiler.ExtensionMethod1Argument +() => lst.Take(1) +---- VBCompiler.ExtensionMethod2Arguments +() => lst.OrderBy((string x) => x, comparer) +---- VBCompiler.False +() => false +---- VBCompiler.GreaterThan +() => i > j +---- VBCompiler.GreaterThanOrEqual +() => i >= j +---- VBCompiler.InstanceMember +() => s.Length +---- VBCompiler.InstanceMethod0Arguments +() => s.ToString() +---- VBCompiler.InstanceMethod1Argument +() => s.CompareTo("") +---- VBCompiler.InstanceMethod2Arguments +() => (IEnumerable)s.Contains('a', (IEqualityComparer)StringComparer.InvariantCultureIgnoreCase) +---- VBCompiler.Integer +() => 5 +---- VBCompiler.InterpolatedString +() => $"{(object)#DateTime}" +---- VBCompiler.InvocationNoArguments +() => del() +---- VBCompiler.InvocationOneArgument +() => del(5) +---- VBCompiler.JaggedWithBounds +() => new string[5][] +---- VBCompiler.JaggedWithElementsExplicitType +() => new object[][] { (object[])new[] { "ab", "cd" }, (object[])new[] { "ef", "gh" } } +---- VBCompiler.JaggedWithElementsImplicitType +() => new string[][] { new[] { "ab", "cd" }, new[] { "ef", "gh" } } +---- VBCompiler.JaggedWithElementsImplicitTypeInnerNonLiteral +() => new string[][] { arr1, arr2 } +---- VBCompiler.LeftShift +() => i << j & 31 +---- VBCompiler.LessThan +() => i < j +---- VBCompiler.LessThanOrEqual +() => i <= j +---- VBCompiler.LogicalNot +() => !b +---- VBCompiler.Modulo +() => x % y +---- VBCompiler.MultidimensionalArrayOfArray +() => new string[3, 2][] +---- VBCompiler.MultidimensionWithBounds +() => new string[2, 3] +---- VBCompiler.Multiply +() => x * y +---- VBCompiler.NamedType +() => new Random() +---- VBCompiler.NamedTypeConstructorParameters +() => new Foo("ijkl") +---- VBCompiler.NamedTypeConstructorParametersWithInitializers +() => new Foo("ijkl") { + Bar = "abcd", + Baz = "efgh" +} +---- VBCompiler.NamedTypeWithInitializer +() => new Foo() { + Bar = "abcd" +} +---- VBCompiler.NamedTypeWithInitializers +() => new Foo() { + Bar = "abcd", + Baz = "efgh" +} +---- VBCompiler.Negate +() => -i +---- VBCompiler.NonInteger +() => 7.32 +---- VBCompiler.NoParametersNonVoidReturn +() => "abcd" +---- VBCompiler.NoParametersVoidReturn +() => Console.WriteLine() +---- VBCompiler.NotEqual +() => i != j +---- VBCompiler.Nothing +() => null +---- VBCompiler.NothingString +() => null +---- VBCompiler.OneParameterNonVoidReturn +(string s) => s +---- VBCompiler.OneParameterVoidReturn +(string s) => Console.WriteLine(s) +---- VBCompiler.OrBitwise +() => i | j +---- VBCompiler.OrElse +() => b1 || b2 +---- VBCompiler.OrLogical +() => b1 | b2 +---- VBCompiler.Power +() => Math.Pow(x, y) +---- VBCompiler.RightShift +() => i >> j & 31 +---- VBCompiler.SingleDimensionInit +() => new[] { "" } +---- VBCompiler.SingleDimensionInitExplicitType +() => new[] { (object)"" } +---- VBCompiler.SingleDimensionWithBounds +() => new string[5] +---- VBCompiler.StaticMember +() => string.Empty +---- VBCompiler.StaticMethod0Arguments +() => Dummy.DummyMethod() +---- VBCompiler.StaticMethod1Argument +() => string.Intern("") +---- VBCompiler.StaticMethod2Arguments +() => string.Join(",", arr) +---- VBCompiler.String +() => "abcd" +---- VBCompiler.StringConcat +(string s1, string s2) => s1 + s2 +---- VBCompiler.StringConcatOperator +(string s1, string s2) => s1 + s2 +---- VBCompiler.StringConcatOperatorParamArray +(string s1, string s2) => s1 + s2 + s1 + s2 + s1 + s2 +---- VBCompiler.Subtract +() => x - y +---- VBCompiler.TimeSpan +#TimeSpan +---- VBCompiler.True +() => true +---- VBCompiler.TwoParametersNonVoidReturn +(string s1, string s2) => s1 + s2 +---- VBCompiler.TwoParametersVoidReturn +(string s1, string s2) => Console.WriteLine(s1 + s2) +---- VBCompiler.TypeAs +() => o as string +---- VBCompiler.TypeCheck +() => "" is string +---- VBCompiler.TypeIndexer +() => lst[3] +---- VBCompiler.VBDeclaredTypeIndexer +() => x[5] + +------ \ No newline at end of file diff --git a/Tests.DotNetCore/factory methods-testdata.txt b/Tests.DotNetCore/factory methods-testdata.txt new file mode 100644 index 0000000..44027fc --- /dev/null +++ b/Tests.DotNetCore/factory methods-testdata.txt @@ -0,0 +1,2628 @@ +---- CSCompiler.Add +Lambda( + Add(x, y) +) +---- CSCompiler.AndAlso +Lambda( + AndAlso(b1, b2) +) +---- CSCompiler.AndBitwise +Lambda( + And(i, j) +) +---- CSCompiler.AndLogical +Lambda( + And(b1, b2) +) +---- CSCompiler.AnonymousType +Lambda( + New( + typeof({ string Bar, string Baz }).GetConstructor(), + Constant("abcd"), + Constant("efgh") + ) +) +---- CSCompiler.AnonymousTypeFromVariables +Lambda( + New( + typeof({ string Bar, string Baz }).GetConstructor(), + Bar, Baz + ) +) +---- CSCompiler.ArrayIndex +Lambda( + ArrayIndex(arr, + Constant(0) + ) +) +---- CSCompiler.ArrayLength +Lambda( + ArrayLength(arr) +) +---- CSCompiler.ArrayMultipleIndex +Lambda( + ArrayIndex(arr, + Constant(5), + Constant(6) + ) +) +---- CSCompiler.ArrayOfMultidimensionalArray +Lambda( + NewArrayBounds( + typeof(string[,]), + Constant(5) + ) +) +---- CSCompiler.ArraySingleIndex +Lambda( + ArrayIndex(arr, + Constant(5) + ) +) +---- CSCompiler.BitwiseNot +Lambda( + Not(i) +) +---- CSCompiler.ClosedVariable +Lambda(s) +---- CSCompiler.Coalesce +Lambda( + Coalesce(s1, s2) +) +---- CSCompiler.CollectionTypeWithInitializer +Lambda( + ListInit( + New( + typeof(List).GetConstructor() + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("abcd") + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("efgh") + ) + ) +) +---- CSCompiler.CollectionTypeWithMultipleElementsInitializers +Lambda( + ListInit( + New( + typeof(Wrapper).GetConstructor() + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ab"), + Constant("cd") + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ef"), + Constant("gh") + ) + ) +) +---- CSCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +Lambda( + ListInit( + New( + typeof(Wrapper).GetConstructor() + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ab"), + Constant("cd") + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("ef") + ) + ) +) +---- CSCompiler.Conditional +Lambda( + Condition( + GreaterThan(i, + Constant(10) + ), + i, + Add(i, + Constant(10) + ) + ), + var i = Parameter( + typeof(int), + "i" + ) +) +---- CSCompiler.Convert +Lambda( + Convert(lst, + typeof(object) + ) +) +---- CSCompiler.DefaultRefType +Lambda( + Constant(null, + typeof(string) + ) +) +---- CSCompiler.DefaultValueType +Lambda( + Constant(0) +) +---- CSCompiler.Divide +Lambda( + Divide(x, y) +) +---- CSCompiler.Equal +Lambda( + Equal(i, j) +) +---- CSCompiler.EscapedString +Lambda( + Constant("\'\"\\\0\a\b\f\n\r\t\v") +) +---- CSCompiler.ExclusiveOrBitwise +Lambda( + ExclusiveOr(i, j) +) +---- CSCompiler.ExclusiveOrLogical +Lambda( + ExclusiveOr(b1, b2) +) +---- CSCompiler.ExtensionMethod0Arguments +Lambda( + Call( + typeof(Enumerable).GetMethod("Count"), + lst + ) +) +---- CSCompiler.ExtensionMethod1Argument +Lambda( + Call( + typeof(Enumerable).GetMethod("Take"), + lst, + Constant(1) + ) +) +---- CSCompiler.ExtensionMethod2Arguments +Lambda( + Call( + typeof(Enumerable).GetMethod("OrderBy"), + lst, + Lambda(x, + var x = Parameter( + typeof(string), + "x" + ) + ), + MakeMemberAccess(null, + typeof(StringComparer).GetProperty("OrdinalIgnoreCase") + ) + ) +) +---- CSCompiler.False +Lambda( + Constant(false) +) +---- CSCompiler.GreaterThan +Lambda( + GreaterThan(i, j) +) +---- CSCompiler.GreaterThanOrEqual +Lambda( + GreaterThanOrEqual(i, j) +) +---- CSCompiler.InstanceMember +Lambda( + MakeMemberAccess(s, + typeof(string).GetProperty("Length") + ) +) +---- CSCompiler.InstanceMethod0Arguments +Lambda( + Call(s, + typeof(object).GetMethod("ToString") + ) +) +---- CSCompiler.InstanceMethod1Argument +Lambda( + Call(s, + typeof(string).GetMethod("CompareTo"), + Constant("") + ) +) +---- CSCompiler.InstanceMethod2Arguments +Lambda( + Call(s, + typeof(string).GetMethod("IndexOf"), + Constant('a'), + Constant(2) + ) +) +---- CSCompiler.Integer +Lambda( + Constant(5) +) +---- CSCompiler.InterpolatedString +Lambda( + Call( + typeof(string).GetMethod("Format"), + Constant("{0}"), + Convert( + New( + typeof(DateTime).GetConstructor(), + Constant(2001), + Constant(1), + Constant(1) + ), + typeof(object) + ) + ) +) +---- CSCompiler.InvocationNoArguments +Lambda( + Invoke(del) +) +---- CSCompiler.InvocationOneArgument +Lambda( + Invoke(del, + Constant(5) + ) +) +---- CSCompiler.JaggedWithBounds +Lambda( + NewArrayBounds( + typeof(string[]), + Constant(5) + ) +) +---- CSCompiler.JaggedWithElementsExplicitType +Lambda( + NewArrayInit( + typeof(object[]), + NewArrayInit( + typeof(string), + Constant("ab"), + Constant("cd") + ), + NewArrayInit( + typeof(string), + Constant("ef"), + Constant("gh") + ) + ) +) +---- CSCompiler.JaggedWithElementsImplicitType +Lambda( + NewArrayInit( + typeof(string[]), + NewArrayInit( + typeof(string), + Constant("ab"), + Constant("cd") + ), + NewArrayInit( + typeof(string), + Constant("ef"), + Constant("gh") + ) + ) +) +---- CSCompiler.LeftShift +Lambda( + LeftShift(i, j) +) +---- CSCompiler.LessThan +Lambda( + LessThan(i, j) +) +---- CSCompiler.LessThanOrEqual +Lambda( + LessThanOrEqual(i, j) +) +---- CSCompiler.ListBinding +Lambda( + MemberInit( + New( + typeof(Node).GetConstructor() + ), + ListBind( + typeof(Node).GetProperty("Children"), + ElementInit( + typeof(ICollection).GetMethod("Add"), + New( + typeof(Node).GetConstructor() + ) + ), + ElementInit( + typeof(ICollection).GetMethod("Add"), + New( + typeof(Node).GetConstructor() + ) + ) + ) + ) +) +---- CSCompiler.LogicalNot +Lambda( + Not(b) +) +---- CSCompiler.MathPow +Lambda( + Call( + typeof(Math).GetMethod("Pow"), + x, y + ), + var x = Parameter( + typeof(double), + "x" + ), + var y = Parameter( + typeof(double), + "y" + ) +) +---- CSCompiler.MemberMemberBinding +Lambda( + MemberInit( + New( + typeof(Node).GetConstructor() + ), + MemberBind( + typeof(Node).GetProperty("Data"), + Bind( + typeof(NodeData).GetProperty("Name"), + Constant("abcd") + ) + ) + ) +) +---- CSCompiler.Modulo +Lambda( + Modulo(x, y) +) +---- CSCompiler.MultidimensionalArrayOfArray +Lambda( + NewArrayBounds( + typeof(string[]), + Constant(3), + Constant(2) + ) +) +---- CSCompiler.MultidimensionWithBounds +Lambda( + NewArrayBounds( + typeof(string), + Constant(2), + Constant(3) + ) +) +---- CSCompiler.Multiply +Lambda( + Multiply(x, y) +) +---- CSCompiler.NamedType +Lambda( + New( + typeof(Random).GetConstructor() + ) +) +---- CSCompiler.NamedTypeConstructorParameters +Lambda( + New( + typeof(Foo).GetConstructor(), + Constant("ijkl") + ) +) +---- CSCompiler.NamedTypeConstructorParametersWithInitializers +Lambda( + MemberInit( + New( + typeof(Foo).GetConstructor(), + Constant("ijkl") + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ), + Bind( + typeof(Foo).GetProperty("Baz"), + Constant("efgh") + ) + ) +) +---- CSCompiler.NamedTypeWithInitializer +Lambda( + MemberInit( + New( + typeof(Foo).GetConstructor() + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ) + ) +) +---- CSCompiler.NamedTypeWithInitializers +Lambda( + MemberInit( + New( + typeof(Foo).GetConstructor() + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ), + Bind( + typeof(Foo).GetProperty("Baz"), + Constant("efgh") + ) + ) +) +---- CSCompiler.Negate +Lambda( + Negate(i) +) +---- CSCompiler.NonInteger +Lambda( + Constant(7.32) +) +---- CSCompiler.NoParametersNonVoidReturn +Lambda( + Constant("abcd") +) +---- CSCompiler.NoParametersVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine") + ) +) +---- CSCompiler.NotEqual +Lambda( + NotEqual(i, j) +) +---- CSCompiler.Nothing +Lambda( + Constant(null, + typeof(string) + ) +) +---- CSCompiler.OneParameterNonVoidReturn +Lambda(s, + var s = Parameter( + typeof(string), + "s" + ) +) +---- CSCompiler.OneParameterVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + s + ), + var s = Parameter( + typeof(string), + "s" + ) +) +---- CSCompiler.OrBitwise +Lambda( + Or(i, j) +) +---- CSCompiler.OrElse +Lambda( + OrElse(b1, b2) +) +---- CSCompiler.OrLogical +Lambda( + Or(b1, b2) +) +---- CSCompiler.RightShift +Lambda( + RightShift(i, j) +) +---- CSCompiler.SingleDimensionInit +Lambda( + NewArrayInit( + typeof(string), + Constant("") + ) +) +---- CSCompiler.SingleDimensionInitExplicitType +Lambda( + NewArrayInit( + typeof(object), + Constant("") + ) +) +---- CSCompiler.SingleDimensionWithBounds +Lambda( + NewArrayBounds( + typeof(string), + Constant(5) + ) +) +---- CSCompiler.StaticMember +Lambda( + MakeMemberAccess(null, + typeof(string).GetField("Empty") + ) +) +---- CSCompiler.StaticMethod0Arguments +Lambda( + Call( + typeof(Dummy).GetMethod("DummyMethod") + ) +) +---- CSCompiler.StaticMethod1Argument +Lambda( + Call( + typeof(string).GetMethod("Intern"), + Constant("") + ) +) +---- CSCompiler.StaticMethod2Arguments +Lambda( + Call( + typeof(string).GetMethod("Join"), + Constant(","), + NewArrayInit( + typeof(string), + Constant("a"), + Constant("b") + ) + ) +) +---- CSCompiler.String +Lambda( + Constant("abcd") +) +---- CSCompiler.StringConcat +Lambda( + Call( + typeof(string).GetMethod("Concat"), + s1, s2 + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- CSCompiler.Subtract +Lambda( + Subtract(x, y) +) +---- CSCompiler.True +Lambda( + Constant(true) +) +---- CSCompiler.TwoParametersNonVoidReturn +Lambda( + Add(s1, s2), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- CSCompiler.TwoParametersVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + Add(s1, s2) + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- CSCompiler.Type +Lambda( + Constant( + typeof(string), + typeof(Type) + ) +) +---- CSCompiler.TypeAs +Lambda( + TypeAs(o, + typeof(string) + ) +) +---- CSCompiler.TypeCheck +Lambda( + TypeIs(o, + typeof(string) + ) +) +---- CSCompiler.TypeIndexer +Lambda( + Property(lst, + typeof(List).GetProperty("Item"), + Constant(3) + ) +) +---- FactoryMethods.Array +Constant(new[] { "abcd", 5, #Random }) +---- FactoryMethods.ArrayOfMultidimensionalArray +NewArrayBounds( + typeof(string[,]), + Constant(5) +) +---- FactoryMethods.BlockMultipleVariable +Block(new[] { i, s1 }, + Constant(true), + Constant(true) +) +---- FactoryMethods.BlockNoVariables +Block( + Constant(true), + Constant(true) +) +---- FactoryMethods.BlockSingleVariable +Block(new[] { i }, + Constant(true), + Constant(true) +) +---- FactoryMethods.CollectionTypeWithInitializer +ListInit( + New( + typeof(List).GetConstructor() + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("abcd") + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("efgh") + ) +) +---- FactoryMethods.CollectionTypeWithMultiElementInitializers +ListInit( + New( + typeof(Wrapper).GetConstructor() + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ab"), + Constant("cd") + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ef"), + Constant("gh") + ) +) +---- FactoryMethods.CollectionTypeWithSingleOrMultiElementInitializers +ListInit( + New( + typeof(Wrapper).GetConstructor() + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ab"), + Constant("cd") + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("ef") + ) +) +---- FactoryMethods.ConstructAdd +Add(x, y) +---- FactoryMethods.ConstructAddAssign +AddAssign(i, j) +---- FactoryMethods.ConstructAddAssignChecked +AddAssignChecked(i, j) +---- FactoryMethods.ConstructAddChecked +AddChecked(x, y) +---- FactoryMethods.ConstructAndAlso +AndAlso(b1, b2) +---- FactoryMethods.ConstructAndAssign +AndAssign(b1, b2) +---- FactoryMethods.ConstructAndBitwise +And(i, j) +---- FactoryMethods.ConstructAndLogical +And(b1, b2) +---- FactoryMethods.ConstructArrayIndex +ArrayIndex(arr, i) +---- FactoryMethods.ConstructArrayLength +ArrayLength(arr) +---- FactoryMethods.ConstructAssign +Assign(x, + Constant(5.2) +) +---- FactoryMethods.ConstructBitwiseNot +Not(i) +---- FactoryMethods.ConstructCatchMultiStatement +Catch(ex, + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) +) +---- FactoryMethods.ConstructCatchMultiStatementWithFilter +Catch(ex, + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ), + Constant(true) +) +---- FactoryMethods.ConstructCatchMultiStatementWithType +Catch( + typeof(InvalidCastException), + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) +) +---- FactoryMethods.ConstructCatchSingleStatement +Catch(ex, + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.ConstructCatchSingleStatementWithFilter +Catch(ex, + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(true) +) +---- FactoryMethods.ConstructCatchSingleStatementWithType +Catch( + typeof(InvalidCastException), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.ConstructCatchWithMultiStatementFilter +Catch(ex, + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Block( + Constant(true), + Constant(true) + ) +) +---- FactoryMethods.ConstructCoalesce +Coalesce(s1, s2) +---- FactoryMethods.ConstructConvert +Convert(arr, + typeof(object) +) +---- FactoryMethods.ConstructConvertChecked +ConvertChecked( + Constant(5), + typeof(float) +) +---- FactoryMethods.ConstructConvertCheckedForReferenceType +Convert(arr, + typeof(object) +) +---- FactoryMethods.ConstructDecrement +Decrement(i) +---- FactoryMethods.ConstructDivide +Divide(x, y) +---- FactoryMethods.ConstructDivideAssign +DivideAssign(i, j) +---- FactoryMethods.ConstructEmptyLabelTarget +Label("") +---- FactoryMethods.ConstructEqual +Equal(x, y) +---- FactoryMethods.ConstructExclusiveOrAssign +ExclusiveOrAssign(b1, b2) +---- FactoryMethods.ConstructExclusiveOrBitwise +ExclusiveOr(i, j) +---- FactoryMethods.ConstructExclusiveOrLogical +ExclusiveOr(b1, b2) +---- FactoryMethods.ConstructGetIndex +Dynamic( + #CSharpGetIndexBinder, + typeof(object), new[] { + obj, + Constant("key") + } +) +---- FactoryMethods.ConstructGetIndexMultipleKeys +Dynamic( + #CSharpGetIndexBinder, + typeof(object), new[] { + obj, + Constant("key"), + Constant(1) + } +) +---- FactoryMethods.ConstructGetMember +Dynamic( + #CSharpGetMemberBinder, + typeof(object), new[] { obj } +) +---- FactoryMethods.ConstructGreaterThan +GreaterThan(x, y) +---- FactoryMethods.ConstructGreaterThanOrEqual +GreaterThanOrEqual(x, y) +---- FactoryMethods.ConstructIncrement +Increment(i) +---- FactoryMethods.ConstructInvocationNoArguments +Dynamic( + #CSharpInvokeBinder, + typeof(object), new[] { obj } +) +---- FactoryMethods.ConstructInvocationWithArguments +Dynamic( + #CSharpInvokeBinder, + typeof(object), new[] { + obj, + Constant("arg1"), + Constant(15) + } +) +---- FactoryMethods.ConstructIsFalse +IsFalse(b1) +---- FactoryMethods.ConstructIsTrue +IsTrue(b1) +---- FactoryMethods.ConstructLabel +Block(new[] { i }, + Block(new[] { j }, + Constant(true), + Label( + Label("target"), + null + ), + Constant(true) + ) +) +---- FactoryMethods.ConstructLabel1 +Block(new[] { i }, + Block(new[] { j }, + Label( + Label("target"), + null + ), + Constant(true) + ) +) +---- FactoryMethods.ConstructLabelTarget +Label("target") +---- FactoryMethods.ConstructLeftShift +LeftShift(i, j) +---- FactoryMethods.ConstructLeftShiftAssign +LeftShiftAssign(i, j) +---- FactoryMethods.ConstructLessThan +LessThan(x, y) +---- FactoryMethods.ConstructLessThanOrEqual +LessThanOrEqual(x, y) +---- FactoryMethods.ConstructLogicalNot +Not(b1) +---- FactoryMethods.ConstructMemberInvocationNoArguments +Dynamic( + #CSharpInvokeMemberBinder, + typeof(object), new[] { obj } +) +---- FactoryMethods.ConstructMemberInvocationWithArguments +Dynamic( + #CSharpInvokeMemberBinder, + typeof(object), new[] { + obj, + Constant("arg1"), + Constant(15) + } +) +---- FactoryMethods.ConstructModulo +Modulo(x, y) +---- FactoryMethods.ConstructModuloAssign +ModuloAssign(i, j) +---- FactoryMethods.ConstructMultiply +Multiply(x, y) +---- FactoryMethods.ConstructMultiplyAssign +MultiplyAssign(i, j) +---- FactoryMethods.ConstructMultiplyAssignChecked +MultiplyAssignChecked(i, j) +---- FactoryMethods.ConstructMultiplyChecked +MultiplyChecked(x, y) +---- FactoryMethods.ConstructNegate +Negate(i) +---- FactoryMethods.ConstructNotEqual +NotEqual(x, y) +---- FactoryMethods.ConstructOrAssign +OrAssign(b1, b2) +---- FactoryMethods.ConstructOrBitwise +Or(i, j) +---- FactoryMethods.ConstructOrElse +OrElse(b1, b2) +---- FactoryMethods.ConstructOrLogical +Or(b1, b2) +---- FactoryMethods.ConstructPostDecrementAssign +PostDecrementAssign(i) +---- FactoryMethods.ConstructPostIncrementAssign +PostIncrementAssign(i) +---- FactoryMethods.ConstructPower +Power(x, y) +---- FactoryMethods.ConstructPowerAssign +PowerAssign(x, y) +---- FactoryMethods.ConstructPreDecrementAssign +PreDecrementAssign(i) +---- FactoryMethods.ConstructPreIncrementAssign +PreIncrementAssign(i) +---- FactoryMethods.ConstructReferenceEqual +Equal(lstString, lstString) +---- FactoryMethods.ConstructReferenceNotEqual +NotEqual(lstString, lstString) +---- FactoryMethods.ConstructRethrow +Throw(null) +---- FactoryMethods.ConstructRightShift +RightShift(i, j) +---- FactoryMethods.ConstructRightShiftAssign +RightShiftAssign(i, j) +---- FactoryMethods.ConstructRuntimeVariables +RuntimeVariables(x, s1) +---- FactoryMethods.ConstructSetIndex +Dynamic( + #CSharpSetIndexBinder, + typeof(object), new[] { + obj, + Constant(42), + Constant("key") + } +) +---- FactoryMethods.ConstructSetIndexMultipleKeys +Dynamic( + #CSharpSetIndexBinder, + typeof(object), new[] { + obj, + Constant(42), + Constant("key"), + Constant(1) + } +) +---- FactoryMethods.ConstructSetMember +Dynamic( + #CSharpSetMemberBinder, + typeof(object), new[] { + obj, + Constant(42) + } +) +---- FactoryMethods.ConstructSimpleCatch +Catch( + typeof(Exception), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.ConstructSubtract +Subtract(x, y) +---- FactoryMethods.ConstructSubtractAssign +SubtractAssign(i, j) +---- FactoryMethods.ConstructSubtractAssignChecked +SubtractAssignChecked(i, j) +---- FactoryMethods.ConstructSubtractChecked +SubtractChecked(x, y) +---- FactoryMethods.ConstructThrow +Throw( + Constant(#Random) +) +---- FactoryMethods.ConstructTryCatch +TryCatch( + Constant(true), + Catch( + typeof(Exception), + Constant(true) + ) +) +---- FactoryMethods.ConstructTryCatchFinally +TryCatchFinally( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Catch(ex, + Constant(true) + ) +) +---- FactoryMethods.ConstructTryFault +TryFault( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.ConstructTryFinally +TryFinally( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.ConstructTypeAs +TypeAs(arr, + typeof(object) +) +---- FactoryMethods.DateTime +Constant(#DateTime) +---- FactoryMethods.DifferentTypeForNodeAndValue +Constant(#List, + typeof(IEnumerable) +) +---- FactoryMethods.EmptyLoop +Loop( + Constant(true) +) +---- FactoryMethods.EmptyLoop1 +Loop( + Block( + Constant(true), + Constant(true) + ) +) +---- FactoryMethods.ExtensionMethod0Arguments +Call( + typeof(Enumerable).GetMethod("Count"), + lstString +) +---- FactoryMethods.ExtensionMethod1Argument +Call( + typeof(Enumerable).GetMethod("Take"), + lstString, + Constant(1) +) +---- FactoryMethods.ExtensionMethod2Arguments +Call( + typeof(Enumerable).GetMethod("OrderBy"), + lstString, + Lambda(x, + var x = Parameter( + typeof(string), + "x" + ) + ), + MakeMemberAccess(null, + typeof(StringComparer).GetProperty("OrdinalIgnoreCase") + ) +) +---- FactoryMethods.InstanceIndexer +MakeIndex(lstString, + typeof(List).GetProperty("Item"), + new[] { + Constant(0) + } +) +---- FactoryMethods.InstanceMember +MakeMemberAccess( + Constant(""), + typeof(string).GetProperty("Length") +) +---- FactoryMethods.InstanceMethod0Arguments +Call(s, + typeof(object).GetMethod("ToString") +) +---- FactoryMethods.InstanceMethod1Argument +Call(s, + typeof(string).GetMethod("CompareTo"), + Constant("") +) +---- FactoryMethods.InstanceMethod2Arguments +Call(s, + typeof(string).GetMethod("IndexOf"), + Constant('a'), + Constant(2) +) +---- FactoryMethods.JaggedWithBounds +NewArrayBounds( + typeof(string[]), + Constant(5) +) +---- FactoryMethods.JaggedWithElementsExplicitType +NewArrayInit( + typeof(object[]), + NewArrayInit( + typeof(string), + Constant("ab"), + Constant("cd") + ), + NewArrayInit( + typeof(string), + Constant("ef"), + Constant("gh") + ) +) +---- FactoryMethods.JaggedWithElementsImplicitType +NewArrayInit( + typeof(string[]), + NewArrayInit( + typeof(string), + Constant("ab"), + Constant("cd") + ), + NewArrayInit( + typeof(string), + Constant("ef"), + Constant("gh") + ) +) +---- FactoryMethods.LambdaMultilineBlockNonvoidReturn +Lambda( + Block( + Constant(true), + Constant(true) + ) +) +---- FactoryMethods.LambdaMultilineNestedBlockNonvoidReturn +Lambda( + Block( + Constant(true), + Block(new[] { s1, s2 }, + Constant(true), + Constant(true) + ) + ) +) +---- FactoryMethods.MakeArrayAccess +ArrayAccess(arr, + Constant(0) +) +---- FactoryMethods.MakeArrayIndex +ArrayIndex(arr, + Constant(0) +) +---- FactoryMethods.MakeArrayMultipleIndex +ArrayIndex(arr2d, + Constant(0), + Constant(1) +) +---- FactoryMethods.MakeBreak +Break( + Label("target") +) +---- FactoryMethods.MakeBreakWithValue +Break( + Label("target"), + Constant(5) +) +---- FactoryMethods.MakeByRefParameter +Lambda( + Constant(true), + var s4 = Parameter( + typeof(string).MakeByRef(), + "s4" + ) +) +---- FactoryMethods.MakeClearDebugInfo +ClearDebugInfo(#SymbolDocumentInfo) +---- FactoryMethods.MakeConditional +Condition( + GreaterThan(i, + Constant(10) + ), + i, + Add(i, + Constant(10) + ) +) +---- FactoryMethods.MakeContinue +Continue( + Label("target") +) +---- FactoryMethods.MakeDebugInfo +DebugInfo(#SymbolDocumentInfo, 1, 2, 3, 4) +---- FactoryMethods.MakeDefaultRefType +Default( + typeof(string) +) +---- FactoryMethods.MakeDefaultValueType +Default( + typeof(int) +) +---- FactoryMethods.MakeElementInit +ElementInit( + typeof(List).GetMethod("Add"), + Constant("abcd") +) +---- FactoryMethods.MakeElementInit2Arguments +ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("abcd"), + Constant("efgh") +) +---- FactoryMethods.MakeGotoWithoutValue +Goto( + Label("target") +) +---- FactoryMethods.MakeGotoWithValue +Goto( + Label("target"), + Constant(5) +) +---- FactoryMethods.MakeInvocation +Invoke( + Lambda( + Constant(5) + ) +) +---- FactoryMethods.MakeListBinding +ListBind( + typeof(Node).GetProperty("Children"), + ElementInit( + typeof(ICollection).GetMethod("Add"), + New( + typeof(Node).GetConstructor() + ) + ), + ElementInit( + typeof(ICollection).GetMethod("Add"), + New( + typeof(Node).GetConstructor() + ) + ) +) +---- FactoryMethods.MakeMemberBind +Bind( + typeof(DummyMember).GetProperty("Foo"), + Constant("abcd") +) +---- FactoryMethods.MakeMemberMemberBind +MemberBind( + typeof(Node).GetProperty("Data"), + Bind( + typeof(NodeData).GetProperty("Name"), + Constant("abcd") + ) +) +---- FactoryMethods.MakeQuoted +Block(new[] { x }, + Quote( + Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) + ) +) +---- FactoryMethods.MakeQuoted1 +Lambda( + Quote( + Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) + ) +) +---- FactoryMethods.MakeReturn +Return( + Label("target") +) +---- FactoryMethods.MakeReturnWithValue +Return( + Label("target"), + Constant(5) +) +---- FactoryMethods.MakeTypeCheck +TypeIs( + Constant(""), + typeof(string) +) +---- FactoryMethods.MakeTypeEqual +TypeEqual( + Constant(""), + typeof(IEnumerable) +) +---- FactoryMethods.MultidimensionalArrayOfArray +NewArrayBounds( + typeof(string[]), + Constant(3), + Constant(2) +) +---- FactoryMethods.MultidimensionWithBounds +NewArrayBounds( + typeof(string), + Constant(2), + Constant(3) +) +---- FactoryMethods.MultilineIfFalse +IfThenElse( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ) + ) +) +---- FactoryMethods.MultilineIfTrue +IfThen( + Constant(true), + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) +) +---- FactoryMethods.MultilineLambda +Lambda( + IfThen( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) +) +---- FactoryMethods.MultilineTestPart +Condition( + Block( + Constant(true), + Constant(true) + ), + MakeMemberAccess( + Constant("true"), + typeof(string).GetProperty("Length") + ), + MakeMemberAccess( + Constant("false"), + typeof(string).GetProperty("Length") + ) +) +---- FactoryMethods.MultilineTestPart1 +IfThen( + Block( + Constant(true), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.MultiValueSwitchCase +SwitchCase( + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ), + Constant(5), + Constant(6) +) +---- FactoryMethods.MultiValueSwitchCase1 +SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(5), + Constant(6) +) +---- FactoryMethods.NamedLambda +Lambda( + Add(s1, s2), + "name", new[] { + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) + } +) +---- FactoryMethods.NamedType +New( + typeof(Random).GetConstructor() +) +---- FactoryMethods.NamedTypeConstructorParameters +New( + typeof(Foo).GetConstructor(), + Constant("ijkl") +) +---- FactoryMethods.NamedTypeConstructorParametersWithInitializers +MemberInit( + New( + typeof(Foo).GetConstructor(), + Constant("ijkl") + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ), + Bind( + typeof(Foo).GetProperty("Baz"), + Constant("efgh") + ) +) +---- FactoryMethods.NamedTypeWithInitializer +MemberInit( + New( + typeof(Foo).GetConstructor() + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ) +) +---- FactoryMethods.NamedTypeWithInitializers +MemberInit( + New( + typeof(Foo).GetConstructor() + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ), + Bind( + typeof(Foo).GetProperty("Baz"), + Constant("efgh") + ) +) +---- FactoryMethods.NestedBlockInBlockSyntax +IfThen( + Constant(true), + Block( + Constant(true), + Block( + Constant(true), + Constant(true) + ), + Constant(true) + ) +) +---- FactoryMethods.NestedBlockInBlockSyntaxWithVariable +IfThen( + Constant(true), + Block( + Constant(true), + Block(new[] { s1 }, + Constant(true), + Constant(true) + ), + Constant(true) + ) +) +---- FactoryMethods.NestedBlockInTest +IfThen( + Block( + Constant(true), + Block( + Constant(true), + Constant(true) + ), + Constant(true) + ), + Constant(true) +) +---- FactoryMethods.NestedBlockInTestWithVariables +IfThen( + Block( + Constant(true), + Block(new[] { s1 }, + Constant(true), + Constant(true) + ), + Constant(true) + ), + Constant(true) +) +---- FactoryMethods.NestedElse +IfThenElse( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + IfThen( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) +) +---- FactoryMethods.NestedIfThen +IfThen( + Constant(true), + IfThen( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ) +) +---- FactoryMethods.NestedInlineBlock +Block( + Constant(true), + Block( + Constant(true), + Constant(true) + ), + Constant(true) +) +---- FactoryMethods.NestedInlineBlockWithVariable +Block( + Constant(true), + Block(new[] { s1 }, + Constant(true), + Constant(true) + ), + Constant(true) +) +---- FactoryMethods.NestedLambda +Lambda( + Lambda( + Add(s1, s2), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) + ) +) +---- FactoryMethods.NonVoidConditionalWithElse +Condition( + Constant(true), + MakeMemberAccess( + Constant("true"), + typeof(string).GetProperty("Length") + ), + MakeMemberAccess( + Constant("false"), + typeof(string).GetProperty("Length") + ) +) +---- FactoryMethods.NonVoidConditionalWithoutElse +Condition( + Constant(true), + MakeMemberAccess( + Constant("true"), + typeof(string).GetProperty("Length") + ), + Default( + typeof(int) + ) +) +---- FactoryMethods.NoParametersNonVoidReturn +Lambda( + Constant("abcd") +) +---- FactoryMethods.NoParametersVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine") + ) +) +---- FactoryMethods.OldTuple +Constant(("abcd", 5)) +---- FactoryMethods.OneParameterNonVoidReturn +Lambda(s, + var s = Parameter( + typeof(string), + "s" + ) +) +---- FactoryMethods.OneParameterVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + s + ), + var s = Parameter( + typeof(string), + "s" + ) +) +---- FactoryMethods.PropertyIndexer +MakeIndex(lstString, + typeof(List).GetProperty("Item"), + new[] { + Constant(0) + } +) +---- FactoryMethods.Random +Constant(#Random) +---- FactoryMethods.RuntimeVariablesWithinBlock +Block(new[] { s2 }, + Constant(true), + RuntimeVariables(x, s1) +) +---- FactoryMethods.SingleDimensionInit +NewArrayInit( + typeof(string), + Constant("") +) +---- FactoryMethods.SingleDimensionInitExplicitType +NewArrayInit( + typeof(object), + Constant("") +) +---- FactoryMethods.SingleDimensionWithBounds +NewArrayBounds( + typeof(string), + Constant(5) +) +---- FactoryMethods.SingleValueSwitchCase +SwitchCase( + Block( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) + ), + Constant(5) +) +---- FactoryMethods.SingleValueSwitchCase1 +SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(5) +) +---- FactoryMethods.StaticMember +MakeMemberAccess(null, + typeof(string).GetField("Empty") +) +---- FactoryMethods.StaticMethod0Arguments +Call( + typeof(Dummy).GetMethod("DummyMethod") +) +---- FactoryMethods.StaticMethod1Argument +Call( + typeof(string).GetMethod("Intern"), + Constant("") +) +---- FactoryMethods.StaticMethod2Arguments +Call( + typeof(string).GetMethod("Join"), + Constant(","), + NewArrayInit( + typeof(string), + Constant("a"), + Constant("b") + ) +) +---- FactoryMethods.StringConcat +Call( + typeof(string).GetMethod("Concat"), + s1, s2 +) +---- FactoryMethods.SwitchOnExpressionWithDefaultMultiStatement +Switch(i, + Block( + typeof(void), + Constant(true), + Constant(true) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(4) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ), + Constant(5) + ) +) +---- FactoryMethods.SwitchOnExpressionWithDefaultSingleStatement +Switch(i, + Empty(), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(4) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ), + Constant(5) + ) +) +---- FactoryMethods.SwitchOnExpressionWithoutDefault +Switch(i, + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(4) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ), + Constant(5) + ) +) +---- FactoryMethods.SwitchOnMultipleStatementsWithDefault +Switch( + Block(i, j), + Block( + typeof(void), + Constant(true), + Constant(true) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(4) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ), + Constant(5) + ) +) +---- FactoryMethods.SwitchOnMultipleStatementsWithoutDefault +Switch( + Block(i, j), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Constant(4) + ), + SwitchCase( + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ), + Constant(5) + ) +) +---- FactoryMethods.TimeSpan +Constant(#TimeSpan) +---- FactoryMethods.TwoParametersNonVoidReturn +Lambda( + Add(s1, s2), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- FactoryMethods.TwoParametersVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + Add(s1, s2) + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- FactoryMethods.Type +Constant( + typeof(string) +) +---- FactoryMethods.ValueTuple +Constant(("abcd", 5)) +---- FactoryMethods.VoidConditional1WithElse +IfThenElse( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ) +) +---- FactoryMethods.VoidConditional1WithoutElse +IfThen( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- FactoryMethods.VoidConditionalWithElse +IfThenElse( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(false) + ) +) +---- FactoryMethods.VoidConditionalWithoutElse +IfThen( + Constant(true), + Call( + typeof(Console).GetMethod("WriteLine"), + Constant(true) + ) +) +---- VBCompiler.Add +Lambda( + Add(x, y) +) +---- VBCompiler.AndAlso +Lambda( + AndAlso(b1, b2) +) +---- VBCompiler.AndBitwise +Lambda( + And(i, j) +) +---- VBCompiler.AndLogical +Lambda( + And(b1, b2) +) +---- VBCompiler.AnonymousType +Lambda( + New( + typeof({ string Bar, string Baz }).GetConstructor(), + Constant("abcd"), + Constant("efgh") + ) +) +---- VBCompiler.AnonymousTypeFromVariables +Lambda( + New( + typeof({ string Bar, string Baz }).GetConstructor(), + Bar, Baz + ) +) +---- VBCompiler.ArrayIndex +Lambda( + ArrayIndex(arr, + Constant(0) + ) +) +---- VBCompiler.ArrayLength +Lambda( + ArrayLength(arr) +) +---- VBCompiler.ArrayMultipleIndex +Lambda( + ArrayIndex(arr, + Constant(5), + Constant(6) + ) +) +---- VBCompiler.ArrayOfMultidimensionalArray +Lambda( + NewArrayBounds( + typeof(string[,]), + Constant(5) + ) +) +---- VBCompiler.ArraySingleIndex +Lambda( + ArrayIndex(arr, + Constant(5) + ) +) +---- VBCompiler.BitwiseNot +Lambda( + Not(i) +) +---- VBCompiler.ClosedVariable +Lambda(s) +---- VBCompiler.Coalesce +Lambda( + Coalesce(s1, s2) +) +---- VBCompiler.CObject +Lambda( + Convert(lst, + typeof(object) + ) +) +---- VBCompiler.CollectionTypeWithInitializer +Lambda( + ListInit( + New( + typeof(List).GetConstructor() + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("abcd") + ), + ElementInit( + typeof(List).GetMethod("Add"), + Constant("efgh") + ) + ) +) +---- VBCompiler.CollectionTypeWithMultipleElementsInitializers +Lambda( + ListInit( + New( + typeof(Wrapper).GetConstructor() + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ab"), + Constant("cd") + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ef"), + Constant("gh") + ) + ) +) +---- VBCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +Lambda( + ListInit( + New( + typeof(Wrapper).GetConstructor() + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ab"), + Constant("cd") + ), + ElementInit( + typeof(Wrapper).GetMethod("Add"), + Constant("ef") + ) + ) +) +---- VBCompiler.Conditional +Lambda( + Condition( + GreaterThan(i, + Constant(10) + ), + i, + AddChecked(i, + Constant(10) + ) + ), + var i = Parameter( + typeof(int), + "i" + ) +) +---- VBCompiler.ConstantNothingToObject +Lambda( + Constant(null) +) +---- VBCompiler.ConstantNothingToReferenceType +Lambda( + Constant(null, + typeof(string) + ) +) +---- VBCompiler.ConstantNothingToValueType +Lambda( + Constant(0) +) +---- VBCompiler.Convert +Lambda( + Convert(o, + typeof(Random) + ) +) +---- VBCompiler.DateTime +Lambda( + Constant(#DateTime) +) +---- VBCompiler.Divide +Lambda( + Divide(x, y) +) +---- VBCompiler.Equal +Lambda( + Equal(i, j) +) +---- VBCompiler.EscapedString +Lambda( + Constant("\"") +) +---- VBCompiler.ExclusiveOrBitwise +Lambda( + ExclusiveOr(i, j) +) +---- VBCompiler.ExclusiveOrLogical +Lambda( + ExclusiveOr(b1, b2) +) +---- VBCompiler.ExtensionMethod0Arguments +Lambda( + Call( + typeof(Enumerable).GetMethod("Distinct"), + lst + ) +) +---- VBCompiler.ExtensionMethod1Argument +Lambda( + Call( + typeof(Enumerable).GetMethod("Take"), + lst, + Constant(1) + ) +) +---- VBCompiler.ExtensionMethod2Arguments +Lambda( + Call( + typeof(Enumerable).GetMethod("OrderBy"), + lst, + Lambda(x, + var x = Parameter( + typeof(string), + "x" + ) + ), + comparer + ) +) +---- VBCompiler.False +Lambda( + Constant(false) +) +---- VBCompiler.GreaterThan +Lambda( + GreaterThan(i, j) +) +---- VBCompiler.GreaterThanOrEqual +Lambda( + GreaterThanOrEqual(i, j) +) +---- VBCompiler.InstanceMember +Lambda( + MakeMemberAccess(s, + typeof(string).GetProperty("Length") + ) +) +---- VBCompiler.InstanceMethod0Arguments +Lambda( + Call(s, + typeof(string).GetMethod("ToString") + ) +) +---- VBCompiler.InstanceMethod1Argument +Lambda( + Call(s, + typeof(string).GetMethod("CompareTo"), + Constant("") + ) +) +---- VBCompiler.InstanceMethod2Arguments +Lambda( + Call( + typeof(Enumerable).GetMethod("Contains"), + Convert(s, + typeof(IEnumerable) + ), + Constant('a'), + Convert( + MakeMemberAccess(null, + typeof(StringComparer).GetProperty("InvariantCultureIgnoreCase") + ), + typeof(IEqualityComparer) + ) + ) +) +---- VBCompiler.Integer +Lambda( + Constant(5) +) +---- VBCompiler.InterpolatedString +Lambda( + Call( + typeof(string).GetMethod("Format"), + Constant("{0}"), + Convert( + Constant(#DateTime), + typeof(object) + ) + ) +) +---- VBCompiler.InvocationNoArguments +Lambda( + Invoke(del) +) +---- VBCompiler.InvocationOneArgument +Lambda( + Invoke(del, + Constant(5) + ) +) +---- VBCompiler.JaggedWithBounds +Lambda( + NewArrayBounds( + typeof(string[]), + Constant(5) + ) +) +---- VBCompiler.JaggedWithElementsExplicitType +Lambda( + NewArrayInit( + typeof(object[]), + Convert( + NewArrayInit( + typeof(string), + Constant("ab"), + Constant("cd") + ), + typeof(object[]) + ), + Convert( + NewArrayInit( + typeof(string), + Constant("ef"), + Constant("gh") + ), + typeof(object[]) + ) + ) +) +---- VBCompiler.JaggedWithElementsImplicitType +Lambda( + NewArrayInit( + typeof(string[]), + NewArrayInit( + typeof(string), + Constant("ab"), + Constant("cd") + ), + NewArrayInit( + typeof(string), + Constant("ef"), + Constant("gh") + ) + ) +) +---- VBCompiler.JaggedWithElementsImplicitTypeInnerNonLiteral +Lambda( + NewArrayInit( + typeof(string[]), + arr1, arr2 + ) +) +---- VBCompiler.LeftShift +Lambda( + LeftShift(i, + And(j, + Constant(31) + ) + ) +) +---- VBCompiler.LessThan +Lambda( + LessThan(i, j) +) +---- VBCompiler.LessThanOrEqual +Lambda( + LessThanOrEqual(i, j) +) +---- VBCompiler.LogicalNot +Lambda( + Not(b) +) +---- VBCompiler.Modulo +Lambda( + Modulo(x, y) +) +---- VBCompiler.MultidimensionalArrayOfArray +Lambda( + NewArrayBounds( + typeof(string[]), + Constant(3), + Constant(2) + ) +) +---- VBCompiler.MultidimensionWithBounds +Lambda( + NewArrayBounds( + typeof(string), + Constant(2), + Constant(3) + ) +) +---- VBCompiler.Multiply +Lambda( + Multiply(x, y) +) +---- VBCompiler.NamedType +Lambda( + New( + typeof(Random).GetConstructor() + ) +) +---- VBCompiler.NamedTypeConstructorParameters +Lambda( + New( + typeof(Foo).GetConstructor(), + Constant("ijkl") + ) +) +---- VBCompiler.NamedTypeConstructorParametersWithInitializers +Lambda( + MemberInit( + New( + typeof(Foo).GetConstructor(), + Constant("ijkl") + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ), + Bind( + typeof(Foo).GetProperty("Baz"), + Constant("efgh") + ) + ) +) +---- VBCompiler.NamedTypeWithInitializer +Lambda( + MemberInit( + New( + typeof(Foo).GetConstructor() + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ) + ) +) +---- VBCompiler.NamedTypeWithInitializers +Lambda( + MemberInit( + New( + typeof(Foo).GetConstructor() + ), + Bind( + typeof(Foo).GetProperty("Bar"), + Constant("abcd") + ), + Bind( + typeof(Foo).GetProperty("Baz"), + Constant("efgh") + ) + ) +) +---- VBCompiler.Negate +Lambda( + NegateChecked(i) +) +---- VBCompiler.NonInteger +Lambda( + Constant(7.32) +) +---- VBCompiler.NoParametersNonVoidReturn +Lambda( + Constant("abcd") +) +---- VBCompiler.NoParametersVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine") + ) +) +---- VBCompiler.NotEqual +Lambda( + NotEqual(i, j) +) +---- VBCompiler.Nothing +Lambda( + Constant(null) +) +---- VBCompiler.NothingString +Lambda( + Constant(null, + typeof(string) + ) +) +---- VBCompiler.OneParameterNonVoidReturn +Lambda(s, + var s = Parameter( + typeof(string), + "s" + ) +) +---- VBCompiler.OneParameterVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + s + ), + var s = Parameter( + typeof(string), + "s" + ) +) +---- VBCompiler.OrBitwise +Lambda( + Or(i, j) +) +---- VBCompiler.OrElse +Lambda( + OrElse(b1, b2) +) +---- VBCompiler.OrLogical +Lambda( + Or(b1, b2) +) +---- VBCompiler.Power +Lambda( + Power(x, y) +) +---- VBCompiler.RightShift +Lambda( + RightShift(i, + And(j, + Constant(31) + ) + ) +) +---- VBCompiler.SingleDimensionInit +Lambda( + NewArrayInit( + typeof(string), + Constant("") + ) +) +---- VBCompiler.SingleDimensionInitExplicitType +Lambda( + NewArrayInit( + typeof(object), + Convert( + Constant(""), + typeof(object) + ) + ) +) +---- VBCompiler.SingleDimensionWithBounds +Lambda( + NewArrayBounds( + typeof(string), + Constant(5) + ) +) +---- VBCompiler.StaticMember +Lambda( + MakeMemberAccess(null, + typeof(string).GetField("Empty") + ) +) +---- VBCompiler.StaticMethod0Arguments +Lambda( + Call( + typeof(Dummy).GetMethod("DummyMethod") + ) +) +---- VBCompiler.StaticMethod1Argument +Lambda( + Call( + typeof(string).GetMethod("Intern"), + Constant("") + ) +) +---- VBCompiler.StaticMethod2Arguments +Lambda( + Call( + typeof(string).GetMethod("Join"), + Constant(","), arr + ) +) +---- VBCompiler.String +Lambda( + Constant("abcd") +) +---- VBCompiler.StringConcat +Lambda( + Call( + typeof(string).GetMethod("Concat"), + s1, s2 + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- VBCompiler.StringConcatOperator +Lambda( + Call( + typeof(string).GetMethod("Concat"), + s1, s2 + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- VBCompiler.StringConcatOperatorParamArray +Lambda( + Call( + typeof(string).GetMethod("Concat"), + NewArrayInit( + typeof(string), + s1, s2, s1, s2, s1, s2 + ) + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- VBCompiler.Subtract +Lambda( + Subtract(x, y) +) +---- VBCompiler.TimeSpan +Constant(#TimeSpan) +---- VBCompiler.True +Lambda( + Constant(true) +) +---- VBCompiler.TwoParametersNonVoidReturn +Lambda( + Call( + typeof(string).GetMethod("Concat"), + s1, s2 + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- VBCompiler.TwoParametersVoidReturn +Lambda( + Call( + typeof(Console).GetMethod("WriteLine"), + Call( + typeof(string).GetMethod("Concat"), + s1, s2 + ) + ), + var s1 = Parameter( + typeof(string), + "s1" + ), + var s2 = Parameter( + typeof(string), + "s2" + ) +) +---- VBCompiler.TypeAs +Lambda( + TypeAs(o, + typeof(string) + ) +) +---- VBCompiler.TypeCheck +Lambda( + TypeIs( + Constant(""), + typeof(string) + ) +) +---- VBCompiler.TypeIndexer +Lambda( + Property(lst, + typeof(List).GetProperty("Item"), + Constant(3) + ) +) +---- VBCompiler.VBDeclaredTypeIndexer +Lambda( + Property(x, + typeof(DummyWithDefault).GetProperty("Item"), + Constant(5) + ) +) +------ \ No newline at end of file diff --git a/Tests.DotNetCore/object notation-testdata.txt b/Tests.DotNetCore/object notation-testdata.txt new file mode 100644 index 0000000..46bdeaa --- /dev/null +++ b/Tests.DotNetCore/object notation-testdata.txt @@ -0,0 +1,8178 @@ +---- CSCompiler.Add +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_0), + Value = #<>c__DisplayClass35_0 + }, + Member = typeof(<>c__DisplayClass35_0).GetField("x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_0), + Value = #<>c__DisplayClass35_0 + }, + Member = typeof(<>c__DisplayClass35_0).GetField("y") + } + }, + ReturnType = typeof(double) +} +---- CSCompiler.AndAlso +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.AndAlso, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass11_0), + Value = #<>c__DisplayClass11_0 + }, + Member = typeof(<>c__DisplayClass11_0).GetField("b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass11_0), + Value = #<>c__DisplayClass11_0 + }, + Member = typeof(<>c__DisplayClass11_0).GetField("b2") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.AndBitwise +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.And, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass5_0), + Value = #<>c__DisplayClass5_0 + }, + Member = typeof(<>c__DisplayClass5_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass5_0), + Value = #<>c__DisplayClass5_0 + }, + Member = typeof(<>c__DisplayClass5_0).GetField("j") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.AndLogical +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.And, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass8_0), + Value = #<>c__DisplayClass8_0 + }, + Member = typeof(<>c__DisplayClass8_0).GetField("b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass8_0), + Value = #<>c__DisplayClass8_0 + }, + Member = typeof(<>c__DisplayClass8_0).GetField("b2") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.AnonymousType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func<{ string Bar, string Baz }>), + Body = new NewExpression { + Type = typeof({ string Bar, string Baz }), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + new ConstantExpression { + Type = typeof(string), + Value = "efgh" + } + }, + Constructor = typeof({ string Bar, string Baz }).GetConstructor(), + Members = #TrueReadOnlyCollection + }, + ReturnType = typeof({ string Bar, string Baz }) +} +---- CSCompiler.AnonymousTypeFromVariables +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func<{ string Bar, string Baz }>), + Body = new NewExpression { + Type = typeof({ string Bar, string Baz }), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass68_0), + Value = #<>c__DisplayClass68_0 + }, + Member = typeof(<>c__DisplayClass68_0).GetField("Bar") + }, + new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass68_0), + Value = #<>c__DisplayClass68_0 + }, + Member = typeof(<>c__DisplayClass68_0).GetField("Baz") + } + }, + Constructor = typeof({ string Bar, string Baz }).GetConstructor(), + Members = #TrueReadOnlyCollection + }, + ReturnType = typeof({ string Bar, string Baz }) +} +---- CSCompiler.ArrayIndex +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ArrayIndex, + Type = typeof(string), + Left = new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass22_0), + Value = #<>c__DisplayClass22_0 + }, + Member = typeof(<>c__DisplayClass22_0).GetField("arr") + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 0 + } + }, + ReturnType = typeof(string) +} +---- CSCompiler.ArrayLength +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.ArrayLength, + Type = typeof(int), + Operand = new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass83_0), + Value = #<>c__DisplayClass83_0 + }, + Member = typeof(<>c__DisplayClass83_0).GetField("arr") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.ArrayMultipleIndex +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Object = new MemberExpression { + Type = typeof(string[,]), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_29), + Value = #<>c__DisplayClass35_29 + }, + Member = typeof(<>c__DisplayClass35_29).GetField("arr") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + new ConstantExpression { + Type = typeof(int), + Value = 6 + } + }, + ArgumentCount = 2, + Method = typeof(string[,]).GetMethod("Get") + }, + ReturnType = typeof(string) +} +---- CSCompiler.ArrayOfMultidimensionalArray +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[][,]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } + }, + ReturnType = typeof(string[][,]) +} +---- CSCompiler.ArraySingleIndex +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ArrayIndex, + Type = typeof(string), + Left = new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_28), + Value = #<>c__DisplayClass35_28 + }, + Member = typeof(<>c__DisplayClass35_28).GetField("arr") + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + ReturnType = typeof(string) +} +---- CSCompiler.BitwiseNot +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Not, + Type = typeof(int), + Operand = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass86_0), + Value = #<>c__DisplayClass86_0 + }, + Member = typeof(<>c__DisplayClass86_0).GetField("i") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.ClosedVariable +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_27), + Value = #<>c__DisplayClass35_27 + }, + Member = typeof(<>c__DisplayClass35_27).GetField("s") + }, + ReturnType = typeof(string) +} +---- CSCompiler.Coalesce +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Coalesce, + Type = typeof(string), + Left = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass19_0), + Value = #<>c__DisplayClass19_0 + }, + Member = typeof(<>c__DisplayClass19_0).GetField("s1") + }, + Right = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass19_0), + Value = #<>c__DisplayClass19_0 + }, + Member = typeof(<>c__DisplayClass19_0).GetField("s2") + } + }, + ReturnType = typeof(string) +} +---- CSCompiler.CollectionTypeWithInitializer +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new ListInitExpression { + Type = typeof(List), + NewExpression = new NewExpression { + Type = typeof(List), + ArgumentCount = 0, + Constructor = typeof(List).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + } + } + }, + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "efgh" + } + } + } + } + }, + ReturnType = typeof(List) +} +---- CSCompiler.CollectionTypeWithMultipleElementsInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ListInitExpression { + Type = typeof(Wrapper), + NewExpression = new NewExpression { + Type = typeof(Wrapper), + ArgumentCount = 0, + Constructor = typeof(Wrapper).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } + }, + ReturnType = typeof(Wrapper) +} +---- CSCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ListInitExpression { + Type = typeof(Wrapper), + NewExpression = new NewExpression { + Type = typeof(Wrapper), + ArgumentCount = 0, + Constructor = typeof(Wrapper).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + } + } + } + } + }, + ReturnType = typeof(Wrapper) +} +---- CSCompiler.Conditional +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } + }, + Body = new ConditionalExpression { + Type = typeof(int), + Test = new BinaryExpression { + NodeType = ExpressionType.GreaterThan, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 10 + } + }, + IfTrue = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + IfFalse = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 10 + } + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.Convert +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass84_0), + Value = #<>c__DisplayClass84_0 + }, + Member = typeof(<>c__DisplayClass84_0).GetField("lst") + } + }, + ReturnType = typeof(object) +} +---- CSCompiler.DefaultRefType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string) + }, + ReturnType = typeof(string) +} +---- CSCompiler.DefaultValueType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(int), + Value = 0 + }, + ReturnType = typeof(int) +} +---- CSCompiler.Divide +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Divide, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass1_0), + Value = #<>c__DisplayClass1_0 + }, + Member = typeof(<>c__DisplayClass1_0).GetField("x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass1_0), + Value = #<>c__DisplayClass1_0 + }, + Member = typeof(<>c__DisplayClass1_0).GetField("y") + } + }, + ReturnType = typeof(double) +} +---- CSCompiler.Equal +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Equal, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass13_0), + Value = #<>c__DisplayClass13_0 + }, + Member = typeof(<>c__DisplayClass13_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass13_0), + Value = #<>c__DisplayClass13_0 + }, + Member = typeof(<>c__DisplayClass13_0).GetField("j") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.EscapedString +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "\'\"\\\0\a\b\f\n\r\t\v" + }, + ReturnType = typeof(string) +} +---- CSCompiler.ExclusiveOrBitwise +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ExclusiveOr, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass7_0), + Value = #<>c__DisplayClass7_0 + }, + Member = typeof(<>c__DisplayClass7_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass7_0), + Value = #<>c__DisplayClass7_0 + }, + Member = typeof(<>c__DisplayClass7_0).GetField("j") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.ExclusiveOrLogical +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ExclusiveOr, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass10_0), + Value = #<>c__DisplayClass10_0 + }, + Member = typeof(<>c__DisplayClass10_0).GetField("b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass10_0), + Value = #<>c__DisplayClass10_0 + }, + Member = typeof(<>c__DisplayClass10_0).GetField("b2") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.ExtensionMethod0Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(int), + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass49_0), + Value = #<>c__DisplayClass49_0 + }, + Member = typeof(<>c__DisplayClass49_0).GetField("lst") + } + }, + ArgumentCount = 1, + Method = typeof(Enumerable).GetMethod("Count") + }, + ReturnType = typeof(int) +} +---- CSCompiler.ExtensionMethod1Argument +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new MethodCallExpression { + Type = typeof(IEnumerable), + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass52_0), + Value = #<>c__DisplayClass52_0 + }, + Member = typeof(<>c__DisplayClass52_0).GetField("lst") + }, + new ConstantExpression { + Type = typeof(int), + Value = 1 + } + }, + ArgumentCount = 2, + Method = typeof(Enumerable).GetMethod("Take") + }, + ReturnType = typeof(IEnumerable) +} +---- CSCompiler.ExtensionMethod2Arguments +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new MethodCallExpression { + Type = typeof(IOrderedEnumerable), + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass55_0), + Value = #<>c__DisplayClass55_0 + }, + Member = typeof(<>c__DisplayClass55_0).GetField("lst") + }, + new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "x" + } + }, + Body = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "x" + }, + ReturnType = typeof(string) + }, + new MemberExpression { + Type = typeof(StringComparer), + Member = typeof(StringComparer).GetProperty("OrdinalIgnoreCase") + } + }, + ArgumentCount = 3, + Method = typeof(Enumerable).GetMethod("OrderBy") + }, + ReturnType = typeof(IOrderedEnumerable) +} +---- CSCompiler.False +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(bool), + Value = false + }, + ReturnType = typeof(bool) +} +---- CSCompiler.GreaterThan +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.GreaterThan, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass16_0), + Value = #<>c__DisplayClass16_0 + }, + Member = typeof(<>c__DisplayClass16_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass16_0), + Value = #<>c__DisplayClass16_0 + }, + Member = typeof(<>c__DisplayClass16_0).GetField("j") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.GreaterThanOrEqual +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.GreaterThanOrEqual, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass15_0), + Value = #<>c__DisplayClass15_0 + }, + Member = typeof(<>c__DisplayClass15_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass15_0), + Value = #<>c__DisplayClass15_0 + }, + Member = typeof(<>c__DisplayClass15_0).GetField("j") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.InstanceMember +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberExpression { + Type = typeof(int), + Expression = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_26), + Value = #<>c__DisplayClass35_26 + }, + Member = typeof(<>c__DisplayClass35_26).GetField("s") + }, + Member = typeof(string).GetProperty("Length") + }, + ReturnType = typeof(int) +} +---- CSCompiler.InstanceMethod0Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Object = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass47_0), + Value = #<>c__DisplayClass47_0 + }, + Member = typeof(<>c__DisplayClass47_0).GetField("s") + }, + ArgumentCount = 0, + Method = typeof(object).GetMethod("ToString") + }, + ReturnType = typeof(string) +} +---- CSCompiler.InstanceMethod1Argument +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(int), + Object = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass50_0), + Value = #<>c__DisplayClass50_0 + }, + Member = typeof(<>c__DisplayClass50_0).GetField("s") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("CompareTo") + }, + ReturnType = typeof(int) +} +---- CSCompiler.InstanceMethod2Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(int), + Object = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass53_0), + Value = #<>c__DisplayClass53_0 + }, + Member = typeof(<>c__DisplayClass53_0).GetField("s") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(char), + Value = 'a' + }, + new ConstantExpression { + Type = typeof(int), + Value = 2 + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("IndexOf") + }, + ReturnType = typeof(int) +} +---- CSCompiler.Integer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + ReturnType = typeof(int) +} +---- CSCompiler.InterpolatedString +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "{0}" + }, + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new NewExpression { + Type = typeof(DateTime), + ArgumentCount = 3, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 2001 + }, + new ConstantExpression { + Type = typeof(int), + Value = 1 + }, + new ConstantExpression { + Type = typeof(int), + Value = 1 + } + }, + Constructor = typeof(DateTime).GetConstructor() + } + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Format") + }, + ReturnType = typeof(string) +} +---- CSCompiler.InvocationNoArguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new InvocationExpression { + Type = typeof(int), + Expression = new MemberExpression { + Type = typeof(Func), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_24), + Value = #<>c__DisplayClass35_24 + }, + Member = typeof(<>c__DisplayClass35_24).GetField("del") + }, + ArgumentCount = 0 + }, + ReturnType = typeof(int) +} +---- CSCompiler.InvocationOneArgument +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new InvocationExpression { + Type = typeof(int), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Expression = new MemberExpression { + Type = typeof(Func), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_25), + Value = #<>c__DisplayClass35_25 + }, + Member = typeof(<>c__DisplayClass35_25).GetField("del") + }, + ArgumentCount = 1 + }, + ReturnType = typeof(int) +} +---- CSCompiler.JaggedWithBounds +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } + }, + ReturnType = typeof(string[][]) +} +---- CSCompiler.JaggedWithElementsExplicitType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(object[][]), + Expressions = new ReadOnlyCollection { + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } + }, + ReturnType = typeof(object[][]) +} +---- CSCompiler.JaggedWithElementsImplicitType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } + }, + ReturnType = typeof(string[][]) +} +---- CSCompiler.LeftShift +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.LeftShift, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass20_0), + Value = #<>c__DisplayClass20_0 + }, + Member = typeof(<>c__DisplayClass20_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass20_0), + Value = #<>c__DisplayClass20_0 + }, + Member = typeof(<>c__DisplayClass20_0).GetField("j") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.LessThan +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.LessThan, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass17_0), + Value = #<>c__DisplayClass17_0 + }, + Member = typeof(<>c__DisplayClass17_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass17_0), + Value = #<>c__DisplayClass17_0 + }, + Member = typeof(<>c__DisplayClass17_0).GetField("j") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.LessThanOrEqual +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.LessThanOrEqual, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass18_0), + Value = #<>c__DisplayClass18_0 + }, + Member = typeof(<>c__DisplayClass18_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass18_0), + Value = #<>c__DisplayClass18_0 + }, + Member = typeof(<>c__DisplayClass18_0).GetField("j") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.ListBinding +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Node), + NewExpression = new NewExpression { + Type = typeof(Node), + ArgumentCount = 0, + Constructor = typeof(Node).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberListBinding { + BindingType = MemberBindingType.ListBinding, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(ICollection).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new NewExpression { + Type = typeof(Node), + ArgumentCount = 0, + Constructor = typeof(Node).GetConstructor() + } + } + }, + new ElementInit { + AddMethod = typeof(ICollection).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new NewExpression { + Type = typeof(Node), + ArgumentCount = 0, + Constructor = typeof(Node).GetConstructor() + } + } + } + }, + Member = typeof(Node).GetProperty("Children") + } + } + }, + ReturnType = typeof(Node) +} +---- CSCompiler.LogicalNot +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Not, + Type = typeof(bool), + Operand = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass87_0), + Value = #<>c__DisplayClass87_0 + }, + Member = typeof(<>c__DisplayClass87_0).GetField("b") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.MathPow +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } + }, + Body = new MethodCallExpression { + Type = typeof(double), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } + }, + ArgumentCount = 2, + Method = typeof(Math).GetMethod("Pow") + }, + ReturnType = typeof(double) +} +---- CSCompiler.MemberMemberBinding +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Node), + NewExpression = new NewExpression { + Type = typeof(Node), + ArgumentCount = 0, + Constructor = typeof(Node).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberMemberBinding { + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(NodeData).GetProperty("Name") + } + }, + BindingType = MemberBindingType.MemberBinding, + Member = typeof(Node).GetProperty("Data") + } + } + }, + ReturnType = typeof(Node) +} +---- CSCompiler.Modulo +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Modulo, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass2_0), + Value = #<>c__DisplayClass2_0 + }, + Member = typeof(<>c__DisplayClass2_0).GetField("x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass2_0), + Value = #<>c__DisplayClass2_0 + }, + Member = typeof(<>c__DisplayClass2_0).GetField("y") + } + }, + ReturnType = typeof(double) +} +---- CSCompiler.MultidimensionalArrayOfArray +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[,][]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 3 + }, + new ConstantExpression { + Type = typeof(int), + Value = 2 + } + } + }, + ReturnType = typeof(string[,][]) +} +---- CSCompiler.MultidimensionWithBounds +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[,]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 2 + }, + new ConstantExpression { + Type = typeof(int), + Value = 3 + } + } + }, + ReturnType = typeof(string[,]) +} +---- CSCompiler.Multiply +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Multiply, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass3_0), + Value = #<>c__DisplayClass3_0 + }, + Member = typeof(<>c__DisplayClass3_0).GetField("x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass3_0), + Value = #<>c__DisplayClass3_0 + }, + Member = typeof(<>c__DisplayClass3_0).GetField("y") + } + }, + ReturnType = typeof(double) +} +---- CSCompiler.NamedType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewExpression { + Type = typeof(Random), + ArgumentCount = 0, + Constructor = typeof(Random).GetConstructor() + }, + ReturnType = typeof(Random) +} +---- CSCompiler.NamedTypeConstructorParameters +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ijkl" + } + }, + Constructor = typeof(Foo).GetConstructor() + }, + ReturnType = typeof(Foo) +} +---- CSCompiler.NamedTypeConstructorParametersWithInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ijkl" + } + }, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + }, + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "efgh" + }, + Member = typeof(Foo).GetProperty("Baz") + } + } + }, + ReturnType = typeof(Foo) +} +---- CSCompiler.NamedTypeWithInitializer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 0, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + } + } + }, + ReturnType = typeof(Foo) +} +---- CSCompiler.NamedTypeWithInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 0, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + }, + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "efgh" + }, + Member = typeof(Foo).GetProperty("Baz") + } + } + }, + ReturnType = typeof(Foo) +} +---- CSCompiler.Negate +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Negate, + Type = typeof(int), + Operand = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass85_0), + Value = #<>c__DisplayClass85_0 + }, + Member = typeof(<>c__DisplayClass85_0).GetField("i") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.NonInteger +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(double), + Value = 7.32 + }, + ReturnType = typeof(double) +} +---- CSCompiler.NoParametersNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + ReturnType = typeof(string) +} +---- CSCompiler.NoParametersVoidReturn +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + ArgumentCount = 0, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- CSCompiler.NotEqual +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.NotEqual, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass14_0), + Value = #<>c__DisplayClass14_0 + }, + Member = typeof(<>c__DisplayClass14_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass14_0), + Value = #<>c__DisplayClass14_0 + }, + Member = typeof(<>c__DisplayClass14_0).GetField("j") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.Nothing +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string) + }, + ReturnType = typeof(string) +} +---- CSCompiler.OneParameterNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + Body = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + }, + ReturnType = typeof(string) +} +---- CSCompiler.OneParameterVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- CSCompiler.OrBitwise +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Or, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass6_0), + Value = #<>c__DisplayClass6_0 + }, + Member = typeof(<>c__DisplayClass6_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass6_0), + Value = #<>c__DisplayClass6_0 + }, + Member = typeof(<>c__DisplayClass6_0).GetField("j") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.OrElse +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.OrElse, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass12_0), + Value = #<>c__DisplayClass12_0 + }, + Member = typeof(<>c__DisplayClass12_0).GetField("b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass12_0), + Value = #<>c__DisplayClass12_0 + }, + Member = typeof(<>c__DisplayClass12_0).GetField("b2") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.OrLogical +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Or, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass9_0), + Value = #<>c__DisplayClass9_0 + }, + Member = typeof(<>c__DisplayClass9_0).GetField("b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass9_0), + Value = #<>c__DisplayClass9_0 + }, + Member = typeof(<>c__DisplayClass9_0).GetField("b2") + } + }, + ReturnType = typeof(bool) +} +---- CSCompiler.RightShift +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.RightShift, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass21_0), + Value = #<>c__DisplayClass21_0 + }, + Member = typeof(<>c__DisplayClass21_0).GetField("i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass21_0), + Value = #<>c__DisplayClass21_0 + }, + Member = typeof(<>c__DisplayClass21_0).GetField("j") + } + }, + ReturnType = typeof(int) +} +---- CSCompiler.SingleDimensionInit +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + } + }, + ReturnType = typeof(string[]) +} +---- CSCompiler.SingleDimensionInitExplicitType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(object[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + } + }, + ReturnType = typeof(object[]) +} +---- CSCompiler.SingleDimensionWithBounds +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } + }, + ReturnType = typeof(string[]) +} +---- CSCompiler.StaticMember +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberExpression { + Type = typeof(string), + Member = typeof(string).GetField("Empty") + }, + ReturnType = typeof(string) +} +---- CSCompiler.StaticMethod0Arguments +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + ArgumentCount = 0, + Method = typeof(Dummy).GetMethod("DummyMethod") + }, + ReturnType = typeof(void) +} +---- CSCompiler.StaticMethod1Argument +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("Intern") + }, + ReturnType = typeof(string) +} +---- CSCompiler.StaticMethod2Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "," + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "a" + }, + new ConstantExpression { + Type = typeof(string), + Value = "b" + } + } + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Join") + }, + ReturnType = typeof(string) +} +---- CSCompiler.String +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + ReturnType = typeof(string) +} +---- CSCompiler.StringConcat +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- CSCompiler.Subtract +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Subtract, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass4_0), + Value = #<>c__DisplayClass4_0 + }, + Member = typeof(<>c__DisplayClass4_0).GetField("x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass4_0), + Value = #<>c__DisplayClass4_0 + }, + Member = typeof(<>c__DisplayClass4_0).GetField("y") + } + }, + ReturnType = typeof(double) +} +---- CSCompiler.True +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + ReturnType = typeof(bool) +} +---- CSCompiler.TwoParametersNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- CSCompiler.TwoParametersVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + Method = typeof(string).GetMethod("Concat") + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- CSCompiler.Type +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(Type), + Value = typeof(string) + }, + ReturnType = typeof(Type) +} +---- CSCompiler.TypeAs +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.TypeAs, + Type = typeof(string), + Operand = new MemberExpression { + Type = typeof(object), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass88_0), + Value = #<>c__DisplayClass88_0 + }, + Member = typeof(<>c__DisplayClass88_0).GetField("o") + } + }, + ReturnType = typeof(string) +} +---- CSCompiler.TypeCheck +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new TypeBinaryExpression { + NodeType = ExpressionType.TypeIs, + Type = typeof(bool), + Expression = new MemberExpression { + Type = typeof(object), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_23), + Value = #<>c__DisplayClass35_23 + }, + Member = typeof(<>c__DisplayClass35_23).GetField("o") + }, + TypeOperand = typeof(string) + }, + ReturnType = typeof(bool) +} +---- CSCompiler.TypeIndexer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Object = new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(<>c__DisplayClass35_30), + Value = #<>c__DisplayClass35_30 + }, + Member = typeof(<>c__DisplayClass35_30).GetField("lst") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 3 + } + }, + ArgumentCount = 1, + Method = typeof(List).GetMethod("get_Item") + }, + ReturnType = typeof(string) +} +---- FactoryMethods.Array +new ConstantExpression { + Type = typeof(object[]), + Value = new[] { "abcd", 5, #Random } +} +---- FactoryMethods.ArrayOfMultidimensionalArray +new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[][,]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } +} +---- FactoryMethods.BlockMultipleVariable +new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } +} +---- FactoryMethods.BlockNoVariables +new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } +} +---- FactoryMethods.BlockSingleVariable +new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } +} +---- FactoryMethods.CollectionTypeWithInitializer +new ListInitExpression { + Type = typeof(List), + NewExpression = new NewExpression { + Type = typeof(List), + ArgumentCount = 0, + Constructor = typeof(List).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + } + } + }, + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "efgh" + } + } + } + } +} +---- FactoryMethods.CollectionTypeWithMultiElementInitializers +new ListInitExpression { + Type = typeof(Wrapper), + NewExpression = new NewExpression { + Type = typeof(Wrapper), + ArgumentCount = 0, + Constructor = typeof(Wrapper).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } +} +---- FactoryMethods.CollectionTypeWithSingleOrMultiElementInitializers +new ListInitExpression { + Type = typeof(Wrapper), + NewExpression = new NewExpression { + Type = typeof(Wrapper), + ArgumentCount = 0, + Constructor = typeof(Wrapper).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + } + } + } + } +} +---- FactoryMethods.ConstructAdd +new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructAddAssign +new BinaryExpression { + NodeType = ExpressionType.AddAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructAddAssignChecked +new BinaryExpression { + NodeType = ExpressionType.AddAssignChecked, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructAddChecked +new BinaryExpression { + NodeType = ExpressionType.AddChecked, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructAndAlso +new BinaryExpression { + NodeType = ExpressionType.AndAlso, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructAndAssign +new BinaryExpression { + NodeType = ExpressionType.AndAssign, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructAndBitwise +new BinaryExpression { + NodeType = ExpressionType.And, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructAndLogical +new BinaryExpression { + NodeType = ExpressionType.And, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructArrayIndex +new BinaryExpression { + NodeType = ExpressionType.ArrayIndex, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructArrayLength +new UnaryExpression { + NodeType = ExpressionType.ArrayLength, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + } +} +---- FactoryMethods.ConstructAssign +new BinaryExpression { + NodeType = ExpressionType.Assign, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ConstantExpression { + Type = typeof(double), + Value = 5.2 + } +} +---- FactoryMethods.ConstructBitwiseNot +new UnaryExpression { + NodeType = ExpressionType.Not, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructCatchMultiStatement +new CatchBlock { + Variable = new ParameterExpression { + Type = typeof(Exception), + IsByRef = false, + Name = "ex" + }, + Body = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Test = typeof(Exception) +} +---- FactoryMethods.ConstructCatchMultiStatementWithFilter +new CatchBlock { + Variable = new ParameterExpression { + Type = typeof(Exception), + IsByRef = false, + Name = "ex" + }, + Filter = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + Body = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Test = typeof(Exception) +} +---- FactoryMethods.ConstructCatchMultiStatementWithType +new CatchBlock { + Body = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Test = typeof(InvalidCastException) +} +---- FactoryMethods.ConstructCatchSingleStatement +new CatchBlock { + Variable = new ParameterExpression { + Type = typeof(Exception), + IsByRef = false, + Name = "ex" + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Test = typeof(Exception) +} +---- FactoryMethods.ConstructCatchSingleStatementWithFilter +new CatchBlock { + Variable = new ParameterExpression { + Type = typeof(Exception), + IsByRef = false, + Name = "ex" + }, + Filter = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Test = typeof(Exception) +} +---- FactoryMethods.ConstructCatchSingleStatementWithType +new CatchBlock { + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Test = typeof(InvalidCastException) +} +---- FactoryMethods.ConstructCatchWithMultiStatementFilter +new CatchBlock { + Variable = new ParameterExpression { + Type = typeof(Exception), + IsByRef = false, + Name = "ex" + }, + Filter = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Test = typeof(Exception) +} +---- FactoryMethods.ConstructCoalesce +new BinaryExpression { + NodeType = ExpressionType.Coalesce, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } +} +---- FactoryMethods.ConstructConvert +new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + } +} +---- FactoryMethods.ConstructConvertChecked +new UnaryExpression { + NodeType = ExpressionType.ConvertChecked, + Type = typeof(float), + Operand = new ConstantExpression { + Type = typeof(int), + Value = 5 + } +} +---- FactoryMethods.ConstructConvertCheckedForReferenceType +new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + } +} +---- FactoryMethods.ConstructDecrement +new UnaryExpression { + NodeType = ExpressionType.Decrement, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructDivide +new BinaryExpression { + NodeType = ExpressionType.Divide, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructDivideAssign +new BinaryExpression { + NodeType = ExpressionType.DivideAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructEmptyLabelTarget +new LabelTarget { + Type = typeof(void) +} +---- FactoryMethods.ConstructEqual +new BinaryExpression { + NodeType = ExpressionType.Equal, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructExclusiveOrAssign +new BinaryExpression { + NodeType = ExpressionType.ExclusiveOrAssign, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructExclusiveOrBitwise +new BinaryExpression { + NodeType = ExpressionType.ExclusiveOr, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructExclusiveOrLogical +new BinaryExpression { + NodeType = ExpressionType.ExclusiveOr, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructGetIndex +#CSharpGetIndexBinder +---- FactoryMethods.ConstructGetIndexMultipleKeys +#CSharpGetIndexBinder +---- FactoryMethods.ConstructGetMember +#CSharpGetMemberBinder +---- FactoryMethods.ConstructGreaterThan +new BinaryExpression { + NodeType = ExpressionType.GreaterThan, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructGreaterThanOrEqual +new BinaryExpression { + NodeType = ExpressionType.GreaterThanOrEqual, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructIncrement +new UnaryExpression { + NodeType = ExpressionType.Increment, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructInvocationNoArguments +#CSharpInvokeBinder +---- FactoryMethods.ConstructInvocationWithArguments +#CSharpInvokeBinder +---- FactoryMethods.ConstructIsFalse +new UnaryExpression { + NodeType = ExpressionType.IsFalse, + Type = typeof(bool), + Operand = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + } +} +---- FactoryMethods.ConstructIsTrue +new UnaryExpression { + NodeType = ExpressionType.IsTrue, + Type = typeof(bool), + Operand = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + } +} +---- FactoryMethods.ConstructLabel +new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } + }, + Expressions = new ReadOnlyCollection { + new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new LabelExpression { + Type = typeof(void), + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } + }, + Result = new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new LabelExpression { + Type = typeof(void), + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } +} +---- FactoryMethods.ConstructLabel1 +new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } + }, + Expressions = new ReadOnlyCollection { + new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Expressions = new ReadOnlyCollection { + new LabelExpression { + Type = typeof(void), + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } + }, + Result = new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Expressions = new ReadOnlyCollection { + new LabelExpression { + Type = typeof(void), + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } +} +---- FactoryMethods.ConstructLabelTarget +new LabelTarget { + Type = typeof(void), + Name = "target" +} +---- FactoryMethods.ConstructLeftShift +new BinaryExpression { + NodeType = ExpressionType.LeftShift, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructLeftShiftAssign +new BinaryExpression { + NodeType = ExpressionType.LeftShiftAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructLessThan +new BinaryExpression { + NodeType = ExpressionType.LessThan, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructLessThanOrEqual +new BinaryExpression { + NodeType = ExpressionType.LessThanOrEqual, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructLogicalNot +new UnaryExpression { + NodeType = ExpressionType.Not, + Type = typeof(bool), + Operand = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + } +} +---- FactoryMethods.ConstructMemberInvocationNoArguments +#CSharpInvokeMemberBinder +---- FactoryMethods.ConstructMemberInvocationWithArguments +#CSharpInvokeMemberBinder +---- FactoryMethods.ConstructModulo +new BinaryExpression { + NodeType = ExpressionType.Modulo, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructModuloAssign +new BinaryExpression { + NodeType = ExpressionType.ModuloAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructMultiply +new BinaryExpression { + NodeType = ExpressionType.Multiply, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructMultiplyAssign +new BinaryExpression { + NodeType = ExpressionType.MultiplyAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructMultiplyAssignChecked +new BinaryExpression { + NodeType = ExpressionType.MultiplyAssignChecked, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructMultiplyChecked +new BinaryExpression { + NodeType = ExpressionType.MultiplyChecked, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructNegate +new UnaryExpression { + NodeType = ExpressionType.Negate, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructNotEqual +new BinaryExpression { + NodeType = ExpressionType.NotEqual, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructOrAssign +new BinaryExpression { + NodeType = ExpressionType.OrAssign, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructOrBitwise +new BinaryExpression { + NodeType = ExpressionType.Or, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructOrElse +new BinaryExpression { + NodeType = ExpressionType.OrElse, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructOrLogical +new BinaryExpression { + NodeType = ExpressionType.Or, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b1" + }, + Right = new ParameterExpression { + Type = typeof(bool), + IsByRef = false, + Name = "b2" + } +} +---- FactoryMethods.ConstructPostDecrementAssign +new UnaryExpression { + NodeType = ExpressionType.PostDecrementAssign, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructPostIncrementAssign +new UnaryExpression { + NodeType = ExpressionType.PostIncrementAssign, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructPower +new BinaryExpression { + NodeType = ExpressionType.Power, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + }, + Method = typeof(Math).GetMethod("Pow") +} +---- FactoryMethods.ConstructPowerAssign +new BinaryExpression { + NodeType = ExpressionType.PowerAssign, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + }, + Method = typeof(Math).GetMethod("Pow") +} +---- FactoryMethods.ConstructPreDecrementAssign +new UnaryExpression { + NodeType = ExpressionType.PreDecrementAssign, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructPreIncrementAssign +new UnaryExpression { + NodeType = ExpressionType.PreIncrementAssign, + Type = typeof(int), + Operand = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } +} +---- FactoryMethods.ConstructReferenceEqual +new BinaryExpression { + NodeType = ExpressionType.Equal, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + }, + Right = new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + } +} +---- FactoryMethods.ConstructReferenceNotEqual +new BinaryExpression { + NodeType = ExpressionType.NotEqual, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + }, + Right = new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + } +} +---- FactoryMethods.ConstructRethrow +new UnaryExpression { + NodeType = ExpressionType.Throw, + Type = typeof(void) +} +---- FactoryMethods.ConstructRightShift +new BinaryExpression { + NodeType = ExpressionType.RightShift, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructRightShiftAssign +new BinaryExpression { + NodeType = ExpressionType.RightShiftAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructRuntimeVariables +new RuntimeVariablesExpression { + Type = typeof(IRuntimeVariables), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + } +} +---- FactoryMethods.ConstructSetIndex +#CSharpSetIndexBinder +---- FactoryMethods.ConstructSetIndexMultipleKeys +#CSharpSetIndexBinder +---- FactoryMethods.ConstructSetMember +#CSharpSetMemberBinder +---- FactoryMethods.ConstructSimpleCatch +new CatchBlock { + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Test = typeof(Exception) +} +---- FactoryMethods.ConstructSubtract +new BinaryExpression { + NodeType = ExpressionType.Subtract, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructSubtractAssign +new BinaryExpression { + NodeType = ExpressionType.SubtractAssign, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructSubtractAssignChecked +new BinaryExpression { + NodeType = ExpressionType.SubtractAssignChecked, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } +} +---- FactoryMethods.ConstructSubtractChecked +new BinaryExpression { + NodeType = ExpressionType.SubtractChecked, + Type = typeof(double), + Left = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + Right = new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "y" + } +} +---- FactoryMethods.ConstructThrow +new UnaryExpression { + NodeType = ExpressionType.Throw, + Type = typeof(void), + Operand = new ConstantExpression { + Type = typeof(Random), + Value = #Random + } +} +---- FactoryMethods.ConstructTryCatch +new TryExpression { + Type = typeof(bool), + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + Handlers = new ReadOnlyCollection { + new CatchBlock { + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + Test = typeof(Exception) + } + } +} +---- FactoryMethods.ConstructTryCatchFinally +new TryExpression { + Type = typeof(bool), + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + Handlers = new ReadOnlyCollection { + new CatchBlock { + Variable = new ParameterExpression { + Type = typeof(Exception), + IsByRef = false, + Name = "ex" + }, + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + Test = typeof(Exception) + } + }, + Finally = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.ConstructTryFault +new TryExpression { + Type = typeof(void), + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Fault = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.ConstructTryFinally +new TryExpression { + Type = typeof(void), + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + Finally = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.ConstructTypeAs +new UnaryExpression { + NodeType = ExpressionType.TypeAs, + Type = typeof(object), + Operand = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + } +} +---- FactoryMethods.DateTime +new ConstantExpression { + Type = typeof(DateTime), + Value = #DateTime +} +---- FactoryMethods.DifferentTypeForNodeAndValue +new ConstantExpression { + Type = typeof(IEnumerable) +} +---- FactoryMethods.EmptyLoop +new LoopExpression { + Type = typeof(void), + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + } +} +---- FactoryMethods.EmptyLoop1 +new LoopExpression { + Type = typeof(void), + Body = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } +} +---- FactoryMethods.ExtensionMethod0Arguments +new MethodCallExpression { + Type = typeof(int), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + } + }, + ArgumentCount = 1, + Method = typeof(Enumerable).GetMethod("Count") +} +---- FactoryMethods.ExtensionMethod1Argument +new MethodCallExpression { + Type = typeof(IEnumerable), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + }, + new ConstantExpression { + Type = typeof(int), + Value = 1 + } + }, + ArgumentCount = 2, + Method = typeof(Enumerable).GetMethod("Take") +} +---- FactoryMethods.ExtensionMethod2Arguments +new MethodCallExpression { + Type = typeof(IOrderedEnumerable), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + }, + new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "x" + } + }, + Body = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "x" + }, + ReturnType = typeof(string) + }, + new MemberExpression { + Type = typeof(StringComparer), + Member = typeof(StringComparer).GetProperty("OrdinalIgnoreCase") + } + }, + ArgumentCount = 3, + Method = typeof(Enumerable).GetMethod("OrderBy") +} +---- FactoryMethods.InstanceIndexer +new IndexExpression { + Type = typeof(string), + Object = new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 0 + } + }, + ArgumentCount = 1, + Indexer = typeof(List).GetProperty("Item") +} +---- FactoryMethods.InstanceMember +new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(string) + }, + Member = typeof(string).GetProperty("Length") +} +---- FactoryMethods.InstanceMethod0Arguments +new MethodCallExpression { + Type = typeof(string), + Object = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + }, + ArgumentCount = 0, + Method = typeof(object).GetMethod("ToString") +} +---- FactoryMethods.InstanceMethod1Argument +new MethodCallExpression { + Type = typeof(int), + Object = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("CompareTo") +} +---- FactoryMethods.InstanceMethod2Arguments +new MethodCallExpression { + Type = typeof(int), + Object = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(char), + Value = 'a' + }, + new ConstantExpression { + Type = typeof(int), + Value = 2 + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("IndexOf") +} +---- FactoryMethods.JaggedWithBounds +new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } +} +---- FactoryMethods.JaggedWithElementsExplicitType +new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(object[][]), + Expressions = new ReadOnlyCollection { + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } +} +---- FactoryMethods.JaggedWithElementsImplicitType +new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } +} +---- FactoryMethods.LambdaMultilineBlockNonvoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ReturnType = typeof(bool) +} +---- FactoryMethods.LambdaMultilineNestedBlockNonvoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } + }, + Result = new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } + }, + ReturnType = typeof(bool) +} +---- FactoryMethods.MakeArrayAccess +new IndexExpression { + Type = typeof(string), + Object = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 0 + } + }, + ArgumentCount = 1 +} +---- FactoryMethods.MakeArrayIndex +new BinaryExpression { + NodeType = ExpressionType.ArrayIndex, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string[]), + IsByRef = false, + Name = "arr" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 0 + } +} +---- FactoryMethods.MakeArrayMultipleIndex +new MethodCallExpression { + Type = typeof(string), + Object = new ParameterExpression { + Type = typeof(string[,]), + IsByRef = false, + Name = "arr2d" + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 0 + }, + new ConstantExpression { + Type = typeof(int), + Value = 1 + } + }, + ArgumentCount = 2, + Method = typeof(string[,]).GetMethod("Get") +} +---- FactoryMethods.MakeBreak +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Break, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } +} +---- FactoryMethods.MakeBreakWithValue +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Break, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + }, + Value = new ConstantExpression { + Type = typeof(int), + Value = 5 + } +} +---- FactoryMethods.MakeByRefParameter +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Delegate2$1), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = true, + Name = "s4" + } + }, + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + ReturnType = typeof(bool) +} +---- FactoryMethods.MakeClearDebugInfo +new DebugInfoExpression { + Type = typeof(void), + Document = #SymbolDocumentInfo, + EndColumn = 0, + EndLine = 16707566, + IsClear = true, + StartColumn = 0, + StartLine = 16707566 +} +---- FactoryMethods.MakeConditional +new ConditionalExpression { + Type = typeof(int), + Test = new BinaryExpression { + NodeType = ExpressionType.GreaterThan, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 10 + } + }, + IfTrue = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + IfFalse = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 10 + } + } +} +---- FactoryMethods.MakeContinue +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Continue, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } +} +---- FactoryMethods.MakeDebugInfo +new DebugInfoExpression { + Type = typeof(void), + Document = #SymbolDocumentInfo, + EndColumn = 4, + EndLine = 3, + IsClear = false, + StartColumn = 2, + StartLine = 1 +} +---- FactoryMethods.MakeDefaultRefType +new DefaultExpression { + Type = typeof(string) +} +---- FactoryMethods.MakeDefaultValueType +new DefaultExpression { + Type = typeof(int) +} +---- FactoryMethods.MakeElementInit +new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + } + } +} +---- FactoryMethods.MakeElementInit2Arguments +new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + new ConstantExpression { + Type = typeof(string), + Value = "efgh" + } + } +} +---- FactoryMethods.MakeGotoWithoutValue +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Goto, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } +} +---- FactoryMethods.MakeGotoWithValue +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Goto, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + }, + Value = new ConstantExpression { + Type = typeof(int), + Value = 5 + } +} +---- FactoryMethods.MakeInvocation +new InvocationExpression { + Type = typeof(int), + Expression = new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + ReturnType = typeof(int) + }, + ArgumentCount = 0 +} +---- FactoryMethods.MakeListBinding +new MemberListBinding { + BindingType = MemberBindingType.ListBinding, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(ICollection).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new NewExpression { + Type = typeof(Node), + ArgumentCount = 0, + Constructor = typeof(Node).GetConstructor() + } + } + }, + new ElementInit { + AddMethod = typeof(ICollection).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new NewExpression { + Type = typeof(Node), + ArgumentCount = 0, + Constructor = typeof(Node).GetConstructor() + } + } + } + }, + Member = typeof(Node).GetProperty("Children") +} +---- FactoryMethods.MakeMemberBind +new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(DummyMember).GetProperty("Foo") +} +---- FactoryMethods.MakeMemberMemberBind +new MemberMemberBinding { + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(NodeData).GetProperty("Name") + } + }, + BindingType = MemberBindingType.MemberBinding, + Member = typeof(Node).GetProperty("Data") +} +---- FactoryMethods.MakeQuoted +new BlockExpression { + Type = typeof(Expression), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + } + }, + Expressions = new ReadOnlyCollection { + new UnaryExpression { + NodeType = ExpressionType.Quote, + Type = typeof(Expression), + Operand = new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) + } + } + }, + Result = new UnaryExpression { + NodeType = ExpressionType.Quote, + Type = typeof(Expression), + Operand = new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) + } + } +} +---- FactoryMethods.MakeQuoted1 +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new UnaryExpression { + NodeType = ExpressionType.Quote, + Type = typeof(Expression), + Operand = new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) + } + }, + ReturnType = typeof(Expression) +} +---- FactoryMethods.MakeReturn +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Return, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + } +} +---- FactoryMethods.MakeReturnWithValue +new GotoExpression { + Type = typeof(void), + Kind = GotoExpressionKind.Return, + Target = new LabelTarget { + Type = typeof(void), + Name = "target" + }, + Value = new ConstantExpression { + Type = typeof(int), + Value = 5 + } +} +---- FactoryMethods.MakeTypeCheck +new TypeBinaryExpression { + NodeType = ExpressionType.TypeIs, + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(string) + }, + TypeOperand = typeof(string) +} +---- FactoryMethods.MakeTypeEqual +new TypeBinaryExpression { + NodeType = ExpressionType.TypeEqual, + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(string) + }, + TypeOperand = typeof(IEnumerable) +} +---- FactoryMethods.MultidimensionalArrayOfArray +new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[,][]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 3 + }, + new ConstantExpression { + Type = typeof(int), + Value = 2 + } + } +} +---- FactoryMethods.MultidimensionWithBounds +new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[,]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 2 + }, + new ConstantExpression { + Type = typeof(int), + Value = 3 + } + } +} +---- FactoryMethods.MultilineIfFalse +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } +} +---- FactoryMethods.MultilineIfTrue +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.MultilineLambda +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } + }, + ReturnType = typeof(void) +} +---- FactoryMethods.MultilineTestPart +new ConditionalExpression { + Type = typeof(int), + Test = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + IfTrue = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(string), + Value = "true" + }, + Member = typeof(string).GetProperty("Length") + }, + IfFalse = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(string), + Value = "false" + }, + Member = typeof(string).GetProperty("Length") + } +} +---- FactoryMethods.MultilineTestPart1 +new ConditionalExpression { + Type = typeof(void), + Test = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.MultiValueSwitchCase +new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + new ConstantExpression { + Type = typeof(int), + Value = 6 + } + }, + Body = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } +} +---- FactoryMethods.MultiValueSwitchCase1 +new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + new ConstantExpression { + Type = typeof(int), + Value = 6 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.NamedLambda +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + Method = typeof(string).GetMethod("Concat") + }, + Name = "name", + ReturnType = typeof(string) +} +---- FactoryMethods.NamedType +new NewExpression { + Type = typeof(Random), + ArgumentCount = 0, + Constructor = typeof(Random).GetConstructor() +} +---- FactoryMethods.NamedTypeConstructorParameters +new NewExpression { + Type = typeof(Foo), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ijkl" + } + }, + Constructor = typeof(Foo).GetConstructor() +} +---- FactoryMethods.NamedTypeConstructorParametersWithInitializers +new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ijkl" + } + }, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + }, + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "efgh" + }, + Member = typeof(Foo).GetProperty("Baz") + } + } +} +---- FactoryMethods.NamedTypeWithInitializer +new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 0, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + } + } +} +---- FactoryMethods.NamedTypeWithInitializers +new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 0, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + }, + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "efgh" + }, + Member = typeof(Foo).GetProperty("Baz") + } + } +} +---- FactoryMethods.NestedBlockInBlockSyntax +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.NestedBlockInBlockSyntaxWithVariable +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.NestedBlockInTest +new ConditionalExpression { + Type = typeof(void), + Test = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + IfTrue = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.NestedBlockInTestWithVariables +new ConditionalExpression { + Type = typeof(void), + Test = new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + IfTrue = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.NestedElse +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } + } +} +---- FactoryMethods.NestedIfThen +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = , + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.NestedInlineBlock +new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } +} +---- FactoryMethods.NestedInlineBlockWithVariable +new BlockExpression { + Type = typeof(bool), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new BlockExpression { + Type = typeof(bool), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } +} +---- FactoryMethods.NestedLambda +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) + }, + ReturnType = typeof(Func) +} +---- FactoryMethods.NonVoidConditionalWithElse +new ConditionalExpression { + Type = typeof(int), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(string), + Value = "true" + }, + Member = typeof(string).GetProperty("Length") + }, + IfFalse = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(string), + Value = "false" + }, + Member = typeof(string).GetProperty("Length") + } +} +---- FactoryMethods.NonVoidConditionalWithoutElse +new ConditionalExpression { + Type = typeof(int), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(string), + Value = "true" + }, + Member = typeof(string).GetProperty("Length") + }, + IfFalse = new DefaultExpression { + Type = typeof(int) + } +} +---- FactoryMethods.NoParametersNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + ReturnType = typeof(string) +} +---- FactoryMethods.NoParametersVoidReturn +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + ArgumentCount = 0, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- FactoryMethods.OldTuple +new ConstantExpression { + Type = typeof(Tuple), + Value = ("abcd", 5) +} +---- FactoryMethods.OneParameterNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + Body = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + }, + ReturnType = typeof(string) +} +---- FactoryMethods.OneParameterVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- FactoryMethods.PropertyIndexer +new IndexExpression { + Type = typeof(string), + Object = new ParameterExpression { + Type = typeof(List), + IsByRef = false, + Name = "lstString" + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 0 + } + }, + ArgumentCount = 1, + Indexer = typeof(List).GetProperty("Item") +} +---- FactoryMethods.Random +new ConstantExpression { + Type = typeof(Random), + Value = #Random +} +---- FactoryMethods.RuntimeVariablesWithinBlock +new BlockExpression { + Type = typeof(IRuntimeVariables), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new RuntimeVariablesExpression { + Type = typeof(IRuntimeVariables), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + } + } + }, + Result = new RuntimeVariablesExpression { + Type = typeof(IRuntimeVariables), + Variables = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(double), + IsByRef = false, + Name = "x" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + } + } + } +} +---- FactoryMethods.SingleDimensionInit +new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + } +} +---- FactoryMethods.SingleDimensionInitExplicitType +new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(object[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + } +} +---- FactoryMethods.SingleDimensionWithBounds +new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } +} +---- FactoryMethods.SingleValueSwitchCase +new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + Result = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } +} +---- FactoryMethods.SingleValueSwitchCase1 +new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.StaticMember +new MemberExpression { + Type = typeof(string), + Member = typeof(string).GetField("Empty") +} +---- FactoryMethods.StaticMethod0Arguments +new MethodCallExpression { + Type = typeof(void), + ArgumentCount = 0, + Method = typeof(Dummy).GetMethod("DummyMethod") +} +---- FactoryMethods.StaticMethod1Argument +new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("Intern") +} +---- FactoryMethods.StaticMethod2Arguments +new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "," + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "a" + }, + new ConstantExpression { + Type = typeof(string), + Value = "b" + } + } + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Join") +} +---- FactoryMethods.StringConcat +new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Concat") +} +---- FactoryMethods.SwitchOnExpressionWithDefaultMultiStatement +new SwitchExpression { + Type = typeof(void), + SwitchValue = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Cases = new ReadOnlyCollection { + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 4 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } + }, + DefaultBody = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } +} +---- FactoryMethods.SwitchOnExpressionWithDefaultSingleStatement +new SwitchExpression { + Type = typeof(void), + SwitchValue = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Cases = new ReadOnlyCollection { + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 4 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } + }, + DefaultBody = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.SwitchOnExpressionWithoutDefault +new SwitchExpression { + Type = typeof(void), + SwitchValue = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Cases = new ReadOnlyCollection { + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 4 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } + } +} +---- FactoryMethods.SwitchOnMultipleStatementsWithDefault +new SwitchExpression { + Type = typeof(void), + SwitchValue = new BlockExpression { + Type = typeof(int), + Expressions = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Result = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Cases = new ReadOnlyCollection { + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 4 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } + }, + DefaultBody = new BlockExpression { + Type = typeof(void), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + }, + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + Result = new ConstantExpression { + Type = typeof(bool), + Value = true + } + } +} +---- FactoryMethods.SwitchOnMultipleStatementsWithoutDefault +new SwitchExpression { + Type = typeof(void), + SwitchValue = new BlockExpression { + Type = typeof(int), + Expressions = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Result = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "j" + } + }, + Cases = new ReadOnlyCollection { + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 4 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + }, + new SwitchCase { + TestValues = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } + } + } +} +---- FactoryMethods.TimeSpan +new ConstantExpression { + Type = typeof(TimeSpan), + Value = #TimeSpan +} +---- FactoryMethods.TwoParametersNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- FactoryMethods.TwoParametersVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(string), + Left = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + Right = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + Method = typeof(string).GetMethod("Concat") + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- FactoryMethods.Type +new ConstantExpression { + Type = typeof(RuntimeType), + Value = typeof(string) +} +---- FactoryMethods.ValueTuple +new ConstantExpression { + Type = typeof(ValueTuple), + Value = ("abcd", 5) +} +---- FactoryMethods.VoidConditional1WithElse +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.VoidConditional1WithoutElse +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- FactoryMethods.VoidConditionalWithElse +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = false + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + } +} +---- FactoryMethods.VoidConditionalWithoutElse +new ConditionalExpression { + Type = typeof(void), + Test = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + IfTrue = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(bool), + Value = true + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + IfFalse = new DefaultExpression { + Type = typeof(void) + } +} +---- VBCompiler.Add +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Add, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__2-0), + Value = #_Closure$__2-0 + }, + Member = typeof(_Closure$__2-0).GetField("$VB$Local_x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__2-0), + Value = #_Closure$__2-0 + }, + Member = typeof(_Closure$__2-0).GetField("$VB$Local_y") + } + }, + ReturnType = typeof(double) +} +---- VBCompiler.AndAlso +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.AndAlso, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__13-0), + Value = #_Closure$__13-0 + }, + Member = typeof(_Closure$__13-0).GetField("$VB$Local_b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__13-0), + Value = #_Closure$__13-0 + }, + Member = typeof(_Closure$__13-0).GetField("$VB$Local_b2") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.AndBitwise +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.And, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__7-0), + Value = #_Closure$__7-0 + }, + Member = typeof(_Closure$__7-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__7-0), + Value = #_Closure$__7-0 + }, + Member = typeof(_Closure$__7-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.AndLogical +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.And, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__10-0), + Value = #_Closure$__10-0 + }, + Member = typeof(_Closure$__10-0).GetField("$VB$Local_b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__10-0), + Value = #_Closure$__10-0 + }, + Member = typeof(_Closure$__10-0).GetField("$VB$Local_b2") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.AnonymousType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func<{ string Bar, string Baz }>), + Body = new NewExpression { + Type = typeof({ string Bar, string Baz }), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + new ConstantExpression { + Type = typeof(string), + Value = "efgh" + } + }, + Constructor = typeof({ string Bar, string Baz }).GetConstructor(), + Members = #TrueReadOnlyCollection + }, + ReturnType = typeof({ string Bar, string Baz }) +} +---- VBCompiler.AnonymousTypeFromVariables +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func<{ string Bar, string Baz }>), + Body = new NewExpression { + Type = typeof({ string Bar, string Baz }), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__71-0), + Value = #_Closure$__71-0 + }, + Member = typeof(_Closure$__71-0).GetField("$VB$Local_Bar") + }, + new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__71-0), + Value = #_Closure$__71-0 + }, + Member = typeof(_Closure$__71-0).GetField("$VB$Local_Baz") + } + }, + Constructor = typeof({ string Bar, string Baz }).GetConstructor(), + Members = #TrueReadOnlyCollection + }, + ReturnType = typeof({ string Bar, string Baz }) +} +---- VBCompiler.ArrayIndex +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ArrayIndex, + Type = typeof(string), + Left = new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(_Closure$__25-0), + Value = #_Closure$__25-0 + }, + Member = typeof(_Closure$__25-0).GetField("$VB$Local_arr") + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 0 + } + }, + ReturnType = typeof(string) +} +---- VBCompiler.ArrayLength +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.ArrayLength, + Type = typeof(int), + Operand = new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(_Closure$__85-0), + Value = #_Closure$__85-0 + }, + Member = typeof(_Closure$__85-0).GetField("$VB$Local_arr") + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.ArrayMultipleIndex +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Object = new MemberExpression { + Type = typeof(string[,]), + Expression = new ConstantExpression { + Type = typeof(_Closure$__29-0), + Value = #_Closure$__29-0 + }, + Member = typeof(_Closure$__29-0).GetField("$VB$Local_arr") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + new ConstantExpression { + Type = typeof(int), + Value = 6 + } + }, + ArgumentCount = 2, + Method = typeof(string[,]).GetMethod("Get") + }, + ReturnType = typeof(string) +} +---- VBCompiler.ArrayOfMultidimensionalArray +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[][,]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } + }, + ReturnType = typeof(string[][,]) +} +---- VBCompiler.ArraySingleIndex +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ArrayIndex, + Type = typeof(string), + Left = new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(_Closure$__28-0), + Value = #_Closure$__28-0 + }, + Member = typeof(_Closure$__28-0).GetField("$VB$Local_arr") + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + ReturnType = typeof(string) +} +---- VBCompiler.BitwiseNot +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Not, + Type = typeof(int), + Operand = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__89-0), + Value = #_Closure$__89-0 + }, + Member = typeof(_Closure$__89-0).GetField("$VB$Local_i") + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.ClosedVariable +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__50-0), + Value = #_Closure$__50-0 + }, + Member = typeof(_Closure$__50-0).GetField("$VB$Local_s") + }, + ReturnType = typeof(string) +} +---- VBCompiler.Coalesce +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Coalesce, + Type = typeof(string), + Left = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__21-0), + Value = #_Closure$__21-0 + }, + Member = typeof(_Closure$__21-0).GetField("$VB$Local_s1") + }, + Right = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__21-0), + Value = #_Closure$__21-0 + }, + Member = typeof(_Closure$__21-0).GetField("$VB$Local_s2") + } + }, + ReturnType = typeof(string) +} +---- VBCompiler.CObject +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(_Closure$__87-0), + Value = #_Closure$__87-0 + }, + Member = typeof(_Closure$__87-0).GetField("$VB$Local_lst") + } + }, + ReturnType = typeof(object) +} +---- VBCompiler.CollectionTypeWithInitializer +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new ListInitExpression { + Type = typeof(List), + NewExpression = new NewExpression { + Type = typeof(List), + ArgumentCount = 0, + Constructor = typeof(List).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "abcd" + } + } + }, + new ElementInit { + AddMethod = typeof(List).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "efgh" + } + } + } + } + }, + ReturnType = typeof(List) +} +---- VBCompiler.CollectionTypeWithMultipleElementsInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ListInitExpression { + Type = typeof(Wrapper), + NewExpression = new NewExpression { + Type = typeof(Wrapper), + ArgumentCount = 0, + Constructor = typeof(Wrapper).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } + }, + ReturnType = typeof(Wrapper) +} +---- VBCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ListInitExpression { + Type = typeof(Wrapper), + NewExpression = new NewExpression { + Type = typeof(Wrapper), + ArgumentCount = 0, + Constructor = typeof(Wrapper).GetConstructor() + }, + Initializers = new ReadOnlyCollection { + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 2, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new ElementInit { + AddMethod = typeof(Wrapper).GetMethod("Add"), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + } + } + } + } + }, + ReturnType = typeof(Wrapper) +} +---- VBCompiler.Conditional +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + } + }, + Body = new ConditionalExpression { + Type = typeof(int), + Test = new BinaryExpression { + NodeType = ExpressionType.GreaterThan, + Type = typeof(bool), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 10 + } + }, + IfTrue = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + IfFalse = new BinaryExpression { + NodeType = ExpressionType.AddChecked, + Type = typeof(int), + Left = new ParameterExpression { + Type = typeof(int), + IsByRef = false, + Name = "i" + }, + Right = new ConstantExpression { + Type = typeof(int), + Value = 10 + } + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.ConstantNothingToObject +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(object) + }, + ReturnType = typeof(object) +} +---- VBCompiler.ConstantNothingToReferenceType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string) + }, + ReturnType = typeof(string) +} +---- VBCompiler.ConstantNothingToValueType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(int), + Value = 0 + }, + ReturnType = typeof(int) +} +---- VBCompiler.Convert +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(Random), + Operand = new MemberExpression { + Type = typeof(object), + Expression = new ConstantExpression { + Type = typeof(_Closure$__86-0), + Value = #_Closure$__86-0 + }, + Member = typeof(_Closure$__86-0).GetField("$VB$Local_o") + } + }, + ReturnType = typeof(Random) +} +---- VBCompiler.DateTime +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(DateTime), + Value = #DateTime + }, + ReturnType = typeof(DateTime) +} +---- VBCompiler.Divide +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Divide, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__3-0), + Value = #_Closure$__3-0 + }, + Member = typeof(_Closure$__3-0).GetField("$VB$Local_x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__3-0), + Value = #_Closure$__3-0 + }, + Member = typeof(_Closure$__3-0).GetField("$VB$Local_y") + } + }, + ReturnType = typeof(double) +} +---- VBCompiler.Equal +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Equal, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__15-0), + Value = #_Closure$__15-0 + }, + Member = typeof(_Closure$__15-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__15-0), + Value = #_Closure$__15-0 + }, + Member = typeof(_Closure$__15-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.EscapedString +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "\"" + }, + ReturnType = typeof(string) +} +---- VBCompiler.ExclusiveOrBitwise +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ExclusiveOr, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__9-0), + Value = #_Closure$__9-0 + }, + Member = typeof(_Closure$__9-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__9-0), + Value = #_Closure$__9-0 + }, + Member = typeof(_Closure$__9-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.ExclusiveOrLogical +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.ExclusiveOr, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__12-0), + Value = #_Closure$__12-0 + }, + Member = typeof(_Closure$__12-0).GetField("$VB$Local_b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__12-0), + Value = #_Closure$__12-0 + }, + Member = typeof(_Closure$__12-0).GetField("$VB$Local_b2") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.ExtensionMethod0Arguments +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new MethodCallExpression { + Type = typeof(IEnumerable), + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(IEnumerable), + Expression = new ConstantExpression { + Type = typeof(_Closure$__55-0), + Value = #_Closure$__55-0 + }, + Member = typeof(_Closure$__55-0).GetField("$VB$Local_lst") + } + }, + ArgumentCount = 1, + Method = typeof(Enumerable).GetMethod("Distinct") + }, + ReturnType = typeof(IEnumerable) +} +---- VBCompiler.ExtensionMethod1Argument +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new MethodCallExpression { + Type = typeof(IEnumerable), + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(IEnumerable), + Expression = new ConstantExpression { + Type = typeof(_Closure$__58-0), + Value = #_Closure$__58-0 + }, + Member = typeof(_Closure$__58-0).GetField("$VB$Local_lst") + }, + new ConstantExpression { + Type = typeof(int), + Value = 1 + } + }, + ArgumentCount = 2, + Method = typeof(Enumerable).GetMethod("Take") + }, + ReturnType = typeof(IEnumerable) +} +---- VBCompiler.ExtensionMethod2Arguments +new Expression>> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func>), + Body = new MethodCallExpression { + Type = typeof(IOrderedEnumerable), + Arguments = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(IEnumerable), + Expression = new ConstantExpression { + Type = typeof(_Closure$__61-0), + Value = #_Closure$__61-0 + }, + Member = typeof(_Closure$__61-0).GetField("$VB$Local_lst") + }, + new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "x" + } + }, + Body = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "x" + }, + ReturnType = typeof(string) + }, + new MemberExpression { + Type = typeof(IComparer), + Expression = new ConstantExpression { + Type = typeof(_Closure$__61-0), + Value = #_Closure$__61-0 + }, + Member = typeof(_Closure$__61-0).GetField("$VB$Local_comparer") + } + }, + ArgumentCount = 3, + Method = typeof(Enumerable).GetMethod("OrderBy") + }, + ReturnType = typeof(IOrderedEnumerable) +} +---- VBCompiler.False +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(bool), + Value = false + }, + ReturnType = typeof(bool) +} +---- VBCompiler.GreaterThan +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.GreaterThan, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__18-0), + Value = #_Closure$__18-0 + }, + Member = typeof(_Closure$__18-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__18-0), + Value = #_Closure$__18-0 + }, + Member = typeof(_Closure$__18-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.GreaterThanOrEqual +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.GreaterThanOrEqual, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__17-0), + Value = #_Closure$__17-0 + }, + Member = typeof(_Closure$__17-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__17-0), + Value = #_Closure$__17-0 + }, + Member = typeof(_Closure$__17-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.InstanceMember +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberExpression { + Type = typeof(int), + Expression = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__49-0), + Value = #_Closure$__49-0 + }, + Member = typeof(_Closure$__49-0).GetField("$VB$Local_s") + }, + Member = typeof(string).GetProperty("Length") + }, + ReturnType = typeof(int) +} +---- VBCompiler.InstanceMethod0Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Object = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__53-0), + Value = #_Closure$__53-0 + }, + Member = typeof(_Closure$__53-0).GetField("$VB$Local_s") + }, + ArgumentCount = 0, + Method = typeof(string).GetMethod("ToString") + }, + ReturnType = typeof(string) +} +---- VBCompiler.InstanceMethod1Argument +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(int), + Object = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__56-0), + Value = #_Closure$__56-0 + }, + Member = typeof(_Closure$__56-0).GetField("$VB$Local_s") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("CompareTo") + }, + ReturnType = typeof(int) +} +---- VBCompiler.InstanceMethod2Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(bool), + Arguments = new ReadOnlyCollection { + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(IEnumerable), + Operand = new MemberExpression { + Type = typeof(string), + Expression = new ConstantExpression { + Type = typeof(_Closure$__59-0), + Value = #_Closure$__59-0 + }, + Member = typeof(_Closure$__59-0).GetField("$VB$Local_s") + } + }, + new ConstantExpression { + Type = typeof(char), + Value = 'a' + }, + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(IEqualityComparer), + Operand = new MemberExpression { + Type = typeof(StringComparer), + Member = typeof(StringComparer).GetProperty("InvariantCultureIgnoreCase") + } + } + }, + ArgumentCount = 3, + Method = typeof(Enumerable).GetMethod("Contains") + }, + ReturnType = typeof(bool) +} +---- VBCompiler.Integer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(int), + Value = 5 + }, + ReturnType = typeof(int) +} +---- VBCompiler.InterpolatedString +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "{0}" + }, + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new ConstantExpression { + Type = typeof(DateTime), + Value = #DateTime + } + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Format") + }, + ReturnType = typeof(string) +} +---- VBCompiler.InvocationNoArguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new InvocationExpression { + Type = typeof(int), + Expression = new MemberExpression { + Type = typeof({ MethodInfo Method, object Target }), + Expression = new ConstantExpression { + Type = typeof(_Closure$__97-0), + Value = #_Closure$__97-0 + }, + Member = typeof(_Closure$__97-0).GetField("$VB$Local_del") + }, + ArgumentCount = 0 + }, + ReturnType = typeof(int) +} +---- VBCompiler.InvocationOneArgument +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new InvocationExpression { + Type = typeof(int), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + Expression = new MemberExpression { + Type = typeof({ MethodInfo Method, object Target }), + Expression = new ConstantExpression { + Type = typeof(_Closure$__98-0), + Value = #_Closure$__98-0 + }, + Member = typeof(_Closure$__98-0).GetField("$VB$Local_del") + }, + ArgumentCount = 1 + }, + ReturnType = typeof(int) +} +---- VBCompiler.JaggedWithBounds +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } + }, + ReturnType = typeof(string[][]) +} +---- VBCompiler.JaggedWithElementsExplicitType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(object[][]), + Expressions = new ReadOnlyCollection { + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object[]), + Operand = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + } + }, + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object[]), + Operand = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } + } + }, + ReturnType = typeof(object[][]) +} +---- VBCompiler.JaggedWithElementsImplicitType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ab" + }, + new ConstantExpression { + Type = typeof(string), + Value = "cd" + } + } + }, + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ef" + }, + new ConstantExpression { + Type = typeof(string), + Value = "gh" + } + } + } + } + }, + ReturnType = typeof(string[][]) +} +---- VBCompiler.JaggedWithElementsImplicitTypeInnerNonLiteral +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[][]), + Expressions = new ReadOnlyCollection { + new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(_Closure$__80-0), + Value = #_Closure$__80-0 + }, + Member = typeof(_Closure$__80-0).GetField("$VB$Local_arr1") + }, + new MemberExpression { + Type = typeof(string[]), + Expression = new ConstantExpression { + Type = typeof(_Closure$__80-0), + Value = #_Closure$__80-0 + }, + Member = typeof(_Closure$__80-0).GetField("$VB$Local_arr2") + } + } + }, + ReturnType = typeof(string[][]) +} +---- VBCompiler.LeftShift +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.LeftShift, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__23-0), + Value = #_Closure$__23-0 + }, + Member = typeof(_Closure$__23-0).GetField("$VB$Local_i") + }, + Right = + }, + ReturnType = typeof(int) +} +---- VBCompiler.LessThan +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.LessThan, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__19-0), + Value = #_Closure$__19-0 + }, + Member = typeof(_Closure$__19-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__19-0), + Value = #_Closure$__19-0 + }, + Member = typeof(_Closure$__19-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.LessThanOrEqual +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.LessThanOrEqual, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__20-0), + Value = #_Closure$__20-0 + }, + Member = typeof(_Closure$__20-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__20-0), + Value = #_Closure$__20-0 + }, + Member = typeof(_Closure$__20-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.LogicalNot +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.Not, + Type = typeof(bool), + Operand = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__90-0), + Value = #_Closure$__90-0 + }, + Member = typeof(_Closure$__90-0).GetField("$VB$Local_b") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.Modulo +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Modulo, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__4-0), + Value = #_Closure$__4-0 + }, + Member = typeof(_Closure$__4-0).GetField("$VB$Local_x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__4-0), + Value = #_Closure$__4-0 + }, + Member = typeof(_Closure$__4-0).GetField("$VB$Local_y") + } + }, + ReturnType = typeof(double) +} +---- VBCompiler.MultidimensionalArrayOfArray +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[,][]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 3 + }, + new ConstantExpression { + Type = typeof(int), + Value = 2 + } + } + }, + ReturnType = typeof(string[,][]) +} +---- VBCompiler.MultidimensionWithBounds +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[,]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 2 + }, + new ConstantExpression { + Type = typeof(int), + Value = 3 + } + } + }, + ReturnType = typeof(string[,]) +} +---- VBCompiler.Multiply +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Multiply, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__5-0), + Value = #_Closure$__5-0 + }, + Member = typeof(_Closure$__5-0).GetField("$VB$Local_x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__5-0), + Value = #_Closure$__5-0 + }, + Member = typeof(_Closure$__5-0).GetField("$VB$Local_y") + } + }, + ReturnType = typeof(double) +} +---- VBCompiler.NamedType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewExpression { + Type = typeof(Random), + ArgumentCount = 0, + Constructor = typeof(Random).GetConstructor() + }, + ReturnType = typeof(Random) +} +---- VBCompiler.NamedTypeConstructorParameters +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ijkl" + } + }, + Constructor = typeof(Foo).GetConstructor() + }, + ReturnType = typeof(Foo) +} +---- VBCompiler.NamedTypeConstructorParametersWithInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 1, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "ijkl" + } + }, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + }, + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "efgh" + }, + Member = typeof(Foo).GetProperty("Baz") + } + } + }, + ReturnType = typeof(Foo) +} +---- VBCompiler.NamedTypeWithInitializer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 0, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + } + } + }, + ReturnType = typeof(Foo) +} +---- VBCompiler.NamedTypeWithInitializers +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberInitExpression { + Type = typeof(Foo), + NewExpression = new NewExpression { + Type = typeof(Foo), + ArgumentCount = 0, + Constructor = typeof(Foo).GetConstructor() + }, + Bindings = new ReadOnlyCollection { + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + Member = typeof(Foo).GetProperty("Bar") + }, + new MemberAssignment { + BindingType = MemberBindingType.Assignment, + Expression = new ConstantExpression { + Type = typeof(string), + Value = "efgh" + }, + Member = typeof(Foo).GetProperty("Baz") + } + } + }, + ReturnType = typeof(Foo) +} +---- VBCompiler.Negate +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.NegateChecked, + Type = typeof(int), + Operand = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__88-0), + Value = #_Closure$__88-0 + }, + Member = typeof(_Closure$__88-0).GetField("$VB$Local_i") + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.NonInteger +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(double), + Value = 7.32 + }, + ReturnType = typeof(double) +} +---- VBCompiler.NoParametersNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + ReturnType = typeof(string) +} +---- VBCompiler.NoParametersVoidReturn +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + ArgumentCount = 0, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- VBCompiler.NotEqual +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.NotEqual, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__16-0), + Value = #_Closure$__16-0 + }, + Member = typeof(_Closure$__16-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__16-0), + Value = #_Closure$__16-0 + }, + Member = typeof(_Closure$__16-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.Nothing +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(object) + }, + ReturnType = typeof(object) +} +---- VBCompiler.NothingString +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string) + }, + ReturnType = typeof(string) +} +---- VBCompiler.OneParameterNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + Body = new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + }, + ReturnType = typeof(string) +} +---- VBCompiler.OneParameterVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s" + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- VBCompiler.OrBitwise +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Or, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__8-0), + Value = #_Closure$__8-0 + }, + Member = typeof(_Closure$__8-0).GetField("$VB$Local_i") + }, + Right = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__8-0), + Value = #_Closure$__8-0 + }, + Member = typeof(_Closure$__8-0).GetField("$VB$Local_j") + } + }, + ReturnType = typeof(int) +} +---- VBCompiler.OrElse +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.OrElse, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__14-0), + Value = #_Closure$__14-0 + }, + Member = typeof(_Closure$__14-0).GetField("$VB$Local_b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__14-0), + Value = #_Closure$__14-0 + }, + Member = typeof(_Closure$__14-0).GetField("$VB$Local_b2") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.OrLogical +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Or, + Type = typeof(bool), + Left = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__11-0), + Value = #_Closure$__11-0 + }, + Member = typeof(_Closure$__11-0).GetField("$VB$Local_b1") + }, + Right = new MemberExpression { + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(_Closure$__11-0), + Value = #_Closure$__11-0 + }, + Member = typeof(_Closure$__11-0).GetField("$VB$Local_b2") + } + }, + ReturnType = typeof(bool) +} +---- VBCompiler.Power +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Power, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__26-0), + Value = #_Closure$__26-0 + }, + Member = typeof(_Closure$__26-0).GetField("$VB$Local_x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__26-0), + Value = #_Closure$__26-0 + }, + Member = typeof(_Closure$__26-0).GetField("$VB$Local_y") + }, + Method = typeof(Math).GetMethod("Pow") + }, + ReturnType = typeof(double) +} +---- VBCompiler.RightShift +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.RightShift, + Type = typeof(int), + Left = new MemberExpression { + Type = typeof(int), + Expression = new ConstantExpression { + Type = typeof(_Closure$__24-0), + Value = #_Closure$__24-0 + }, + Member = typeof(_Closure$__24-0).GetField("$VB$Local_i") + }, + Right = + }, + ReturnType = typeof(int) +} +---- VBCompiler.SingleDimensionInit +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + } + }, + ReturnType = typeof(string[]) +} +---- VBCompiler.SingleDimensionInitExplicitType +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(object[]), + Expressions = new ReadOnlyCollection { + new UnaryExpression { + NodeType = ExpressionType.Convert, + Type = typeof(object), + Operand = new ConstantExpression { + Type = typeof(string) + } + } + } + }, + ReturnType = typeof(object[]) +} +---- VBCompiler.SingleDimensionWithBounds +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new NewArrayExpression { + NodeType = ExpressionType.NewArrayBounds, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + } + }, + ReturnType = typeof(string[]) +} +---- VBCompiler.StaticMember +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MemberExpression { + Type = typeof(string), + Member = typeof(string).GetField("Empty") + }, + ReturnType = typeof(string) +} +---- VBCompiler.StaticMethod0Arguments +new Expression { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Body = new MethodCallExpression { + Type = typeof(void), + ArgumentCount = 0, + Method = typeof(Dummy).GetMethod("DummyMethod") + }, + ReturnType = typeof(void) +} +---- VBCompiler.StaticMethod1Argument +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string) + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("Intern") + }, + ReturnType = typeof(string) +} +---- VBCompiler.StaticMethod2Arguments +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(string), + Value = "," + }, + new MemberExpression { + Type = typeof(IEnumerable), + Expression = new ConstantExpression { + Type = typeof(_Closure$__60-0), + Value = #_Closure$__60-0 + }, + Member = typeof(_Closure$__60-0).GetField("$VB$Local_arr") + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Join") + }, + ReturnType = typeof(string) +} +---- VBCompiler.String +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(string), + Value = "abcd" + }, + ReturnType = typeof(string) +} +---- VBCompiler.StringConcat +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- VBCompiler.StringConcatOperator +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- VBCompiler.StringConcatOperatorParamArray +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new NewArrayExpression { + NodeType = ExpressionType.NewArrayInit, + Type = typeof(string[]), + Expressions = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + } + } + }, + ArgumentCount = 1, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- VBCompiler.Subtract +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new BinaryExpression { + NodeType = ExpressionType.Subtract, + Type = typeof(double), + Left = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__6-0), + Value = #_Closure$__6-0 + }, + Member = typeof(_Closure$__6-0).GetField("$VB$Local_x") + }, + Right = new MemberExpression { + Type = typeof(double), + Expression = new ConstantExpression { + Type = typeof(_Closure$__6-0), + Value = #_Closure$__6-0 + }, + Member = typeof(_Closure$__6-0).GetField("$VB$Local_y") + } + }, + ReturnType = typeof(double) +} +---- VBCompiler.TimeSpan +new ConstantExpression { + Type = typeof(TimeSpan), + Value = #TimeSpan +} +---- VBCompiler.True +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new ConstantExpression { + Type = typeof(bool), + Value = true + }, + ReturnType = typeof(bool) +} +---- VBCompiler.TwoParametersNonVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Concat") + }, + ReturnType = typeof(string) +} +---- VBCompiler.TwoParametersVoidReturn +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Action), + Parameters = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + Body = new MethodCallExpression { + Type = typeof(void), + Arguments = new ReadOnlyCollection { + new MethodCallExpression { + Type = typeof(string), + Arguments = new ReadOnlyCollection { + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s1" + }, + new ParameterExpression { + Type = typeof(string), + IsByRef = false, + Name = "s2" + } + }, + ArgumentCount = 2, + Method = typeof(string).GetMethod("Concat") + } + }, + ArgumentCount = 1, + Method = typeof(Console).GetMethod("WriteLine") + }, + ReturnType = typeof(void) +} +---- VBCompiler.TypeAs +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new UnaryExpression { + NodeType = ExpressionType.TypeAs, + Type = typeof(string), + Operand = new MemberExpression { + Type = typeof(object), + Expression = new ConstantExpression { + Type = typeof(_Closure$__91-0), + Value = #_Closure$__91-0 + }, + Member = typeof(_Closure$__91-0).GetField("$VB$Local_o") + } + }, + ReturnType = typeof(string) +} +---- VBCompiler.TypeCheck +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new TypeBinaryExpression { + NodeType = ExpressionType.TypeIs, + Type = typeof(bool), + Expression = new ConstantExpression { + Type = typeof(string) + }, + TypeOperand = typeof(string) + }, + ReturnType = typeof(bool) +} +---- VBCompiler.TypeIndexer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(string), + Object = new MemberExpression { + Type = typeof(List), + Expression = new ConstantExpression { + Type = typeof(_Closure$__30-0), + Value = #_Closure$__30-0 + }, + Member = typeof(_Closure$__30-0).GetField("$VB$Local_lst") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 3 + } + }, + ArgumentCount = 1, + Method = typeof(List).GetMethod("get_Item") + }, + ReturnType = typeof(string) +} +---- VBCompiler.VBDeclaredTypeIndexer +new Expression> { + NodeType = ExpressionType.Lambda, + Type = typeof(Func), + Body = new MethodCallExpression { + Type = typeof(int), + Object = new MemberExpression { + Type = typeof(DummyWithDefault), + Expression = new ConstantExpression { + Type = typeof(_Closure$__31-0), + Value = #_Closure$__31-0 + }, + Member = typeof(_Closure$__31-0).GetField("$VB$Local_x") + }, + Arguments = new ReadOnlyCollection { + new ConstantExpression { + Type = typeof(int), + Value = 5 + } + }, + ArgumentCount = 1, + Method = typeof(DummyWithDefault).GetMethod("get_Item") + }, + ReturnType = typeof(int) +} +------ \ No newline at end of file diff --git a/Tests.DotNetCore/visual basic-testdata.txt b/Tests.DotNetCore/visual basic-testdata.txt new file mode 100644 index 0000000..7883ce0 --- /dev/null +++ b/Tests.DotNetCore/visual basic-testdata.txt @@ -0,0 +1,73 @@ +---- CSCompiler.Add +Function() x + y +---- CSCompiler.AndAlso +Function() b1 AndAlso b2 +---- CSCompiler.AndBitwise +Function() i And j +---- CSCompiler.AndLogical +Function() b1 And b2 +---- CSCompiler.AnonymousType +Function() New With { + .Bar = "abcd", + .Baz = "efgh" +} +---- CSCompiler.AnonymousTypeFromVariables +Function() New With { + Bar, + Baz +} +---- CSCompiler.ArrayIndex +Function() arr(0) +---- CSCompiler.ArrayLength +Function() arr.Length +---- CSCompiler.ArrayMultipleIndex +Function() arr(5, 6) +---- CSCompiler.ArrayOfMultidimensionalArray +Function() New String(4)(,) {} +---- CSCompiler.ArraySingleIndex +Function() arr(5) +---- CSCompiler.BitwiseNot +Function() Not i +---- CSCompiler.ClosedVariable +Function() s +---- CSCompiler.Coalesce +Function() If(s1, s2) +---- CSCompiler.CollectionTypeWithInitializer +Function() New List(Of String) From { + "abcd", + "efgh" +} +---- CSCompiler.CollectionTypeWithMultipleElementsInitializers +Function() New Wrapper From { + { + "ab", + "cd" + }, + { + "ef", + "gh" + } +} +---- CSCompiler.CollectionTypeWithSingleOrMultipleElementsInitializers +Function() New Wrapper From { + { + "ab", + "cd" + }, + "ef" +} +---- CSCompiler.Conditional +Function(i As Integer) If(i > 10, i, i + 10) +---- CSCompiler.Convert +Function() CObj(lst) +---- CSCompiler.DefaultRefType +Function() Nothing +---- CSCompiler.DefaultValueType +Function() 0 +---- CSCompiler.Divide +Function() x / y +---- CSCompiler.Equal +Function() i = j +---- CSCompiler.EscapedString +Function() " +------ \ No newline at end of file diff --git a/Tests.Visualizer/Classes.cs b/Tests.Visualizer/Classes.cs index a04ccb9..996de79 100644 --- a/Tests.Visualizer/Classes.cs +++ b/Tests.Visualizer/Classes.cs @@ -1,11 +1,16 @@ -namespace ExpressionToString.Tests.Visualizer { +using System; + +namespace ExpressionToString.Tests.Visualizer { public class CompilerGenerated : CompilerGeneratedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o); + protected override void RunTest(object o, string objectName) => Runner.RunTest(o); } public class Constructed : ConstructedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o); + protected override void RunTest(object o, string objectName) => Runner.RunTest(o); } public class VBCompilerGenerated : VBCompilerGeneratedBase { - protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o); + [Obsolete] protected override void RunTest(object o, string csharp, string vb, string factoryMethods) => Runner.RunTest(o); + protected override void RunTest(object o, string objectName) => Runner.RunTest(o); } } diff --git a/_visualizerTests.VB/Module1.vb b/_visualizerTests.VB/Module1.vb index d019f77..1379536 100644 --- a/_visualizerTests.VB/Module1.vb +++ b/_visualizerTests.VB/Module1.vb @@ -7,11 +7,30 @@ Imports ExpressionToString Module Module1 Sub Main() - Dim s = "ab" - Dim expr As Expression(Of Func(Of Boolean)) = Function() s Like "ab*" + 'Dim s = "ab" + 'Dim expr As Expression(Of Func(Of Boolean)) = Function() s Like "ab*" + + 'Dim queryableSource As IQueryable(Of Person) = (New List(Of Person)).AsQueryable + 'Dim qry = queryableSource.Where(Function(x) x.LastName.StartsWith("D")) + + 'Dim expr = qry.GetType().GetProperty("Expression", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance).GetValue(qry) + + 'Dim expr As Expression(Of Func(Of Person, Boolean)) = Function(x) x.LastName.StartsWith("D") + + + Dim expr As Expression(Of Func(Of Integer, Boolean)) = Function(n As Integer) (n + 42 = 27) = ("abcd" <> String.Empty) + + + Dim visualizerHost = New VisualizerDevelopmentHost(expr, GetType(Visualizer), GetType(VisualizerDataObjectSource)) visualizerHost.ShowVisualizer() End Sub End Module + +Friend Class Person + Property LastName As String + Property FirstName As String + Property DateOfBirth As Date +End Class diff --git a/_visualizerTests/Program.cs b/_visualizerTests/Program.cs index e874b21..1eca872 100644 --- a/_visualizerTests/Program.cs +++ b/_visualizerTests/Program.cs @@ -85,7 +85,7 @@ static void Main(string[] args) { //Expression> expr = (n, exp) => new[] { Math.Pow(n, exp) }; //IQueryable personSource = null; - //Expression> expr = person => person.LastName.StartsWith("A"); + Expression> expr = person => person.LastName.StartsWith("A"); //var hour = Variable(typeof(int), "hour"); //var msg = Variable(typeof(string), "msg"); @@ -251,12 +251,15 @@ static void Main(string[] args) { //int secondVariable = 10; //Expression> expr = () => firstVariable + secondVariable; - var x = Parameter(typeof(int), "x"); - var y = Parameter(typeof(int), "y"); - var expr = Multiply( - Add(x, y), - Constant(5) - ); + //var x = Parameter(typeof(int), "x"); + //var y = Parameter(typeof(int), "y"); + //var expr = Multiply( + // Add(x, y), + // Constant(5) + //); + + + var visualizerHost = new VisualizerDevelopmentHost(expr, typeof(Visualizer), typeof(VisualizerDataObjectSource)); visualizerHost.ShowVisualizer();