Exemplo n.º 1
0
 public async Task <object?> Visit(Expression value, string filePath)
 {
     return(value switch
     {
         LiteralExpression lit => lit.Value,
         CallExpression cal =>
         await _functionExecutor.Call(cal.Function, filePath, await Visit(cal.Arguments, filePath).ConfigureAwait(false)).ConfigureAwait(false),
         SymbolExpression sym =>
         await _symbolEvaluator.Evaluate(filePath, sym, this).ConfigureAwait(false),
         FormattedExpression frm =>
         await Visit(frm.Expression, filePath).ConfigureAwait(false) switch
         {
             IFormattable x => x.ToString(frm.Formatter.Format, frm.Formatter.Invariant ? CultureInfo.InvariantCulture : FormatProvider),
             _ => throw new NotImplementedException()
         },