diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2022-08-22 11:13:41 +0200 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2022-08-31 21:01:45 +0200 |
commit | e26bf40513041527f153f7c0b3b30d7832e7a603 (patch) | |
tree | 744cd48a2867dbb52e51176f27332e6d38235250 /tools | |
parent | b7f448f8647a9a118cee2d79d446194b20d4b335 (diff) |
qmltc: add some internal documentation
add some documentation to qmltc's internal behavior that is not
self-documenting enough.
Change-Id: I131ee875944e294e0472519573ace4058f4f1821
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmltc/qmltccompiler.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/qmltc/qmltccompiler.cpp b/tools/qmltc/qmltccompiler.cpp index 57e8363bae..0a26ebc2d7 100644 --- a/tools/qmltc/qmltccompiler.cpp +++ b/tools/qmltc/qmltccompiler.cpp @@ -505,17 +505,66 @@ void QmltcCompiler::compileProperty(QmltcType ¤t, const QQmlJSMetaProperty compilationData.notify); } +/*! + * \internal + * + * Models one step of the alias resolution. If the current alias to be resolved + * points to \c {x.y.z} and that \c {x.y} is already resolved, then this struct + * contains the information on how to obtain the \c {z} part from \c {x.y}. + */ struct AliasResolutionFrame { + /*! + * \internal + * + * Placeholder for the current resolved state. It is replaced later with + * the result from previous resolutions from the \c QStack<AliasResolutionFrame>. + * + * \sa unpackFrames() + */ static QString inVar; + + /*! + * \internal + * + * Steps to access this value as a list of C++ statements, to be used in + * conjunction with \c {epilogue}. + */ QStringList prologue; + + /*! + * \internal + * + * Steps to finish the statements of the \c prologue (e.g. closing brackets). + */ QStringList epilogue; + + /*! + * \internal + * + * Instructions on how to write the property, after it was loaded with the + * instructions from \c prologue. Has to happen before \c epilogue. + */ QStringList epilogueForWrite; + + /*! + * \internal + * + * Name of the variable holding the result of this resolution step, to be + * used in the following resolution steps. + */ QString outVar; }; // special string replaced by outVar of the previous frame QString AliasResolutionFrame::inVar = QStringLiteral("__QMLTC_ALIAS_FRAME_INPUT_VAR__"); +/*! + * \internal + * + * Process the frames by replacing the placeholder \c invar + * used in \c epilogueForWrite and \c prologue with the result + * obtained from the previous frame. + */ static void unpackFrames(QStack<AliasResolutionFrame> &frames) { if (frames.size() < 2) |