Exemplo n.º 1
0
            internal string CreateParamListString()
            {
                if (usedPar.Count == 0)
                {
                    return(usedIt ? $"({LuaWriter.GetLambdaImplicitIterName()})" : "()");
                }
                int           num  = usedPar.Max();
                StringBuilder sb   = new("(");
                var           pars = Enumerable.Range(1, num).Select(index => usedPar.Contains(index) ? LuaWriter.GetLambdaImplicitParamName(index) : "_").ToArray();

                if (pars.Length > 0)
                {
                    sb.Append(pars[0]);
                    foreach (var par in pars.Skip(1))
                    {
                        sb.Append(", ");
                        sb.Append(par);
                    }
                }
                sb.Append(")");
                return(sb.ToString());
            }