Skip to content

Commit d20fd98

Browse files
committed
Fix granularity of fromImportModule + improve test generation + manage future import
1 parent d210af1 commit d20fd98

5 files changed

Lines changed: 268 additions & 189 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ FASTPythonMetamodelGenerator >> defineRelations [
402402
<>-* ((importedEntity property: #import) comment: 'Import declaring me as imported entity.').
403403

404404
((importFromStatement property: #fromImportModule) comment: 'Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..')
405-
<>-* ((fromImportModule property: #import) comment: 'Import declaring me as from import module.').
405+
<>- ((fromImportModule property: #import) comment: 'Import declaring me as from import module.').
406406

407407
((tUnaryOperator property: #argument) comment: 'Expression influanced by the unary operator..')
408408
<>- ((tExpression property: #parentUnaryOperator) comment: 'Parent unary operator in which I am.')

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ FASTPyFromImportModule >> import [
5050
<generated>
5151
<FMComment: 'Import declaring me as from import module.'>
5252
<container>
53+
<derived>
5354
^ import
5455
]
5556

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Class {
1414
#name : 'FASTPyImportFromStatement',
1515
#superclass : 'FASTPyImport',
1616
#instVars : [
17-
'#fromImportModule => FMMany type: #FASTPyFromImportModule opposite: #import'
17+
'#fromImportModule => FMOne type: #FASTPyFromImportModule opposite: #import'
1818
],
1919
#category : 'FAST-Python-Model-Entities',
2020
#package : 'FAST-Python-Model',
@@ -30,32 +30,25 @@ FASTPyImportFromStatement class >> annotation [
3030
^ self
3131
]
3232

33-
{ #category : 'adding' }
34-
FASTPyImportFromStatement >> addFromImportModule: anObject [
35-
<generated>
36-
^ self fromImportModule add: anObject
37-
]
38-
3933
{ #category : 'accessing' }
4034
FASTPyImportFromStatement >> fromImportModule [
4135
"Relation named: #fromImportModule type: #FASTPyFromImportModule opposite: #import"
4236

4337
<generated>
4438
<FMComment: 'Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..'>
45-
<derived>
4639
^ fromImportModule
4740
]
4841

4942
{ #category : 'accessing' }
5043
FASTPyImportFromStatement >> fromImportModule: anObject [
5144

5245
<generated>
53-
fromImportModule value: anObject
46+
fromImportModule := anObject
5447
]
5548

5649
{ #category : 'navigation' }
5750
FASTPyImportFromStatement >> fromImportModuleGroup [
5851
<generated>
5952
<navigation: 'FromImportModule'>
60-
^ MooseSpecializedGroup withAll: self fromImportModule asSet
53+
^ MooseSpecializedGroup with: self fromImportModule
6154
]

0 commit comments

Comments
 (0)