diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-05 16:27:56 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-09 16:53:09 +0200 |
commit | 5c3326702fcb200e9af594f66696cd8c21ac7e85 (patch) | |
tree | c0d9deb7053a387243c34157af7eafdac754ae47 /src/qml/parser/qqmljsast_p.h | |
parent | 910f98031fdd834a22af0da21c9ff6ae145f61c5 (diff) |
Add support for type script QML signal parameter declarations
We support
signal(int param)
but we should also support
signal(param: int)
for consistency with the syntax now supported for functions.
Change-Id: Ic064bbaac45024d3663562819f3c1f3f4a918a56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast_p.h')
-rw-r--r-- | src/qml/parser/qqmljsast_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index ea854c3754..1502298d14 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -3237,10 +3237,10 @@ public: void accept0(Visitor *) override; SourceLocation firstSourceLocation() const override - { return propertyTypeToken; } + { return colonToken.isValid() ? identifierToken : propertyTypeToken; } SourceLocation lastSourceLocation() const override - { return next ? next->lastSourceLocation() : identifierToken; } + { return next ? next->lastSourceLocation() : (colonToken.isValid() ? propertyTypeToken : identifierToken); } inline UiParameterList *finish () { @@ -3256,6 +3256,7 @@ public: SourceLocation commaToken; SourceLocation propertyTypeToken; SourceLocation identifierToken; + SourceLocation colonToken; }; class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember |