@@ -152,7 +152,8 @@ Class {
152152 ' tWithCondition' ,
153153 ' tWithParameters' ,
154154 ' tDefinition' ,
155- ' tDecoratorExpression'
155+ ' tDecoratorExpression' ,
156+ ' tWithElseClause'
156157 ],
157158 #category : ' FAST-Python-Model-Generator' ,
158159 #package : ' FAST-Python-Model-Generator'
@@ -384,6 +385,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [
384385
385386 forStatement -- | > statement.
386387 forStatement -- | > tLoopStatement.
388+ forStatement -- | > tWithElseClause.
387389
388390 functionDefinition -- | > tNamedBehaviouralEntity.
389391 functionDefinition -- | > tDefinition.
@@ -400,6 +402,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [
400402
401403 ifStatement -- | > statement.
402404 ifStatement -- | > tConditionalStatement.
405+ ifStatement -- | > tWithElseClause.
403406
404407 importStatement -- | > import.
405408
@@ -525,7 +528,7 @@ FASTPythonMetamodelGenerator >> defineRelations [
525528
526529 ((assertStatement property: #expression ) comment: ' The expression asserted' )
527530 <> - ((expression property: #assertOwner ) comment: ' The assert statement that own the expression (if it' ' s the case)' ).
528-
531+
529532 (await property: #expression ) <> - (expression property: #parentAwait ).
530533
531534 ((call property: #callee ) comment:
@@ -538,11 +541,11 @@ FASTPythonMetamodelGenerator >> defineRelations [
538541 ((comparisonOperator property: #operands ) comment:
539542 ' List of the operands of the comparison operands. For example if we have `a == b != c`, it will be a, b and c.' )
540543 <> -* ((expression property: #parentComparisonOperator ) comment: ' Parent comparison expression of which I am.' ).
541-
544+
542545 (conditionalExpression property: #thenExpression ) <> - (expression property: #conditionalExpressionThenOwner ).
543-
546+
544547 (conditionalExpression property: #elseExpression ) <> - (expression property: #conditionalExpressionElseOwner ).
545-
548+
546549 (decorator property: #expression ) <> - (tDecoratorExpression property: #parentDeclarator ).
547550
548551 ((deleteStatement property: #expression ) comment: ' The expression to apply the delete on' )
@@ -561,13 +564,11 @@ FASTPythonMetamodelGenerator >> defineRelations [
561564
562565 ((globalStatement property: #variables ) comment: ' The variables scoped' )
563566 <> -* ((variable property: #globalOwner ) comment: ' The global statement defining my scope (if it' ' s the case)' ).
564-
567+
565568 (ifClause property: #expression ) <> - (expression property: #ifClauseOwner ).
566569
567570 (ifStatement property: #thenClause ) <> - (thenClause property: #ifStatementOwner ).
568571
569- (ifStatement property: #elseClause ) <> - (elseClause property: #ifStatementOwner ).
570-
571572 (ifStatement property: #elifClauses ) <> -* (elifClause property: #ifStatementOwner ).
572573
573574 ((import property: #importedEntities ) comment: ' List of the imported entities.' )
@@ -576,12 +577,12 @@ FASTPythonMetamodelGenerator >> defineRelations [
576577 ((importFromStatement property: #fromModule ) comment:
577578 ' Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..' )
578579 <> - ((fromModule property: #import ) comment: ' Import declaring me as from import module.' ).
579-
580+
580581 (interpolation property: #expression ) <> - (expression property: #parentInterpolation ).
581582
582583 ((keywordArgument property: #value ) comment: ' The value of the keyword argument.' )
583584 <> - ((expression property: #keywordArgumentOwner ) comment: ' Keyword argument from which I am the value (if it' ' s the case)' ).
584-
585+
585586 (lambda property: #expression ) <> - (expression property: #lambdaOwner ).
586587
587588 ((listSplat property: #iterable ) comment: ' The iterable to unpack. Can be a collection, a call, an attribute access or a subscript.' )
@@ -593,12 +594,12 @@ FASTPythonMetamodelGenerator >> defineRelations [
593594 (pair property: #key ) <> - (tExpression property: #pairKeyOwner ).
594595
595596 (pair property: #value ) <> - (tExpression property: #pairValueOwner ).
596-
597+
597598 (patternList property: #elements ) <> -* (expression property: #patternListOwner ).
598599
599600 ((slice property: #components ) comment: ' The components are the expressions between the `:` of a slice.' )
600601 <> -* ((expression property: #sliceOwner ) comment: ' Slice in which I am a component (start, end or step) (If it' ' s the case)' ' ' ).
601-
602+
602603 (string property: #interpolations ) <> -* (interpolation property: #parentString ).
603604
604605 ((subscript property: #value ) comment: ' The receiver of the subscript' )
@@ -610,13 +611,15 @@ FASTPythonMetamodelGenerator >> defineRelations [
610611 (tComprehension property: #body ) <> - (expression property: #comprehensionBodyOwner ).
611612
612613 (tComprehension property: #clauses ) <> -* (expression property: #comprehensionClauseOwner ).
613-
614+
614615 (tDefinition property: #decorators ) <> -* (decorator property: #definitionOwner ).
615-
616+
616617 (tuplePattern property: #patterns ) <> -* (expression property: #tuplePatternOwner ).
617618
618619 ((tUnaryOperator property: #argument ) comment: ' Expression influanced by the unary operator..' )
619- <> - ((expression property: #parentUnaryOperator ) comment: ' Parent unary operator in which I am.' )
620+ <> - ((expression property: #parentUnaryOperator ) comment: ' Parent unary operator in which I am.' ).
621+
622+ (tWithElseClause property: #elseClause ) <> - (elseClause property: #ifStatementOwner )
620623]
621624
622625{ #category : ' definition' }
@@ -633,6 +636,7 @@ FASTPythonMetamodelGenerator >> defineTraits [
633636 tDecoratorExpression := builder newTraitNamed: #TDecoratorExpression .
634637 tDecoratorExpression comment: ' I represent an entity that *can* be the expression of a decorator.' .
635638 tUnaryOperator := builder newTraitNamed: #TUnaryOperator .
639+ tWithElseClause := builder newTraitNamed: #TWithElseClause .
636640
637641 " Remotes"
638642 tAssignment := self remoteTrait: #TAssignment withPrefix: #FAST .
0 commit comments