Exemplo n.º 1
0
            public static IApiMethodBuilderResult BuildHelper(Call call, ExpressionBuilderParams p,
                                                              FunctionCallStatement functionCallStatement)
            {
                call.AssertParameters(p, functionCallStatement.Parameters);

                var parameter = functionCallStatement.Parameters[0];

                p.FormatString = false;

                var transpiler = p.Context.GetEvaluationTranspilerForStatement(parameter);
                var result     = transpiler.GetExpression(p, parameter);

                if (!result.TypeDescriptor.IsString())
                {
                    throw ThrowInvalidParameterType(result);
                }

                return(new ApiMethodBuilderRawResult(new ExpressionResult(
                                                         call.TypeDescriptor,
                                                         $"`{result.Expression}`",
                                                         result.Template
                                                         )));
            }