Skip to content

Commit 4906ba6

Browse files
authored
Merge pull request #213 from moosetechnology/comment-branch
Comment branch
2 parents 27be169 + fffbb47 commit 4906ba6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ IASTToFamixVisitorTest >> testComment [
202202
programFile body: { IASTMainProgram new
203203
entityName: 'main';
204204
body: { IASTComment new
205-
text: 'a normal comment';
205+
text: 'a normal comment' ;
206206
yourself. };
207207
yourself }.
208208

@@ -213,7 +213,7 @@ IASTToFamixVisitorTest >> testComment [
213213

214214
comment := entity programUnits first comments first.
215215
self assert: comment class equals: FamixF77Comment.
216-
self assert: comment content equals: 'a normal comment'.
216+
self assert: comment sourceText equals: 'a normal comment'.
217217
self deny: comment isEsope.
218218

219219
self assert: comment commentedEntity equals: entity programUnits first.

src/EsopeImporter/IASTToFamixFortranVisitor.class.st

+5-6
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ IASTToFamixFortranVisitor >> visitIASTBlockData: aBlockData [
114114
IASTToFamixFortranVisitor >> visitIASTComment: aComment [
115115

116116
^(self newEntity: FamixF77Comment)
117-
content: aComment text ;
118117
commentedEntity: stack top ;
119-
sourceAnchor: (self visitIndexedFileAnchor: aComment sourceAnchor) ;
118+
sourceAnchor: (FamixF77SourceTextAnchor new source: aComment text) ;
120119
isEsope: aComment isEsope ;
121120
yourself
122121
]
@@ -256,11 +255,11 @@ IASTToFamixFortranVisitor >> visitIASTProgramFile: aProgramFile [
256255

257256
stack push: progFile.
258257

259-
aProgramFile body do: [ :child || famixComment |
260-
famixComment := child accept: self.
258+
aProgramFile body do: [ :child || famixEntity |
259+
famixEntity := child accept: self.
261260
child isComment
262-
ifTrue: [ famixComment commentedEntity: progFile ]
263-
ifFalse: [ progFile addProgramUnit: famixComment ]
261+
ifTrue: [ famixEntity commentedEntity: progFile ]
262+
ifFalse: [ progFile addProgramUnit: famixEntity ]
264263
].
265264

266265
stack pop.

0 commit comments

Comments
 (0)