[PATCH v2 01/20] tag: factor out tag operation parsing