PLEASE use macros to check instruction arguments in the compiler #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
You could create a couple macros like:
EXPECT_NUM_ARGS(args, num_aargs)checks if the number of args is equal to the number parsedEXPECT_MIN_ARGS(args, min_args)self explanitory...EXPECT_MAX_ARGS(args, max_args)and so on...EXPECT_ARG_TYPE(args, index, arg_type)checks to make sure the type of the arg at the specified index is the expected typethis would mean you avoid duplicating if statements and can provide generic and consistent error messages.
I do that in solstice I probably should do this in the compiler