Ejemplo n.º 1
0
        static string GetArgString(Definitions.ParamDefinition p, int i)
        {
            string modify    = GetModifyString(p);
            string paramName = !string.IsNullOrEmpty(p.CSharpName) ? NamedTool.VarName(p.CSharpName) : "p" + i;

            return(modify + paramName);
        }
Ejemplo n.º 2
0
 private static string GetModifyString(Definitions.ParamDefinition p)
 {
     return(p.Modify switch
     {
         Definitions.ParamDefinition.ModifyType.None => "",
         Definitions.ParamDefinition.ModifyType.Out => "out ",
         Definitions.ParamDefinition.ModifyType.Ref => "ref ",
         Definitions.ParamDefinition.ModifyType.In => "in ",
         _ => throw new InvalidOperationException(),
     });
Ejemplo n.º 3
0
        static string GetParamString(Definitions.ParamDefinition p, int i)
        {
            string modify = GetModifyString(p);
            var    sb     = new StringBuilder();

            if (p.Attrs.Length > 0)
            {
                sb.Append($"[{string.Join(", ", p.Attrs)}] ");
            }
            sb.Append(modify).Append(p.Type.CSharpName).Append(' ').Append(NamedTool.VarName(p.CSharpName));
            return(sb.ToString());
        }
Ejemplo n.º 4
0
 protected virtual void VisitFunctionParam(Definitions.FunctionDefinition function, Definitions.ParamDefinition param)
 {
 }
Ejemplo n.º 5
0
 protected virtual void VisitDelegateParam(Definitions.DelegateDefinition @delegate, Definitions.ParamDefinition param)
 {
 }