add helper function for ARG_OP/ARG_LIST parsing

These types are similar enough that we don't need to duplicate
all this code to extract the struct entries.