Skip to content

Commit c7d0536

Browse files
committed
Merge branch 'main' into without-expression
2 parents c44ea4b + 8542fa6 commit c7d0536

14 files changed

Lines changed: 190 additions & 5 deletions

‎src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ FASTPythonMetamodelGenerator >> defineClasses [
175175
argumentList := builder ensureClassNamed: #ArgumentList."Todo"
176176
asPattern := builder ensureClassNamed: #AsPattern."Todo"
177177
asPatternTarget := builder ensureClassNamed: #AsPatternTarget."Todo"
178-
assertStatement := builder ensureClassNamed: #AssertStatement."Todo"
178+
assertStatement := builder ensureClassNamed: #AssertStatement.
179179
assignment := builder ensureClassNamed: #Assignment."To review"
180180
attribute := builder ensureClassNamed: #Attribute."To review"
181181
augmentedAssignment := builder ensureClassNamed: #AugmentedAssignment."Todo"
@@ -309,6 +309,8 @@ FASTPythonMetamodelGenerator >> defineHierarchy [
309309

310310
assignment --|> tAssignment.
311311

312+
assertStatement --|> tStatement.
313+
312314
attribute --|> structuralEntity.
313315

314316
binaryOperator --|> operator.
@@ -430,6 +432,9 @@ FASTPythonMetamodelGenerator >> defineRelations [
430432
((collectionInitializer property: #initializers) comment: 'Each initializer defines one element.')
431433
<>-* ((tExpression property: #collectionInitializer) comment: 'The owner of the expression').
432434

435+
((assertStatement property: #expression) comment: 'The expression asserted')
436+
<>- ((tExpression property: #assertOwner) comment: 'The assert statement that own the expression (if it''s the case)').
437+
433438
((tUnaryOperator property: #argument) comment: 'Expression influanced by the unary operator..')
434439
<>- ((tExpression property: #parentUnaryOperator) comment: 'Parent unary operator in which I am.')
435440
]

‎src/FAST-Python-Model/FASTPyAssertStatement.class.st‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
1+
"
2+
## Relations
3+
======================
4+
5+
### Parents
6+
| Relation | Origin | Opposite | Type | Comment |
7+
|---|
8+
| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body|
9+
| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.|
10+
11+
### Children
12+
| Relation | Origin | Opposite | Type | Comment |
13+
|---|
14+
| `expression` | `FASTPyAssertStatement` | `assertOwner` | `FASTTExpression` | The expression asserted|
15+
16+
17+
## Properties
18+
======================
19+
20+
| Name | Type | Default value | Comment |
21+
|---|
22+
| `endPos` | `Number` | nil | |
23+
| `startPos` | `Number` | nil | |
24+
25+
"
126
Class {
227
#name : 'FASTPyAssertStatement',
328
#superclass : 'FASTPyEntity',
29+
#traits : 'FASTTStatement',
30+
#classTraits : 'FASTTStatement classTrait',
431
#category : 'FAST-Python-Model-Entities',
532
#package : 'FAST-Python-Model',
633
#tag : 'Entities'
@@ -14,3 +41,34 @@ FASTPyAssertStatement class >> annotation [
1441
<generated>
1542
^ self
1643
]
44+
45+
{ #category : 'accessing' }
46+
FASTPyAssertStatement >> expression [
47+
"Relation named: #expression type: #FASTTExpression opposite: #assertOwner"
48+
49+
<generated>
50+
<FMComment: 'The expression asserted'>
51+
<FMProperty: #expression type: #FASTTExpression opposite: #assertOwner>
52+
^ self attributeAt: #expression ifAbsent: [ nil ]
53+
]
54+
55+
{ #category : 'accessing' }
56+
FASTPyAssertStatement >> expression: anObject [
57+
58+
<generated>
59+
(self attributeAt: #expression ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ].
60+
anObject ifNil: [ | otherSide |
61+
otherSide := self expression.
62+
self attributeAt: #expression put: anObject.
63+
otherSide assertOwner: nil ]
64+
ifNotNil: [
65+
self attributeAt: #expression put: anObject.
66+
anObject assertOwner: self ]
67+
]
68+
69+
{ #category : 'navigation' }
70+
FASTPyAssertStatement >> expressionGroup [
71+
<generated>
72+
<navigation: 'Expression'>
73+
^ MooseSpecializedGroup with: self expression
74+
]

‎src/FAST-Python-Model/FASTPyAssignment.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

‎src/FAST-Python-Model/FASTPyBinaryOperator.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

‎src/FAST-Python-Model/FASTPyBoolean.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

‎src/FAST-Python-Model/FASTPyBooleanOperator.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

‎src/FAST-Python-Model/FASTPyCall.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

‎src/FAST-Python-Model/FASTPyEntity.class.st‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
### Parents
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
8+
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
10+
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
11+
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
12+
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
813
| `genericParent` | `FASTPyEntity` | `genericChildren` | `FASTPyEntity` | |
914
1015
### Children

‎src/FAST-Python-Model/FASTPyExpression.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

‎src/FAST-Python-Model/FASTPyLiteral.class.st‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
9+
| `assertOwner` | `FASTTExpression` | `expression` | `FASTPyAssertStatement` | The assert statement that own the expression (if it's the case)|
910
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
1011
| `collectionInitializer` | `FASTTExpression` | `initializers` | `FASTPyCollectionInitializer` | The owner of the expression|
1112
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|

0 commit comments

Comments
 (0)