public bool ArgumentMatchesType(VsnArgument arg, VsnArgType type) { switch (type) { case VsnArgType.numberArg: return(arg.GetType() == typeof(VsnNumber) || arg.GetType() == typeof(VsnReference)); case VsnArgType.stringArg: return(arg.GetType() == typeof(VsnString) || arg.GetType() == typeof(VsnReference)); case VsnArgType.booleanArg: return(arg.GetType() == typeof(VsnBoolean) || arg.GetType() == typeof(VsnReference)); case VsnArgType.operatorArg: return(arg.GetType() == typeof(VsnOperator)); case VsnArgType.referenceArg: return(arg.GetType() == typeof(VsnReference) || arg.GetType() == typeof(VsnMetaReference)); } return(false); }
public override void AddSupportedSignatures() { VsnArgType[] argTypes; for (int i = 1; i <= 5; i++) { argTypes = new VsnArgType[i * 2]; for (int j = 0; j < i; j++) { argTypes[j * 2] = VsnArgType.stringArg; argTypes[j * 2 + 1] = VsnArgType.referenceArg; } signatures.Add(argTypes); } }