Skip to content

Commit 2437224

Browse files
Merge pull request #214 from moosetechnology/access-to-stub-attribute
handling access to stub attribute (p.att where att is not found)
2 parents 4906ba6 + a27f521 commit 2437224

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/EsopeImporter-Tests/FamixEsopeResolverTest.class.st

+2-5
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,6 @@ FamixEsopeResolverTest >> testResolvePointeurWithStubSegmentAccessingField [
13501350
end
13511351
"
13521352

1353-
self flag: '#FIXME: after this tests we must have a stub segment and we need to add a x attribute to this segment?'.
1354-
13551353
varP := self newEntity: FamixF77Variable named: 'p'.
13561354
varP segment: 'point'.
13571355
varP isEsope: true.
@@ -1375,10 +1373,9 @@ FamixEsopeResolverTest >> testResolvePointeurWithStubSegmentAccessingField [
13751373
self assert: main accesses size equals: 2.
13761374

13771375
self assert: access variable equals: varP.
1378-
self assert: access accessor equals: main.
13791376

1380-
self assert: access2 variable isNil.
1381-
self assert: access2 accessor equals: main
1377+
self assert: access2 variable class equals: FamixFortranAttribute.
1378+
self assert: access2 variable name equals: 'x'
13821379
]
13831380

13841381
{ #category : 'tests' }

src/EsopeImporter/FamixEsopeResolver.class.st

+7-6
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,13 @@ FamixEsopeResolver >> resolveAttributeAccess: anAccess forPointer: aPointerVaria
308308

309309
aPointerVariable declaredType
310310
ifNotNil: [ :declaredType |
311-
declaredType attributes
312-
detect: [ :att | att name asLowercase = variableAccessed entityName asLowercase ]
313-
ifFound: [ :att | anAccess variable: att ]
314-
ifNone: [
315-
"What to do if we have any attribute match? Nothing for Now"
316-
]
311+
anAccess variable:
312+
(declaredType attributes
313+
detect: [ :att | att name asLowercase = variableAccessed entityName asLowercase ]
314+
ifNone: [
315+
(model newAttributeNamed: variableAccessed entityName asLowercase)
316+
isStub: true
317+
])
317318
]
318319
ifNil: [
319320
self resolveDeclaredTypeOfPointers.

0 commit comments

Comments
 (0)