Skip to content

Commit c235af2

Browse files
committed
Rename FromImportModule into FromModule + factorize code of future import and importFrom
1 parent d20fd98 commit c235af2

6 files changed

Lines changed: 85 additions & 91 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Class {
138138
'structuralEntity',
139139
'import',
140140
'importedEntity',
141-
'fromImportModule'
141+
'fromModule'
142142
],
143143
#category : 'FAST-Python-Model-Generator',
144144
#package : 'FAST-Python-Model-Generator'
@@ -219,7 +219,7 @@ FASTPythonMetamodelGenerator >> defineClasses [
219219
forStatement := builder ensureClassNamed: #ForStatement."Todo"
220220
formatExpression := builder ensureClassNamed: #FormatExpression."Todo"
221221
formatSpecifier := builder ensureClassNamed: #FormatSpecifier."Todo"
222-
fromImportModule := builder ensureClassNamed: #FromImportModule.
222+
fromModule := builder ensureClassNamed: #FromModule.
223223
functionDefinition := builder ensureClassNamed: #FunctionDefinition."ToReview"
224224
generatorExpression := builder ensureClassNamed: #GeneratorExpression."Todo"
225225
genericType := builder ensureClassNamed: #GenericType."Todo"
@@ -372,7 +372,7 @@ FASTPythonMetamodelGenerator >> defineProperties [
372372
multivalued: true;
373373
comment: 'The comparators applied in order. Possible operators: <, <=, ==, !=, >=, >, <>, in, not in, is, is not'.
374374

375-
(fromImportModule property: #segments type: #String)
375+
(fromModule property: #segments type: #String)
376376
multivalued: true;
377377
comment:
378378
'The segments of the module path. For example if you declare `xml.etree.ElementTree` as module, the segments will be { ''xml'' . ''etree'' . ''ElementTree''}.'.
@@ -401,8 +401,8 @@ FASTPythonMetamodelGenerator >> defineRelations [
401401
((import property: #importedEntities) comment: 'List of the imported entities.')
402402
<>-* ((importedEntity property: #import) comment: 'Import declaring me as imported entity.').
403403

404-
((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.').
404+
((importFromStatement property: #fromModule) comment: 'Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..')
405+
<>- ((fromModule 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 renamed to src/FAST-Python-Model/FASTPyFromModule.class.st

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Parents
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
8-
| `import` | `FASTPyFromImportModule` | `fromImportModule` | `FASTPyImportFromStatement` | Import declaring me as from import module.|
8+
| `import` | `FASTPyFromModule` | `fromModule` | `FASTPyImportFromStatement` | Import declaring me as from import module.|
99
1010
1111
## Properties
@@ -17,35 +17,35 @@
1717
1818
"
1919
Class {
20-
#name : 'FASTPyFromImportModule',
20+
#name : 'FASTPyFromModule',
2121
#superclass : 'FASTPyEntity',
2222
#instVars : [
23-
'#import => FMOne type: #FASTPyImportFromStatement opposite: #fromImportModule',
24-
'#segments => FMProperty'
23+
'#segments => FMProperty',
24+
'#import => FMOne type: #FASTPyImportFromStatement opposite: #fromModule'
2525
],
2626
#category : 'FAST-Python-Model-Entities',
2727
#package : 'FAST-Python-Model',
2828
#tag : 'Entities'
2929
}
3030

3131
{ #category : 'meta' }
32-
FASTPyFromImportModule class >> annotation [
32+
FASTPyFromModule class >> annotation [
3333

34-
<FMClass: #FromImportModule super: #FASTPyEntity>
34+
<FMClass: #FromModule super: #FASTPyEntity>
3535
<package: #'FAST-Python-Model'>
3636
<generated>
3737
^ self
3838
]
3939

4040
{ #category : 'adding' }
41-
FASTPyFromImportModule >> addSegments: aCollection [
41+
FASTPyFromModule >> addSegments: aCollection [
4242

4343
segments := segments , aCollection
4444
]
4545

4646
{ #category : 'accessing' }
47-
FASTPyFromImportModule >> import [
48-
"Relation named: #import type: #FASTPyImportFromStatement opposite: #fromImportModule"
47+
FASTPyFromModule >> import [
48+
"Relation named: #import type: #FASTPyImportFromStatement opposite: #fromModule"
4949

5050
<generated>
5151
<FMComment: 'Import declaring me as from import module.'>
@@ -55,21 +55,21 @@ FASTPyFromImportModule >> import [
5555
]
5656

5757
{ #category : 'accessing' }
58-
FASTPyFromImportModule >> import: anObject [
58+
FASTPyFromModule >> import: anObject [
5959

6060
<generated>
6161
import := anObject
6262
]
6363

6464
{ #category : 'navigation' }
65-
FASTPyFromImportModule >> importGroup [
65+
FASTPyFromModule >> importGroup [
6666
<generated>
6767
<navigation: 'Import'>
6868
^ MooseSpecializedGroup with: self import
6969
]
7070

7171
{ #category : 'accessing' }
72-
FASTPyFromImportModule >> segments [
72+
FASTPyFromModule >> segments [
7373

7474
<FMProperty: #segments type: #String>
7575
<generated>
@@ -79,7 +79,7 @@ FASTPyFromImportModule >> segments [
7979
]
8080

8181
{ #category : 'accessing' }
82-
FASTPyFromImportModule >> segments: anObject [
82+
FASTPyFromModule >> segments: anObject [
8383
<generated>
8484
segments := anObject
8585
]

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Children
66
| Relation | Origin | Opposite | Type | Comment |
77
|---|
8-
| `fromImportModule` | `FASTPyImportFromStatement` | `import` | `FASTPyFromImportModule` | Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..|
8+
| `fromModule` | `FASTPyImportFromStatement` | `import` | `FASTPyFromModule` | Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..|
99
1010
1111
@@ -14,7 +14,7 @@ Class {
1414
#name : 'FASTPyImportFromStatement',
1515
#superclass : 'FASTPyImport',
1616
#instVars : [
17-
'#fromImportModule => FMOne type: #FASTPyFromImportModule opposite: #import'
17+
'#fromModule => FMOne type: #FASTPyFromModule opposite: #import'
1818
],
1919
#category : 'FAST-Python-Model-Entities',
2020
#package : 'FAST-Python-Model',
@@ -31,24 +31,24 @@ FASTPyImportFromStatement class >> annotation [
3131
]
3232

3333
{ #category : 'accessing' }
34-
FASTPyImportFromStatement >> fromImportModule [
35-
"Relation named: #fromImportModule type: #FASTPyFromImportModule opposite: #import"
34+
FASTPyImportFromStatement >> fromModule [
35+
"Relation named: #fromModule type: #FASTPyFromModule opposite: #import"
3636

3737
<generated>
3838
<FMComment: 'Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..'>
39-
^ fromImportModule
39+
^ fromModule
4040
]
4141

4242
{ #category : 'accessing' }
43-
FASTPyImportFromStatement >> fromImportModule: anObject [
43+
FASTPyImportFromStatement >> fromModule: anObject [
4444

4545
<generated>
46-
fromImportModule := anObject
46+
fromModule := anObject
4747
]
4848

4949
{ #category : 'navigation' }
50-
FASTPyImportFromStatement >> fromImportModuleGroup [
50+
FASTPyImportFromStatement >> fromModuleGroup [
5151
<generated>
52-
<navigation: 'FromImportModule'>
53-
^ MooseSpecializedGroup with: self fromImportModule
52+
<navigation: 'FromModule'>
53+
^ MooseSpecializedGroup with: self fromModule
5454
]

src/FAST-Python-Model/FASTPyTEntityCreator.trait.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ FASTPyTEntityCreator >> newFormatSpecifier [
385385
]
386386

387387
{ #category : 'entity creation' }
388-
FASTPyTEntityCreator >> newFromImportModule [
388+
FASTPyTEntityCreator >> newFromModule [
389389

390390
<generated>
391-
^ self add: FASTPyFromImportModule new
391+
^ self add: FASTPyFromModule new
392392
]
393393

394394
{ #category : 'entity creation' }

0 commit comments

Comments
 (0)