parser patch to handle matrix