Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
s/yarr/QRegularExpression/g
Description
Regular expressions in QML are implemented by relying on (an internal fork of) a version of YARR (from Webkit).
This has the benefit that the regexp engine is integrated with QML's memory manager (so memory usage from them is accounted on the QML heap, not the native heap).
The disadvantage is that converting between QRegularExpression and QML RegExp objects is not free, and when "\u" or "\U" is used, there are also differences in behavior. As discussed in https://codereview.qt-project.org/c/qt/qtdeclarative/+/612762/1/src/qml/jsruntime/qv4regexp.cpp#229 it also requires quite a bit of (ROM)
It is currently not possible to completely replace YARR due to differences in how the engine behaves. However, we could consider the following steps:
- We add proper support for QRegularExpression as an (optional) backend for the JavaScript engine. This does also require adding a few changes to qtbase.
- We create a configuration where this backend is enabled, and YARR is not compiled. This would be added to the recent "Qt lite" configuration set
- We teach qmllint to warn about regular expressions which are behave differently between YARR and QRE/PCRE
- Long-term, we try to get upstream PCRE to add support for the features which are required to make it a drop-in replacement
Attachments
Issue Links
- mentioned in
-
Page Loading...