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); }
public string VariableType(AST.IVariable arg, AST.VariableContext ctx, bool?abi = null) { return(VariableType(arg.InContext(ctx), abi)); }