Skip to content

Commit 7decca9

Browse files
author
anquetil
committed
importing segment name as lowercase + test
1 parent 582bdf1 commit 7decca9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st

+18
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,24 @@ c@_ end segment
14891489
self assert: seg sourceAnchor endColumn equals: 18
14901490
]
14911491

1492+
{ #category : 'tests-esope' }
1493+
JsonToIASTVisitorTest >> testSegmentDeclarationUpperCaseName [
1494+
"subroutine hello
1495+
c@_ segment,user
1496+
c@_ end segment
1497+
end
1498+
"
1499+
| programFile seg |
1500+
programFile := self visitJsonCode: '{"meta":{"miVersion":"fortran77","miFilename":"./fortran77.f"},"program_units":[{"anno":[],"arguments":null,"blocks":[{"anno":[],"comment":"@_ segment,USER","span":"(2:1)-(2:18)","tag":"comment"},{"anno":[],"comment":"@_ end segment","span":"(3:1)-(3:17)","tag":"comment"}],"name":"hello","options":[null,null],"span":"(1:7)-(4:9)","subprograms":null,"tag":"subroutine"}]}'.
1501+
1502+
1503+
self assert: programFile body first body size equals: 1.
1504+
seg := programFile body first body first.
1505+
1506+
self assert: seg class equals: IASTEsopeSegment.
1507+
self assert: seg entityName equals: 'user'.
1508+
]
1509+
14921510
{ #category : 'tests-esope' }
14931511
JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayAttribute [
14941512

src/EsopeImporter/JsonToIASTVisitor.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ JsonToIASTVisitor >> visitEsopeSegmentComment: anEsopeCommentNode [
417417
data := self processEsopeComment: anEsopeCommentNode.
418418
seg := IASTEsopeSegment new
419419
sourceAnchor: (self makeIndexedAnchor: data second) ;
420-
entityName: data fourth ;
420+
entityName: data fourth asLowercase ;
421421
declarations: (OrderedCollection new: 5) ;
422422
yourself.
423423
entityStack push: seg.

0 commit comments

Comments
 (0)