Beispiel #1
0
 protected private override void convertSpanImpl(ReadOnlySpan <int> src, Span <string> dst)
 {
     for (int i = 0; i < src.Length; i++)
     {
         dst[i] = ASint.AS_convertString(src[i]);
     }
 }
Beispiel #2
0
        internal static void paramListToString(MethodTraitParameter[] paramList, StringBuilder outStringBuilder)
        {
            for (int i = 0; i < paramList.Length; i++)
            {
                if (i != 0)
                {
                    outStringBuilder.Append(", ");
                }

                MethodTraitParameter p = paramList[i];
                outStringBuilder.Append(p.name ?? "param" + ASint.AS_convertString(i));
                if (p.isOptional && !p.hasDefault)
                {
                    outStringBuilder.Append('?');
                }

                outStringBuilder.Append(':').Append(' ');
                outStringBuilder.Append((p.type == null) ? "*" : p.type.name.ToString());

                if (!p.hasDefault)
                {
                    continue;
                }

                if (p.defaultValue.isUndefined)
                {
                    outStringBuilder.Append(" = undefined");
                }
                else if (p.defaultValue.isNull)
                {
                    outStringBuilder.Append(" = null");
                }
                else
                {
                    Class valType = p.defaultValue.AS_class !;
                    outStringBuilder.Append(" = ");

                    if (valType.tag == ClassTag.STRING)
                    {
                        string strval = p.defaultValue.ToString().Replace("\\", "\\\\").Replace("\"", "\\\"");
                        outStringBuilder.Append('"');
                        outStringBuilder.Append(strval);
                        outStringBuilder.Append('"');
                    }
                    else
                    {
                        outStringBuilder.Append(p.defaultValue.ToString());
                    }
                }
            }
        }
Beispiel #3
0
 public override string convert(int value) => ASint.AS_convertString(value);