lupdate/Python: Fix plural detection for QCoreApplication.translate() when count is an expression


When count is an expression instead of a plain integer, the function
matchEncoding() used by parseTranslate() to check on the "Encoding"
enum in the deprecated overload
QCoreApplication::translate(const char*, const char*, const char*, Encoding, int)
(Qt 5) reads over the variable containing the number and thus plural
detection fails.

Removing matchEncoding() unearthed some hangs in the helper
matchExpression().

To fix this, replace its implementation by a simpler one modeled after
CppParser::skipExpression() and rename to skipExpression().

Fixes: PYSIDE-3418
Pick-to: 6.12
Change-Id: Icb5ecd61487a368f2b32ada53e06683b449a13bb
Reviewed-by: Masoud Jami <masoud.jami@qt.io>
commitda63fa00340b9c9cd5e6dbd7052725392179288d
parentb6dadb2342d2b3ed3d1e5b90b3dc8792aecedd4d
authorFriedemann Kleint <Friedemann.Kleint@qt.io>
committerFriedemann Kleint <Friedemann.Kleint@qt.io>
commit timeThu, 13 Aug 2026 12:31:00 +0000