private object EnsureCharArgument(string arg, ScopeChain scopeChain, string lambdaName, int index) { object target = null; if (BindHelper.IsDoubleQuoted(arg) || BindHelper.IsSingleQuoted(arg)) { target = arg.Substring(1, (arg.Length - 2)); } else { target = BindHelper.ResolveBindTarget(arg, this, scopeChain); this.EnsureArgumentType(arg, target, TypeCode.Char, lambdaName, index); } return(target); }
private object EnsureDateTimeArgument(string arg, ScopeChain scopeChain, string lambdaName, int index) { object target = null; if (BindHelper.IsDoubleQuoted(arg) || BindHelper.IsSingleQuoted(arg)) { arg = arg.Substring(1, (arg.Length - 2)); if (!DateTime.TryParse(arg, out DateTime dt)) { throw new MergeException(this.FormatExceptionMessageBuilder(lambdaName, arg, index, TypeCode.DateTime)); } return(dt); } else { target = BindHelper.ResolveBindTarget(arg, this, scopeChain); this.EnsureArgumentType(arg, target, TypeCode.DateTime, lambdaName, index); } return(target); }