Resolves: fdo#77831 use classic token rules for user-defined char (%foo)

Change-Id: Iebae064986ad722d445c8d654e39e338e104f021
(cherry picked from commit 501e5b98ad39156cac465a161709ad38b89e3d63)
Reviewed-on: https://gerrit.libreoffice.org/9497
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>