discover/grub2: improve handling of word & delimiter tokens