示例#1
0
        public static AST.Parameter InContext(this AST.IVariable v, AST.VariableContext newContext, string newName = null)
        {
            var p = new AST.Parameter();

            p.Context = newContext;
            p.Name    = newName ?? v.Name;
            p.Type    = v.Type;
            p.IsArray = v.IsArray;

            var vp = v as AST.Parameter;

            if (vp != null)
            {
                p.HasDefaultValue = vp.HasDefaultValue;
                p.DefaultValue    = vp.DefaultValue;
            }

            return(p);
        }
示例#2
0
 public string VariableType(AST.IVariable arg, AST.VariableContext ctx, bool?abi = null)
 {
     return(VariableType(arg.InContext(ctx), abi));
 }