diff options
author | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2020-02-11 16:13:36 +0100 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2020-02-12 18:28:46 +0100 |
commit | 41e8f8a7c6aa4a530abdbc52f8014c4563e85417 (patch) | |
tree | 35eca52953b51fedaeb3c16af695287c48eedc17 /src/qml/parser/qqmljs.g | |
parent | c2e756dc1962eeb3575f618b38272359d4fccc89 (diff) |
Add UiAnnotation for annotation objects
This is a partial patch that is fuilly fixed with the following
one (big restructure) because it needs extra visit methods,
and that leads to conflicts, but I think it gets lost if merged with
the next one.
Change-Id: I54331a47a5c7faaf78a97e580825d1feec5adf92
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljs.g')
-rw-r--r-- | src/qml/parser/qqmljs.g | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index a5062aafc7..f6d8bcf9c3 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -326,6 +326,7 @@ public: AST::UiQualifiedId *UiQualifiedId; AST::UiEnumMemberList *UiEnumMemberList; AST::UiVersionSpecifier *UiVersionSpecifier; + AST::UiAnnotation *UiAnnotation; AST::UiAnnotationList *UiAnnotationList; }; @@ -953,7 +954,7 @@ UiAnnotationObjectDefinition: UiSimpleQualifiedId UiObjectInitializer; return false; } - AST::UiObjectDefinition *node = new (pool) AST::UiObjectDefinition(sym(1).UiQualifiedId, sym(2).UiObjectInitializer); + AST::UiAnnotation *node = new (pool) AST::UiAnnotation(sym(1).UiQualifiedId, sym(2).UiObjectInitializer); sym(1).Node = node; } break; ./ @@ -969,14 +970,14 @@ case $rule_number: { UiAnnotationList: UiAnnotation; /. case $rule_number: { - sym(1).Node = new (pool) AST::UiAnnotationList(sym(1).UiObjectDefinition); + sym(1).Node = new (pool) AST::UiAnnotationList(sym(1).UiAnnotation); } break; ./ UiAnnotationList: UiAnnotationList UiAnnotation; /. case $rule_number: { - AST::UiAnnotationList *node = new (pool) AST::UiAnnotationList(sym(1).UiAnnotationList, sym(2).UiObjectDefinition); + AST::UiAnnotationList *node = new (pool) AST::UiAnnotationList(sym(1).UiAnnotationList, sym(2).UiAnnotation); sym(1).Node = node; } break; ./ @@ -984,7 +985,7 @@ UiAnnotationList: UiAnnotationList UiAnnotation; UiAnnotatedObject: UiAnnotationList UiObjectDefinition; /. case $rule_number: { - AST::UiObjectMember *node = sym(2).UiObjectMember; + AST::UiObjectDefinition *node = sym(2).UiObjectDefinition; node->annotations = sym(1).UiAnnotationList->finish(); sym(1).Node = node; } break; |