Something like
define ListAction(myList, arg) ... //Do something listy.
ListAction([a,b], c);
results in a too many arguments error from the preprocessor when the macro is invoked, and the line is skipped. In the case of vectors and rotations this can probably be worked around by splitting the vector or rotation over 3 or 4 arguments, but in the case of a list with a variable number of arguments, no such workaround is feasible.
Would it be possible to massage the input to the preprocessor by replacing CSV formatted values, specifically lists, rotations, and vectors with, say, otherwise unlikely to occur, appropriately formatted strings, then restoring the original values on return from the preprocessor? Something like:
[a, [b], "c]", ""d""] <-> "pYoPtLiSt = [a, [b], "c]", "\"d\""]"
I believe that this would allow macros to handle such items gracefully with a minimum of effort and undesirable side effects.
(except for adding a backslash to embedded quotes and doubling the number of backslashes in ..." sequences, I don't think other character values would require special handling. Specifically, vectors and rotations inside lists should not need to be pre-preprocessed separately.)
I'm not familiar enough with mcpp and its ilk to be sure, but an alternative to the above string method might be simply to temporarily replace the commas in such values with another unique delimiter, escaping or doubling the delimiter if it occurs elsewhere in the value. Eg:
[a, [b], "c]", "de"] <-> [a
[b]"c]"
"de"] or [a, [b], "c]", "d
e"] <-> [a [b]
"c]"` "d``e"]
In the escaped case, it would be necessary to deal with ...sequences within the original value appropriately. However, in the doubled delimiter case,
...` sequences would not require separate handling.