Allows to implicitly access this identifier set either as a Variable or passed as a Parameter to have more concise expression.
In other word an emulation of this implicit argument passed to a method call.
const string Name = "John";
var context = new KeyValuePair<string, string>(nameof(Name), Name);
var interpreter = new Interpreter().SetVariable("this", context);
Assert.AreEqual(Name, interpreter.Eval("this.Value"));
Assert.AreEqual(Name, interpreter.Eval("Value"));
or
const string Name = "John";
var context = new KeyValuePair<string, string>(nameof(Name), Name);
var parameter = new Parameter("this", context.GetType());
var interpreter = new Interpreter();
Assert.AreEqual(Name, interpreter.Parse("this.Value", parameter).Invoke(context));
Assert.AreEqual(Name, interpreter.Parse("Value", parameter).Invoke(context));
Allows to implicitly access
this
identifier set either as a Variable or passed as a Parameter to have more concise expression.In other word an emulation of
this
implicit argument passed to a method call.or
https://github.com/dynamicexpresso/DynamicExpresso/issues/232