From 50db6f5435d6e43c5f280c5c3ce31179729e4af8 Mon Sep 17 00:00:00 2001 From: uNouss Date: Fri, 26 Jul 2024 17:19:29 +0200 Subject: [PATCH 1/5] Refactoring and fixing typo --- .../FortranAbstractJsonVisitor.class.st | 2 +- src/EsopeImporter/IASTVariable.class.st | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/EsopeImporter/FortranAbstractJsonVisitor.class.st b/src/EsopeImporter/FortranAbstractJsonVisitor.class.st index a3c8273..c3dbf35 100644 --- a/src/EsopeImporter/FortranAbstractJsonVisitor.class.st +++ b/src/EsopeImporter/FortranAbstractJsonVisitor.class.st @@ -523,7 +523,7 @@ FortranAbstractJsonVisitor >> visitEqv: aEqvtoOperatorNode [ { #category : #'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeComment: anEsopeCommentNode [ - "we separate each Esope command in a different visit methdo to give opportunity to + "we separate each Esope command in a different visit method to give opportunity to concrete visitors (subclasses) to treat them differently. But here, they are pretty much all the same, so they come down to the same treatment" diff --git a/src/EsopeImporter/IASTVariable.class.st b/src/EsopeImporter/IASTVariable.class.st index f5fc515..24b746f 100644 --- a/src/EsopeImporter/IASTVariable.class.st +++ b/src/EsopeImporter/IASTVariable.class.st @@ -4,10 +4,10 @@ Class { #instVars : [ 'typeSpec', 'initialValue', - 'dimension', - 'isEsope' + 'isEsope', + 'dimensions' ], - #category : 'EsopeImporter-AST-IR' + #category : #'EsopeImporter-AST-IR' } { #category : #accessing } @@ -16,18 +16,6 @@ IASTVariable >> accept: aVisitor [ ^ aVisitor visitIASTVariable: self. ] -{ #category : #accessing } -IASTVariable >> dimension [ - - ^ dimension -] - -{ #category : #accessing } -IASTVariable >> dimension: anObject [ - - dimension := anObject -] - { #category : #accessing } IASTVariable >> initialValue [ From 951d6876911c7918437ed7ed41a5d6ce04591be1 Mon Sep 17 00:00:00 2001 From: uNouss Date: Fri, 26 Jul 2024 17:20:30 +0200 Subject: [PATCH 2/5] Fixing the accessors name --- src/EsopeImporter/IASTVariable.class.st | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/EsopeImporter/IASTVariable.class.st b/src/EsopeImporter/IASTVariable.class.st index 24b746f..69be657 100644 --- a/src/EsopeImporter/IASTVariable.class.st +++ b/src/EsopeImporter/IASTVariable.class.st @@ -16,6 +16,18 @@ IASTVariable >> accept: aVisitor [ ^ aVisitor visitIASTVariable: self. ] +{ #category : #accessing } +IASTVariable >> dimensions [ + + ^ dimensions +] + +{ #category : #accessing } +IASTVariable >> dimensions: anObject [ + + dimensions := anObject +] + { #category : #accessing } IASTVariable >> initialValue [ From a64024438c295c5d0b754e0005582721637acd2e Mon Sep 17 00:00:00 2001 From: uNouss Date: Fri, 26 Jul 2024 17:25:22 +0200 Subject: [PATCH 3/5] When we have something like `pointeur bar(n).toto` - before we just get `pointeur` and `bar` - now we have `pointeur` and `bar(n).titi`, almost what we want > Fix applied in `#esopeCommand:` But in side effect we have to dealing with extra character, we do not want in case of `include` > Temporary fix applied in `visitEsopeIncludeComment:` --- src/EsopeImporter/FortranAbstractJsonVisitor.class.st | 2 +- src/EsopeImporter/JsonToIASTVisitor.class.st | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/EsopeImporter/FortranAbstractJsonVisitor.class.st b/src/EsopeImporter/FortranAbstractJsonVisitor.class.st index c3dbf35..98f930f 100644 --- a/src/EsopeImporter/FortranAbstractJsonVisitor.class.st +++ b/src/EsopeImporter/FortranAbstractJsonVisitor.class.st @@ -20,7 +20,7 @@ FortranAbstractJsonVisitor >> esopeCommand: anEsopeCommentString [ ^(wordBoundaries size > 2) ifTrue: [ { (anEsopeCommentString copyFrom: wordBoundaries first to: wordBoundaries second) . - (anEsopeCommentString copyFrom: wordBoundaries third to: wordBoundaries fourth) } + (anEsopeCommentString copyFrom: wordBoundaries third to: wordBoundaries last) } ] ifFalse: [ { anEsopeCommentString copyFrom: wordBoundaries first to: wordBoundaries second } ] ] diff --git a/src/EsopeImporter/JsonToIASTVisitor.class.st b/src/EsopeImporter/JsonToIASTVisitor.class.st index 78eb880..d2ab3cb 100644 --- a/src/EsopeImporter/JsonToIASTVisitor.class.st +++ b/src/EsopeImporter/JsonToIASTVisitor.class.st @@ -9,7 +9,7 @@ Class { 'model', 'entityStack' ], - #category : 'EsopeImporter-Visitor' + #category : #'EsopeImporter-Visitor' } { #category : #'private - utilities' } @@ -321,10 +321,13 @@ JsonToIASTVisitor >> visitEsopeEndsegmentComment: anEsopeCommentNode [ JsonToIASTVisitor >> visitEsopeIncludeComment: anEsopeIncludeCommentNode [ | data | + self flag: #FIXME. "Related to #esopeCommand: we take until the last but here we do not want the last double quote char + So in the entityName, we remove this char. Need to find a better way to do that. + " data := super visitEsopeIncludeComment: anEsopeIncludeCommentNode. ^ IASTInclude new sourceAnchor: (self makeIndexedAnchor: data second); - entityName: data fourth; + entityName: data fourth allButLast; includeCommand: data third; yourself ] From 7501f51d3c08f58c12b6a1e7a037bf07a8dc4542 Mon Sep 17 00:00:00 2001 From: uNouss Date: Fri, 26 Jul 2024 17:26:05 +0200 Subject: [PATCH 4/5] Trying to fix #172 --- .../EsopeFullGrammarTest.class.st | 38 ++- .../EsopeGrammarTest.class.st | 60 +++-- .../EsopeRewriterTest.class.st | 120 +++++---- .../FamixEsopeResolverTest.class.st | 88 ++++--- .../FamixEsopeUtilitiesTest.class.st | 58 +++-- .../FortranProjectImporterTest.class.st | 122 +++++---- .../IASTToFamixVisitorTest.class.st | 102 ++++---- .../JsonToIASTVisitorTest.class.st | 233 ++++++++++++------ .../ManifestEsopeImporterTests.class.st | 10 +- src/EsopeImporter-Tests/package.st | 2 +- .../IASTToFamixEsopeVisitor.class.st | 22 +- src/EsopeImporter/JsonToIASTVisitor.class.st | 21 +- 12 files changed, 478 insertions(+), 398 deletions(-) diff --git a/src/EsopeImporter-Tests/EsopeFullGrammarTest.class.st b/src/EsopeImporter-Tests/EsopeFullGrammarTest.class.st index 866f979..f783e93 100644 --- a/src/EsopeImporter-Tests/EsopeFullGrammarTest.class.st +++ b/src/EsopeImporter-Tests/EsopeFullGrammarTest.class.st @@ -1,15 +1,13 @@ Class { - #name : 'EsopeFullGrammarTest', - #superclass : 'TestCase', + #name : #EsopeFullGrammarTest, + #superclass : #TestCase, #instVars : [ 'parser' ], - #category : 'EsopeImporter-Tests-Rewriter', - #package : 'EsopeImporter-Tests', - #tag : 'Rewriter' + #category : 'EsopeImporter-Tests-Rewriter' } -{ #category : 'tests' } +{ #category : #tests } EsopeFullGrammarTest class >> esopeBigFile [ ^ ' subroutine vcstp(ov1,pshp1,pbeg1,pend1,ov2,status) @@ -369,7 +367,7 @@ C -- terminer en echec ' ] -{ #category : 'tests' } +{ #category : #tests } EsopeFullGrammarTest class >> esopeFileWithCallStatement [ ^ ' subroutine valrma( @@ -463,7 +461,7 @@ C -- terminer en echec ' ] -{ #category : 'tests' } +{ #category : #tests } EsopeFullGrammarTest class >> esopeSmallFile [ ^ ' subroutine stgbrk( @@ -684,34 +682,34 @@ C ' ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> parserClass [ ^ PPEsopeGrammar ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> setUp [ super setUp. parser := self parserClass new ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testBigFile [ self deny: (parser parse: self class esopeBigFile) isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testEmptyFile [ self deny: (parser parse: ' ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testEsopePointeurFile [ self deny: (parser parse: ' subroutine stgbrk( @@ -725,7 +723,7 @@ c == sorties == ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testEsopeSegactFile [ self deny: (parser parse: ' subroutine stgbrk( @@ -739,7 +737,7 @@ c == sorties == ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testEsopeSegadjFile [ self deny: (parser parse: ' subroutine stgbrk( @@ -754,7 +752,7 @@ c == sorties == ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testEsopeSegdesFile [ self deny: (parser parse: ' subroutine stgbrk( @@ -769,7 +767,7 @@ c == sorties == ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testEsopeSeginiFile [ self deny: (parser parse: ' subroutine stgbrk( @@ -784,7 +782,7 @@ c == sorties == ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testNonEsopeFile [ self deny: (parser parse: ' subroutine stgbrk( @@ -797,14 +795,14 @@ c == sorties == ') isPetit2Failure ] -{ #category : 'running' } +{ #category : #running } EsopeFullGrammarTest >> testSmallFile [ self deny: (parser parse: self class esopeSmallFile) isPetit2Failure ] -{ #category : 'tests' } +{ #category : #tests } EsopeFullGrammarTest >> testStart [ self deny: diff --git a/src/EsopeImporter-Tests/EsopeGrammarTest.class.st b/src/EsopeImporter-Tests/EsopeGrammarTest.class.st index d40da4c..0b1b3ce 100644 --- a/src/EsopeImporter-Tests/EsopeGrammarTest.class.st +++ b/src/EsopeImporter-Tests/EsopeGrammarTest.class.st @@ -1,20 +1,18 @@ Class { - #name : 'EsopeGrammarTest', - #superclass : 'PP2CompositeNodeTest', + #name : #EsopeGrammarTest, + #superclass : #PP2CompositeNodeTest, #instVars : [ 'sixSpaces' ], - #category : 'EsopeImporter-Tests-Rewriter', - #package : 'EsopeImporter-Tests', - #tag : 'Rewriter' + #category : 'EsopeImporter-Tests-Rewriter' } -{ #category : 'accessing' } +{ #category : #accessing } EsopeGrammarTest >> parserClass [ ^ PPEsopeGrammar ] -{ #category : 'running' } +{ #category : #running } EsopeGrammarTest >> setUp [ super setUp. @@ -22,7 +20,7 @@ EsopeGrammarTest >> setUp [ sixSpaces := ' '. ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testCommentLine [ self @@ -36,7 +34,7 @@ EsopeGrammarTest >> testCommentLine [ rule: #commentLine ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testEmptyLine [ self @@ -45,7 +43,7 @@ EsopeGrammarTest >> testEmptyLine [ rule: #emptyLine ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testEndOfLine [ self parse: String cr rule: #endOfLine. @@ -55,7 +53,7 @@ EsopeGrammarTest >> testEndOfLine [ self parse: String lf rule: #endOfLine ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testEndSegment [ | segment | @@ -70,7 +68,7 @@ EsopeGrammarTest >> testEndSegment [ self fail: ' end segment,values' rule: #endSegment ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testFortranLine [ self @@ -81,7 +79,7 @@ EsopeGrammarTest >> testFortranLine [ self parse: String cr rule: #fortranLine ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testFortranLineEmpty [ self @@ -90,7 +88,7 @@ EsopeGrammarTest >> testFortranLineEmpty [ rule: #fortranLine ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testInclude [ self @@ -108,7 +106,7 @@ EsopeGrammarTest >> testInclude [ rule: #include ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testIncludeDoubleQuote [ @@ -118,7 +116,7 @@ EsopeGrammarTest >> testIncludeDoubleQuote [ rule: #include. ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testIncludeMixed [ @@ -128,7 +126,7 @@ EsopeGrammarTest >> testIncludeMixed [ rule: #include. ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testIncludeNotDoubleQuote [ @@ -138,7 +136,7 @@ EsopeGrammarTest >> testIncludeNotDoubleQuote [ rule: #include. ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testLines [ | aLine | @@ -151,7 +149,7 @@ EsopeGrammarTest >> testLines [ self parse: aLine , (sixSpaces , 'end' , String cr) ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testOptionalBlanks [ self parse: ' ' rule: #optionalBlanks. @@ -160,7 +158,7 @@ EsopeGrammarTest >> testOptionalBlanks [ self parse: '' rule: #optionalBlanks ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testPointer [ self @@ -170,7 +168,7 @@ EsopeGrammarTest >> testPointer [ self fail: 'pointeur splist.list' rule: #pointer ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testPointerExtraSpaces [ self @@ -179,7 +177,7 @@ EsopeGrammarTest >> testPointerExtraSpaces [ rule: #pointer ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testPointers [ self @@ -189,7 +187,7 @@ EsopeGrammarTest >> testPointers [ self fail: 'pointeur splist.list' rule: #pointer ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegact [ self parse: sixSpaces , 'segact,splist' , String cr rule: #segact. @@ -198,7 +196,7 @@ EsopeGrammarTest >> testSegact [ self fail: 'segact,splist' , String cr rule: #segact ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegadj [ self @@ -208,7 +206,7 @@ EsopeGrammarTest >> testSegadj [ self fail: 'segadj,alist' rule: #segadj ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegadjVcAcc226 [ self @@ -218,7 +216,7 @@ EsopeGrammarTest >> testSegadjVcAcc226 [ self fail: 'segadj,pval' rule: #segadj ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegdes [ self @@ -232,7 +230,7 @@ EsopeGrammarTest >> testSegdes [ self fail: 'segdes,alist' rule: #segdes ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegini [ self @@ -242,7 +240,7 @@ EsopeGrammarTest >> testSegini [ self fail: 'segini,rlist' rule: #segini ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegment [ | segment | @@ -265,7 +263,7 @@ EsopeGrammarTest >> testSegment [ self fail: ' segment,values' rule: #segment ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegmentSimpleWithMoreThanSixSpaces [ | segment | @@ -277,7 +275,7 @@ EsopeGrammarTest >> testSegmentSimpleWithMoreThanSixSpaces [ self parse: segment ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegprt [ self @@ -287,7 +285,7 @@ EsopeGrammarTest >> testSegprt [ self fail: 'segprt,rlist' rule: #segprt ] -{ #category : 'tests' } +{ #category : #tests } EsopeGrammarTest >> testSegsup [ self diff --git a/src/EsopeImporter-Tests/EsopeRewriterTest.class.st b/src/EsopeImporter-Tests/EsopeRewriterTest.class.st index 9670f00..68f9803 100644 --- a/src/EsopeImporter-Tests/EsopeRewriterTest.class.st +++ b/src/EsopeImporter-Tests/EsopeRewriterTest.class.st @@ -1,20 +1,18 @@ Class { - #name : 'EsopeRewriterTest', - #superclass : 'PP2CompositeNodeTest', + #name : #EsopeRewriterTest, + #superclass : #PP2CompositeNodeTest, #instVars : [ 'sixSpaces' ], - #category : 'EsopeImporter-Tests-Rewriter', - #package : 'EsopeImporter-Tests', - #tag : 'Rewriter' + #category : 'EsopeImporter-Tests-Rewriter' } -{ #category : 'accessing' } +{ #category : #accessing } EsopeRewriterTest >> parserClass [ ^ PPEsopeRewriter ] -{ #category : 'running' } +{ #category : #running } EsopeRewriterTest >> setUp [ super setUp. @@ -22,7 +20,7 @@ EsopeRewriterTest >> setUp [ sixSpaces := ' ' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testCommentLine [ | sourcecode | @@ -33,7 +31,7 @@ EsopeRewriterTest >> testCommentLine [ self assert: parser generatedCode equals: sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testCommentLineWithStar [ | sourcecode | @@ -44,13 +42,13 @@ EsopeRewriterTest >> testCommentLineWithStar [ self assert: parser generatedCode equals: sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testEsoArImplicit [ self assert: (parser applyTransformation: 'a(b)') equals: 'a(b)' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testEsoSlImplicit [ | code | code := String tab , 'a(/b)', String lf. @@ -59,7 +57,7 @@ EsopeRewriterTest >> testEsoSlImplicit [ self assert: parser generatedCode equals: ' a(S__/b)', String lf. ] -{ #category : 'tests-transformation' } +{ #category : #'tests-transformation' } EsopeRewriterTest >> testEsopeDotTransformationInsideInvocationOrArraySubscript [ | actualSource expectedSource | @@ -71,7 +69,7 @@ EsopeRewriterTest >> testEsopeDotTransformationInsideInvocationOrArraySubscript equals: expectedSource ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testEsopeLineWithLabel [ | actualSource expectedSource | @@ -85,7 +83,7 @@ EsopeRewriterTest >> testEsopeLineWithLabel [ ] -{ #category : 'tests-transformation' } +{ #category : #'tests-transformation' } EsopeRewriterTest >> testEsopeSlashTransformationInsideInvocationOrArraySubscript [ | actualSource expectedSource | @@ -97,7 +95,7 @@ EsopeRewriterTest >> testEsopeSlashTransformationInsideInvocationOrArraySubscrip equals: expectedSource ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testFortranLine [ | sourcecode | @@ -108,21 +106,21 @@ EsopeRewriterTest >> testFortranLine [ self assert: parser generatedCode equals: sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testFortranLineEsoAt [ self parse: sixSpaces , 'rlist.ilist=0', String lf rule: #fortranLine. self assert: parser generatedCode equals: sixSpaces , 'rlist.ilist=0', String lf. ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testFortranLineEsoSlash [ self parse: ' lxs=xs.cstg(/1)', String lf rule: #fortranLine. self assert: parser generatedCode equals: ' lxs=xs.cstg(S__/1)', String lf ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testFortranLineNoEsoAt [ self @@ -137,7 +135,7 @@ EsopeRewriterTest >> testFortranLineNoEsoAt [ ' ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testFortranLineStartWithTab [ | sourcecode | sourcecode := String tab , ' call procedure', String lf. @@ -146,7 +144,7 @@ EsopeRewriterTest >> testFortranLineStartWithTab [ self assert: parser generatedCode equals: ' call procedure', String lf. ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testNoTranslateFormat [ | sourcecode | @@ -158,7 +156,7 @@ EsopeRewriterTest >> testNoTranslateFormat [ equals: sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testPointer [ | sourcecode | @@ -168,7 +166,7 @@ EsopeRewriterTest >> testPointer [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testPointerWithSpaces [ | sourcecode | @@ -178,7 +176,7 @@ EsopeRewriterTest >> testPointerWithSpaces [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testPointers [ | sourcecode | @@ -188,7 +186,7 @@ EsopeRewriterTest >> testPointers [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegact [ | sourcecode | @@ -198,7 +196,7 @@ EsopeRewriterTest >> testSegact [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegactWithSpaces [ | sourcecode | @@ -208,7 +206,7 @@ EsopeRewriterTest >> testSegactWithSpaces [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegadj [ | sourcecode | @@ -218,7 +216,7 @@ EsopeRewriterTest >> testSegadj [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegdefFromBorbk [ | rewriterdCode inputCode | @@ -236,7 +234,7 @@ c@_ endsegment self assert: parser generatedCode equals: rewriterdCode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegdefUpperCase [ | rewriterdCode inputCode | @@ -254,7 +252,7 @@ c@_ endsegment self assert: parser generatedCode equals: rewriterdCode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegdes [ | sourcecode | @@ -264,7 +262,7 @@ EsopeRewriterTest >> testSegdes [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegini [ | sourcecode | @@ -274,7 +272,7 @@ EsopeRewriterTest >> testSegini [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegment [ | finalcode sourcecode | @@ -286,7 +284,7 @@ EsopeRewriterTest >> testSegment [ self assert: parser generatedCode equals: finalcode ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testSegmentArcopySaphtool [ | actualSource expectedSource | @@ -304,7 +302,7 @@ c@_ ENDSEGMENT self assert: parser generatedCode equals: expectedSource. ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testSegmentSimpleWithMoreThanSixSpaces [ | actualSource expectedSource | @@ -322,7 +320,7 @@ c@_ end segment self assert: parser generatedCode equals: expectedSource. ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegprt [ | sourcecode | @@ -332,7 +330,7 @@ EsopeRewriterTest >> testSegprt [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testSegsup [ | sourcecode | @@ -342,7 +340,7 @@ EsopeRewriterTest >> testSegsup [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArray [ @@ -351,7 +349,7 @@ EsopeRewriterTest >> testTranslateEsopeArray [ self assert: parser generatedCode equals: sixSpaces , 'ab.cd(ef)', String lf ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArrayAndEsopeAtWithExpressionAsSubscript [ self @@ -359,7 +357,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayAndEsopeAtWithExpressionAsSubscript equals: 'ur.ubb(S__/jr + 1)' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArrayAsFunctionStatement [ self @@ -367,7 +365,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayAsFunctionStatement [ equals: 'ur.ubb(//jr) = ur.ubb(S__/jr + 1)' ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeArrayDotInsidePar [ | code | @@ -378,7 +376,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayDotInsidePar [ assert: parser generatedCode equals: code ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArrayNew [ self @@ -386,7 +384,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayNew [ equals: 'ab.cd' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArrayNewWithSubscript [ self @@ -394,7 +392,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayNewWithSubscript [ equals: 'ab.cd(i, j+1)' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArrayRelbk [ self @@ -402,7 +400,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayRelbk [ equals: 'ur.ubb(jr) = ur.ubb(jr + 1)' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeArrayWithExpression [ self @@ -410,7 +408,7 @@ EsopeRewriterTest >> testTranslateEsopeArrayWithExpression [ equals: 'ur.ubb(S__/jr/1)' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeAtBinaryOperator [ self @@ -422,7 +420,7 @@ EsopeRewriterTest >> testTranslateEsopeAtBinaryOperator [ equals: ' if((rlist.ilist).gt.nlist)then' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeAtEqOperator [ self @@ -430,20 +428,20 @@ EsopeRewriterTest >> testTranslateEsopeAtEqOperator [ equals: ' if(lxs.eq.0)then' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeAtNoDot [ self assert: (parser applyTransformation: 'abc') equals: 'abc' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeAtOneDot [ self assert: (parser applySlashTransformation: 'abc.def') equals: 'abc.def' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeAtTwoDots [ self @@ -451,7 +449,7 @@ EsopeRewriterTest >> testTranslateEsopeAtTwoDots [ equals: 'abc.def=opq.xyz' ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeIFLogical [ | sourcecode | @@ -462,7 +460,7 @@ EsopeRewriterTest >> testTranslateEsopeIFLogical [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeIFLogicalWithLineContinuation [ | sourcecode | @@ -475,7 +473,7 @@ EsopeRewriterTest >> testTranslateEsopeIFLogicalWithLineContinuation [ self assert: parser generatedCode equals: ' ' , sourcecode ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeIFLogicalWithSlash [ | sourcecode | @@ -487,7 +485,7 @@ EsopeRewriterTest >> testTranslateEsopeIFLogicalWithSlash [ self assert: parser generatedCode equals: 'c@_ ' , sourcecode ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeMultipleSlashes [ self parse: sixSpaces, 'abc.def(/def.xyz)=opq.xyz(/abc.def)', String lf rule: #fortranLine. @@ -495,7 +493,7 @@ EsopeRewriterTest >> testTranslateEsopeMultipleSlashes [ self assert: parser generatedCode equals: sixSpaces, 'abc.def(S__/def.xyz)=opq.xyz(S__/abc.def)', String lf ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeNotDot [ self @@ -503,7 +501,7 @@ EsopeRewriterTest >> testTranslateEsopeNotDot [ equals: ' A=.NOT.B ' ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeSlash10 [ | sourcecode | @@ -514,7 +512,7 @@ EsopeRewriterTest >> testTranslateEsopeSlash10 [ self assert: parser generatedCode equals: sixSpaces , ' A = B ( S__/1 )' , String lf ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeSlash20 [ | sourcecode | @@ -527,7 +525,7 @@ EsopeRewriterTest >> testTranslateEsopeSlash20 [ self assert: parser generatedCode equals: sixSpaces , ' A = B ( S__/1 )', String lf ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeSlashEsopeAt [ self parse: sixSpaces, 'abc.def(/1)', String lf rule: #fortranLine. @@ -537,7 +535,7 @@ EsopeRewriterTest >> testTranslateEsopeSlashEsopeAt [ equals: sixSpaces, 'abc.def(S__/1)', String lf ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeSlashNone [ self @@ -545,7 +543,7 @@ EsopeRewriterTest >> testTranslateEsopeSlashNone [ equals: 'abc.def' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeSlashOne [ self @@ -553,7 +551,7 @@ EsopeRewriterTest >> testTranslateEsopeSlashOne [ equals: 'S__(D__(abc,def),1)' ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeSlashSlash [ self @@ -562,7 +560,7 @@ EsopeRewriterTest >> testTranslateEsopeSlashSlash [ equals: 'C //fin repeter "decouper chaque chaine"' ] -{ #category : 'tests-todo' } +{ #category : #'tests-todo' } EsopeRewriterTest >> testTranslateEsopeSlashWithDotInsidePar [ | code | @@ -574,7 +572,7 @@ EsopeRewriterTest >> testTranslateEsopeSlashWithDotInsidePar [ equals: sixSpaces , 'rlist.elist(S__/rlist.ilist)=ms' , String lf ] -{ #category : 'tests' } +{ #category : #tests } EsopeRewriterTest >> testTranslateEsopeSlashWithSpacesBeforeLeftPar [ self diff --git a/src/EsopeImporter-Tests/FamixEsopeResolverTest.class.st b/src/EsopeImporter-Tests/FamixEsopeResolverTest.class.st index 3bda4fc..7964138 100644 --- a/src/EsopeImporter-Tests/FamixEsopeResolverTest.class.st +++ b/src/EsopeImporter-Tests/FamixEsopeResolverTest.class.st @@ -1,15 +1,13 @@ Class { - #name : 'FamixEsopeResolverTest', - #superclass : 'FamixEsopeUtilitiesTest', + #name : #FamixEsopeResolverTest, + #superclass : #FamixEsopeUtilitiesTest, #instVars : [ 'resolver' ], - #category : 'EsopeImporter-Tests-Importer', - #package : 'EsopeImporter-Tests', - #tag : 'Importer' + #category : 'EsopeImporter-Tests-Importer' } -{ #category : 'running' } +{ #category : #running } FamixEsopeResolverTest >> setUp [ super setUp. @@ -17,7 +15,7 @@ FamixEsopeResolverTest >> setUp [ resolver := FamixEsopeResolver on: mooseModel. ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testMakePointerFromVariable [ "We have a pointer variable and a normal variable with the same name the 2nd should be merged into the 1st which keeps its declared type and @@ -48,7 +46,7 @@ FamixEsopeResolverTest >> testMakePointerFromVariable [ self assert: subroutine localVariables size equals: 1. ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testMergeVariableInto [ "We have 2 variables with the same name one should be merged into the other which keeps its declared type and gets the accesses of the 1st" @@ -85,7 +83,7 @@ FamixEsopeResolverTest >> testMergeVariableInto [ self assert: variable1 declaredType name equals: 'INTEGER' ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testRegisterImplicitDefault [ " @@ -106,7 +104,7 @@ FamixEsopeResolverTest >> testRegisterImplicitDefault [ self assert: (pu implicitDictionary at: $i) equals: 'integer'. ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testRegisterImplicitMultiple [ " subroutine rtn @@ -135,7 +133,7 @@ FamixEsopeResolverTest >> testRegisterImplicitMultiple [ self assert: (pu implicitDictionary at: $e) equals: 'real' ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testRegisterImplicitNone [ " @@ -155,7 +153,7 @@ FamixEsopeResolverTest >> testRegisterImplicitNone [ self assert: pu implicitDictionary isEmpty ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testRegisterImplicitRange [ " subroutine rtn @@ -180,7 +178,7 @@ FamixEsopeResolverTest >> testRegisterImplicitRange [ self assert: (pu implicitDictionary at: $d) equals: 'real' ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testRegisterImplicitSegment [ " @@ -205,7 +203,7 @@ FamixEsopeResolverTest >> testRegisterImplicitSegment [ self assert: (main implicitDictionary at: 'point') equals: 'point' ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testRegisterImplicitSimple [ " subroutine rtn @@ -228,7 +226,7 @@ FamixEsopeResolverTest >> testRegisterImplicitSimple [ self assert: (pu implicitDictionary at: $b) equals: 'real' ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testRequalifyFunctionDeclarations [ " @@ -255,7 +253,7 @@ FamixEsopeResolverTest >> testRequalifyFunctionDeclarations [ ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testRequalifyParameterDeclarations [ " @@ -284,7 +282,7 @@ FamixEsopeResolverTest >> testRequalifyParameterDeclarations [ ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccesses [ "program main integer var @@ -307,7 +305,7 @@ FamixEsopeResolverTest >> testResolveAccesses [ self assert: access variable equals: main localVariables first. ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesForALocalVariableImplicit [ "program main var @@ -338,7 +336,7 @@ FamixEsopeResolverTest >> testResolveAccessesForALocalVariableImplicit [ ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesForAParameter [ | subrtn access | @@ -365,7 +363,7 @@ FamixEsopeResolverTest >> testResolveAccessesForAParameter [ self assert: access accessor equals: subrtn ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesForAPointerDotAttribute [ | main access access2 varP typePoint | @@ -414,7 +412,7 @@ FamixEsopeResolverTest >> testResolveAccessesForAPointerDotAttribute [ self assert: access2 accessor equals: main ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesForAPointerVariableDeclared [ | main access var | @@ -451,7 +449,7 @@ FamixEsopeResolverTest >> testResolveAccessesForAPointerVariableDeclared [ self assert: access accessor equals: main ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesForAPointerVariableImplicit [ | subrtn access var | @@ -489,7 +487,7 @@ FamixEsopeResolverTest >> testResolveAccessesForAPointerVariableImplicit [ self assert: access accessor equals: subrtn ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesForAnAttribute [ | subrtn access type | @@ -522,7 +520,7 @@ FamixEsopeResolverTest >> testResolveAccessesForAnAttribute [ self assert: access accessor equals: subrtn ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesFromStatementFunctionToParameter [ "program main identity(x) = x @@ -550,7 +548,7 @@ FamixEsopeResolverTest >> testResolveAccessesFromStatementFunctionToParameter [ ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesFromStatementFunctionToParentLocalVariable [ "program main var = 1 @@ -583,7 +581,7 @@ FamixEsopeResolverTest >> testResolveAccessesFromStatementFunctionToParentLocalV self assert: fct accesses anyOne variable equals: var. ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesInIncludedFileToInside [ "Resolve accesses from includedFile to variable declared in the same includedIile @@ -607,7 +605,7 @@ FamixEsopeResolverTest >> testResolveAccessesInIncludedFileToInside [ self assert: access variable equals: accessor localVariables first. ] -{ #category : 'test - resolveAccess' } +{ #category : #'test - resolveAccess' } FamixEsopeResolverTest >> testResolveAccessesInIncludedFileToOutside [ "Do not resolve accesses from includedFile to variable declared outside the same includedIile (because resolution depends on where the file is included) @@ -631,7 +629,7 @@ FamixEsopeResolverTest >> testResolveAccessesInIncludedFileToOutside [ self assert: access variable name equals: 'var'. ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveDeclaredTypeOfPointers [ | sub entity type var | @@ -662,7 +660,7 @@ FamixEsopeResolverTest >> testResolveDeclaredTypeOfPointers [ self assert: entity declaredType equals: type ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testResolveImplicitFunctionType [ | sub | @@ -674,7 +672,7 @@ FamixEsopeResolverTest >> testResolveImplicitFunctionType [ self assert: sub declaredType name equals: 'real' ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testResolveImplicitParameter [ " @@ -697,7 +695,7 @@ FamixEsopeResolverTest >> testResolveImplicitParameter [ equals: 'integer' ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testResolveImplicitParameterNone [ " @@ -721,7 +719,7 @@ FamixEsopeResolverTest >> testResolveImplicitParameterNone [ ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testResolveImplicitParameterRange [ " subroutine sub(var) @@ -748,7 +746,7 @@ FamixEsopeResolverTest >> testResolveImplicitParameterRange [ self assert: entity declaredType name equals: 'character' ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveImplicitPointer [ | sub type var | @@ -777,7 +775,7 @@ FamixEsopeResolverTest >> testResolveImplicitPointer [ self assert: var declaredType equals: type ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testResolveImplicitType [ | sub | @@ -792,7 +790,7 @@ FamixEsopeResolverTest >> testResolveImplicitType [ ] -{ #category : 'test - implicit' } +{ #category : #'test - implicit' } FamixEsopeResolverTest >> testResolveImplicitTypeInStatementFunction [ | sub f | @@ -809,7 +807,7 @@ FamixEsopeResolverTest >> testResolveImplicitTypeInStatementFunction [ ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveImplicits [ " @@ -833,7 +831,7 @@ FamixEsopeResolverTest >> testResolveImplicits [ ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveImplicitsDeclared [ " @@ -860,7 +858,7 @@ FamixEsopeResolverTest >> testResolveImplicitsDeclared [ ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveImplicitsForFunction [ " function fct() @@ -878,7 +876,7 @@ FamixEsopeResolverTest >> testResolveImplicitsForFunction [ self assert: fct declaredType name equals: 'real' ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveImplicitsForStatementFunction [ " function fct() @@ -899,7 +897,7 @@ FamixEsopeResolverTest >> testResolveImplicitsForStatementFunction [ self assert: fct declaredType name equals: 'real' ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveImplicitsNone [ " @@ -925,7 +923,7 @@ FamixEsopeResolverTest >> testResolveImplicitsNone [ ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveIncludeDirective [ " +------ point.seg ----------------------------------+ @@ -972,7 +970,7 @@ FamixEsopeResolverTest >> testResolveIncludeDirective [ self assert: sub inclusions anyOne includedBy equals: main ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveInvocationToIntrinsic [ | invocation callee caller | @@ -992,7 +990,7 @@ FamixEsopeResolverTest >> testResolveInvocationToIntrinsic [ self assert: invocation candidates first class equals: FamixF77IntrinsicRoutine. ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveInvocationToWrite [ | invocation caller | @@ -1012,7 +1010,7 @@ FamixEsopeResolverTest >> testResolveInvocationToWrite [ self assert: invocation candidates first class equals: FamixF77IntrinsicRoutine. ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveInvocations [ | invocation callee caller | @@ -1034,7 +1032,7 @@ FamixEsopeResolverTest >> testResolveInvocations [ self assert: invocation candidates first equals: callee. ] -{ #category : 'tests' } +{ #category : #tests } FamixEsopeResolverTest >> testResolveInvocationsWrongArgumentNumber [ | invocation callee caller | diff --git a/src/EsopeImporter-Tests/FamixEsopeUtilitiesTest.class.st b/src/EsopeImporter-Tests/FamixEsopeUtilitiesTest.class.st index 0a62ca4..771d610 100644 --- a/src/EsopeImporter-Tests/FamixEsopeUtilitiesTest.class.st +++ b/src/EsopeImporter-Tests/FamixEsopeUtilitiesTest.class.st @@ -1,16 +1,14 @@ Class { - #name : 'FamixEsopeUtilitiesTest', - #superclass : 'TestCase', + #name : #FamixEsopeUtilitiesTest, + #superclass : #TestCase, #instVars : [ 'mooseModel', 'programFile' ], - #category : 'EsopeImporter-Tests-Importer', - #package : 'EsopeImporter-Tests', - #tag : 'Importer' + #category : 'EsopeImporter-Tests-Importer' } -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> anchorFrom: startPoint to: endPoint [ ^ FamixF77IndexedFileAnchor new @@ -23,7 +21,7 @@ FamixEsopeUtilitiesTest >> anchorFrom: startPoint to: endPoint [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultAccess: varName [ ^ FamixF77Access new @@ -34,13 +32,13 @@ FamixEsopeUtilitiesTest >> defaultAccess: varName [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultAnchor [ ^ self anchorFrom: 1 @ 7 to: 2 @ 10 ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultAttribute: varName withType: typeName [ ^ (self newEntity: FamixFortranAttribute) @@ -49,14 +47,14 @@ FamixEsopeUtilitiesTest >> defaultAttribute: varName withType: typeName [ declaredType: (self defaultType: typeName) ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultFunction: name [ ^ (self newEntity: FamixF77PUFunction named: name) programFile: programFile ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultIASTInvocation: name [ ^ IASTInvocation new @@ -64,7 +62,7 @@ FamixEsopeUtilitiesTest >> defaultIASTInvocation: name [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultIASTVarAccess: name [ ^ IASTVarAccess new @@ -73,13 +71,13 @@ FamixEsopeUtilitiesTest >> defaultIASTVarAccess: name [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultImplicitNone [ ^ IASTImplicitTypingRule new ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultInvocation: name [ ^ FamixF77Invocation new @@ -90,20 +88,20 @@ FamixEsopeUtilitiesTest >> defaultInvocation: name [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultMain: name [ ^ (self newEntity: FamixF77PUMain named: name) programFile: programFile ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultParameter: name [ ^ self newEntity: FamixF77Parameter named: name ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultProgramFile: aFilename [ ^ (self newEntity: FamixF77ProgramFile named: aFilename) @@ -111,14 +109,14 @@ FamixEsopeUtilitiesTest >> defaultProgramFile: aFilename [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultProgramUnit: name forType: aFamixClass belongsTo: aFamixProgramFile [ ^ (self newEntity: aFamixClass named: name) programFile: aFamixProgramFile ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultSegment: segmentName with: dictDeclarations [ ^ (self newEntity: FamixEsopeSegment) @@ -129,21 +127,21 @@ FamixEsopeUtilitiesTest >> defaultSegment: segmentName with: dictDeclarations [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultSubroutine: name [ ^ (self newEntity: FamixF77PUSubroutine named: name) programFile: programFile ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultSubroutine: name belongsTo: aFamixProgramFile [ ^ (self newEntity: FamixF77PUSubroutine named: name) programFile: aFamixProgramFile ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultType: anIntrinsicFortranType [ ^FamixF77TypeIntrinsic new @@ -152,20 +150,20 @@ FamixEsopeUtilitiesTest >> defaultType: anIntrinsicFortranType [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> defaultVariable: name withType: type [ ^ (self newEntity: FamixF77Variable named: name) declaredType: (self defaultType: type) ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> externalDeclaration: name [ ^ self newEntity: FamixF77ExternalDeclaration named: name ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> iastTypeRef: typeName [ ^ IASTTypeRef new @@ -174,7 +172,7 @@ FamixEsopeUtilitiesTest >> iastTypeRef: typeName [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> implicitRule: typeName range: ranges [ ^ IASTImplicitTypingRule new @@ -183,7 +181,7 @@ FamixEsopeUtilitiesTest >> implicitRule: typeName range: ranges [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> newEntity: aFamixClass [ ^ aFamixClass new @@ -192,14 +190,14 @@ FamixEsopeUtilitiesTest >> newEntity: aFamixClass [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> newEntity: aFamixClass named: aName [ ^ (self newEntity: aFamixClass) name: aName ] -{ #category : 'default values' } +{ #category : #'default values' } FamixEsopeUtilitiesTest >> newPU: aName [ ^ (self newEntity: FamixF77PUSubroutine named: aName) @@ -207,7 +205,7 @@ FamixEsopeUtilitiesTest >> newPU: aName [ yourself ] -{ #category : 'running' } +{ #category : #running } FamixEsopeUtilitiesTest >> setUp [ super setUp. diff --git a/src/EsopeImporter-Tests/FortranProjectImporterTest.class.st b/src/EsopeImporter-Tests/FortranProjectImporterTest.class.st index 9f89fdf..92545d4 100644 --- a/src/EsopeImporter-Tests/FortranProjectImporterTest.class.st +++ b/src/EsopeImporter-Tests/FortranProjectImporterTest.class.st @@ -2,18 +2,16 @@ I am a test class for testing the management of files and paths in FortranProjectImporter " Class { - #name : 'FortranProjectImporterTest', - #superclass : 'FamixEsopeUtilitiesTest', + #name : #FortranProjectImporterTest, + #superclass : #FamixEsopeUtilitiesTest, #instVars : [ 'importer', 'fileSystem' ], - #category : 'EsopeImporter-Tests-Importer', - #package : 'EsopeImporter-Tests', - #tag : 'Importer' + #category : 'EsopeImporter-Tests-Importer' } -{ #category : 'running' } +{ #category : #running } FortranProjectImporterTest >> prepareWorkspace [ | f1 f2 | @@ -48,7 +46,7 @@ FortranProjectImporterTest >> prepareWorkspace [ ] -{ #category : 'running' } +{ #category : #running } FortranProjectImporterTest >> setUp [ super setUp. @@ -61,7 +59,7 @@ FortranProjectImporterTest >> setUp [ importer includeFolder: fileSystem / 'project' / 'includes' ] -{ #category : 'running' } +{ #category : #running } FortranProjectImporterTest >> tearDown [ | folder | @@ -78,7 +76,7 @@ FortranProjectImporterTest >> tearDown [ ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testCollectFilesIn [ | files | @@ -97,7 +95,7 @@ FortranProjectImporterTest >> testCollectFilesIn [ ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testCollectFilesInWithExtensions [ | files | @@ -110,7 +108,7 @@ FortranProjectImporterTest >> testCollectFilesInWithExtensions [ self assert: files anyOne fullName equals: '/project/includes/inc2/f3.obj' ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testCollectFilesInWithExtensionsSeveralFiles [ | files | @@ -125,7 +123,7 @@ FortranProjectImporterTest >> testCollectFilesInWithExtensionsSeveralFiles [ hasSameElements: #( '/project/includes/inc1/f1.inc' '/project/includes/inc2/f1.inc') ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testCollectIncludedFileNames [ self prepareWorkspace. @@ -135,7 +133,7 @@ FortranProjectImporterTest >> testCollectIncludedFileNames [ hasSameElements: #( 'f1.inc' 'f2.seg' 'f3.obj' ) ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testDeEsopifyFromTo [ | srcFile destFile | @@ -158,7 +156,7 @@ c@_ segini p ' ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testEsopeToFortran [ | tempFolder | @@ -178,7 +176,7 @@ FortranProjectImporterTest >> testEsopeToFortran [ ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testFakeEsopeProgramUnitFromTo [ | srcFile resultFile | @@ -202,7 +200,7 @@ a line ' ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testFortranToJsonAST [ | tempFolder | @@ -228,7 +226,7 @@ FortranProjectImporterTest >> testFortranToJsonAST [ ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testGetIncludedFile [ | names | @@ -237,7 +235,7 @@ FortranProjectImporterTest >> testGetIncludedFile [ self assert: names equals: 'blah.inc' ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testIASTToFamix [ "json file and assert: taken from IASTToFamixVisitorTest >> testFamixFortran77PUFunctionWithParameter" @@ -275,7 +273,7 @@ FortranProjectImporterTest >> testIASTToFamix [ self assert: param parentBehaviouralEntity equals: fmxEntity. ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testIncludedFilesToEsope [ | tempFolder | @@ -303,7 +301,7 @@ FortranProjectImporterTest >> testIncludedFilesToEsope [ ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testIncludedNamesIn [ | includer files | self prepareWorkspace. @@ -316,7 +314,7 @@ FortranProjectImporterTest >> testIncludedNamesIn [ hasSameElements: #( 'f1.inc' 'f3.obj' ) ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testJsonASTToIAST [ "json file and assert: taken from JsonToIASTVisitorTest >> testMultipleStatements @@ -358,7 +356,7 @@ FortranProjectImporterTest >> testJsonASTToIAST [ ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testPathOfIn [ | path | @@ -369,7 +367,7 @@ FortranProjectImporterTest >> testPathOfIn [ self assert: path fullName equals: '/included.h' ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testPathOfInFirstPathFound [ | path | @@ -383,7 +381,7 @@ FortranProjectImporterTest >> testPathOfInFirstPathFound [ self assert: path fullName equals: '/inc1/included.h' ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testPathOfInNoExtension [ | path | @@ -395,7 +393,7 @@ FortranProjectImporterTest >> testPathOfInNoExtension [ self assert: path fullName equals: '/included' ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testPathOfInNotFound [ | path | @@ -406,7 +404,7 @@ FortranProjectImporterTest >> testPathOfInNotFound [ self assert: path equals: nil ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testPathOfInSubDirectory [ | path | @@ -418,7 +416,7 @@ FortranProjectImporterTest >> testPathOfInSubDirectory [ self assert: path fullName equals: '/includes/included.h' ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testPathOfInWithPath [ | path | @@ -430,7 +428,7 @@ FortranProjectImporterTest >> testPathOfInWithPath [ self assert: path fullName equals: '/includes/included.h' ] -{ #category : 'tests - import steps' } +{ #category : #'tests - import steps' } FortranProjectImporterTest >> testPostImportChecks [ "test copied from #testSanityCheckParameterPass" @@ -446,7 +444,7 @@ FortranProjectImporterTest >> testPostImportChecks [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckAccessNoAccessor [ | access | @@ -457,7 +455,7 @@ FortranProjectImporterTest >> testSanityCheckAccessNoAccessor [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckAccessNoVariable [ | access | @@ -468,7 +466,7 @@ FortranProjectImporterTest >> testSanityCheckAccessNoVariable [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckAccessPass [ | access | @@ -480,7 +478,7 @@ FortranProjectImporterTest >> testSanityCheckAccessPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckAttributeNoDeclaredType [ | var | @@ -491,7 +489,7 @@ FortranProjectImporterTest >> testSanityCheckAttributeNoDeclaredType [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckAttributeNoParent [ | var | @@ -502,7 +500,7 @@ FortranProjectImporterTest >> testSanityCheckAttributeNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckAttributePass [ | var | @@ -514,7 +512,7 @@ FortranProjectImporterTest >> testSanityCheckAttributePass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckEsopeCommandNoAccessor [ | cmd | @@ -526,7 +524,7 @@ FortranProjectImporterTest >> testSanityCheckEsopeCommandNoAccessor [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckEsopeCommandNoVariable [ | cmd | @@ -537,7 +535,7 @@ FortranProjectImporterTest >> testSanityCheckEsopeCommandNoVariable [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckEsopeCommandNotPointer [ | cmd | @@ -550,7 +548,7 @@ FortranProjectImporterTest >> testSanityCheckEsopeCommandNotPointer [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckEsopeCommandPass [ | cmd | @@ -563,7 +561,7 @@ FortranProjectImporterTest >> testSanityCheckEsopeCommandPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckIncludedFileNoInclusion [ | includedFile | @@ -574,7 +572,7 @@ FortranProjectImporterTest >> testSanityCheckIncludedFileNoInclusion [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckIncludedFileNoParent [ | includedFile | @@ -585,7 +583,7 @@ FortranProjectImporterTest >> testSanityCheckIncludedFileNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckIncludedFilePass [ | includedFile | @@ -597,7 +595,7 @@ FortranProjectImporterTest >> testSanityCheckIncludedFilePass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckIntrinsicRoutineNoInvoker [ | includedFile | @@ -608,7 +606,7 @@ FortranProjectImporterTest >> testSanityCheckIntrinsicRoutineNoInvoker [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckIntrinsicRoutinePass [ | includedFile | @@ -619,7 +617,7 @@ FortranProjectImporterTest >> testSanityCheckIntrinsicRoutinePass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckInvocationNoCandidates [ | invok | @@ -631,7 +629,7 @@ FortranProjectImporterTest >> testSanityCheckInvocationNoCandidates [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckInvocationNoSender [ | invok | @@ -642,7 +640,7 @@ FortranProjectImporterTest >> testSanityCheckInvocationNoSender [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckInvocationPass [ | invok | @@ -654,7 +652,7 @@ FortranProjectImporterTest >> testSanityCheckInvocationPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckMainNoParent [ | main | @@ -664,7 +662,7 @@ FortranProjectImporterTest >> testSanityCheckMainNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckMainPass [ | main | @@ -675,7 +673,7 @@ FortranProjectImporterTest >> testSanityCheckMainPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckPUFunctionNoDeclaredType [ | fct | @@ -686,7 +684,7 @@ FortranProjectImporterTest >> testSanityCheckPUFunctionNoDeclaredType [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckPUFunctionNoParent [ | fct | @@ -697,7 +695,7 @@ FortranProjectImporterTest >> testSanityCheckPUFunctionNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckPUFunctionPass [ | fct | @@ -709,7 +707,7 @@ FortranProjectImporterTest >> testSanityCheckPUFunctionPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckParameterNoDeclaredType [ | param | @@ -720,7 +718,7 @@ FortranProjectImporterTest >> testSanityCheckParameterNoDeclaredType [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckParameterNoParent [ | param | @@ -731,7 +729,7 @@ FortranProjectImporterTest >> testSanityCheckParameterNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckParameterPass [ | param | @@ -743,7 +741,7 @@ FortranProjectImporterTest >> testSanityCheckParameterPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckStatementFunctionNoParent [ | fct | @@ -753,7 +751,7 @@ FortranProjectImporterTest >> testSanityCheckStatementFunctionNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckStatementFunctionPass [ | fct | @@ -764,7 +762,7 @@ FortranProjectImporterTest >> testSanityCheckStatementFunctionPass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckUnknownVariableNoAccess [ | var | @@ -775,7 +773,7 @@ FortranProjectImporterTest >> testSanityCheckUnknownVariableNoAccess [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckUnknownVariablePass [ | var | @@ -786,7 +784,7 @@ FortranProjectImporterTest >> testSanityCheckUnknownVariablePass [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckVariableNoDeclaredType [ | var | @@ -797,7 +795,7 @@ FortranProjectImporterTest >> testSanityCheckVariableNoDeclaredType [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckVariableNoParent [ | var | @@ -808,7 +806,7 @@ FortranProjectImporterTest >> testSanityCheckVariableNoParent [ ] -{ #category : 'test - sanityCheck' } +{ #category : #'test - sanityCheck' } FortranProjectImporterTest >> testSanityCheckVariablePass [ | var | @@ -820,7 +818,7 @@ FortranProjectImporterTest >> testSanityCheckVariablePass [ ] -{ #category : 'tests - file-management' } +{ #category : #'tests - file-management' } FortranProjectImporterTest >> testUnquoteIncludedFile [ self assert: (importer unquoteIncludedFile: 'blah') equals: 'blah'. diff --git a/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st b/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st index 903b7ed..5f2ba44 100644 --- a/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st +++ b/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st @@ -2,18 +2,16 @@ An IASTVisitorF77Test is a test class for testing the behavior of IASTVisitorF77 " Class { - #name : 'IASTToFamixVisitorTest', - #superclass : 'TestCase', + #name : #IASTToFamixVisitorTest, + #superclass : #TestCase, #instVars : [ 'visitor', 'programFile' ], - #category : 'EsopeImporter-Tests-Visitor', - #package : 'EsopeImporter-Tests', - #tag : 'Visitor' + #category : 'EsopeImporter-Tests-Visitor' } -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> anchorFrom: startPoint to: endPoint [ ^ IASTIndexedFileAnchor new @@ -25,13 +23,13 @@ IASTToFamixVisitorTest >> anchorFrom: startPoint to: endPoint [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultAnchor [ ^ self anchorFrom: 1 @ 7 to: 2 @ 10 ] -{ #category : 'default values' } +{ #category : #'default values' } IASTToFamixVisitorTest >> defaultEmptySegment: segmentName [ ^ IASTEsopeSegment new @@ -41,13 +39,13 @@ IASTToFamixVisitorTest >> defaultEmptySegment: segmentName [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultImplicitNone [ ^ IASTImplicit new ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultNamedEntity: entityName for: aClassName [ ^ aClassName new @@ -56,7 +54,7 @@ IASTToFamixVisitorTest >> defaultNamedEntity: entityName for: aClassName [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultParameter [ ^ IASTParameter new @@ -65,7 +63,7 @@ IASTToFamixVisitorTest >> defaultParameter [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } IASTToFamixVisitorTest >> defaultSegment: segmentName [ ^ IASTEsopeSegment new @@ -75,7 +73,7 @@ IASTToFamixVisitorTest >> defaultSegment: segmentName [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } IASTToFamixVisitorTest >> defaultSegment: segmentName with: dictDeclarations [ ^ IASTEsopeSegment new @@ -86,7 +84,7 @@ IASTToFamixVisitorTest >> defaultSegment: segmentName with: dictDeclarations [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultSegmentComand: commandName on: varName [ ^ IASTEsopeSegCommand new @@ -96,7 +94,7 @@ IASTToFamixVisitorTest >> defaultSegmentComand: commandName on: varName [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultType: typeName [ ^ IASTTypeRef new @@ -105,13 +103,13 @@ IASTToFamixVisitorTest >> defaultType: typeName [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultVarAccess: name [ ^ self defaultVarAccess: name isWrite: false ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultVarAccess: name isWrite: boolean [ ^ IASTVarAccess new @@ -121,7 +119,7 @@ IASTToFamixVisitorTest >> defaultVarAccess: name isWrite: boolean [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } IASTToFamixVisitorTest >> defaultVarEsoAt: entities [ ^ IASTVarEsoAt new @@ -131,7 +129,7 @@ IASTToFamixVisitorTest >> defaultVarEsoAt: entities [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } IASTToFamixVisitorTest >> defaultVarEsoSl: entities [ ^ IASTVarEsoSl new @@ -141,7 +139,7 @@ IASTToFamixVisitorTest >> defaultVarEsoSl: entities [ yourself ] -{ #category : 'default values' } +{ #category : #'default values' } IASTToFamixVisitorTest >> defaultVariable: assoc [ ^ IASTVariable new @@ -154,7 +152,7 @@ IASTToFamixVisitorTest >> defaultVariable: assoc [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> defaultVariable: varName withType: typeName [ ^ IASTVariable new @@ -164,7 +162,7 @@ IASTToFamixVisitorTest >> defaultVariable: varName withType: typeName [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> implicitRule: typeName range: ranges [ ^ IASTImplicitTypingRule new @@ -173,14 +171,14 @@ IASTToFamixVisitorTest >> implicitRule: typeName range: ranges [ yourself ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> jsonToIAST: jsonCode [ | jsonVisitor | jsonVisitor := JsonToIASTVisitor new. ^jsonVisitor visitProgramFile: (NeoJSONReader fromString: jsonCode) ] -{ #category : 'running' } +{ #category : #running } IASTToFamixVisitorTest >> setUp [ super setUp. @@ -188,7 +186,7 @@ IASTToFamixVisitorTest >> setUp [ visitor := IASTToFamixFortranVisitor new. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testComment [ | entity comment | @@ -213,7 +211,7 @@ IASTToFamixVisitorTest >> testComment [ self assert: comment commentedEntity equals: entity programUnits first. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testDummyFamixFortran77Subroutine [ " @@ -261,7 +259,7 @@ c@_ end segment self assert: entity localVariables first name equals: 'l' ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeAccessors [ " @@ -297,7 +295,7 @@ IASTToFamixVisitorTest >> testFamixEsopeAccessors [ self assert: var entityName equals: 'attr'. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeAccessorsWithArg [ " @@ -346,7 +344,7 @@ IASTToFamixVisitorTest >> testFamixEsopeAccessorsWithArg [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeAccessorsWithArgsWithDot [ " @@ -389,7 +387,7 @@ IASTToFamixVisitorTest >> testFamixEsopeAccessorsWithArgsWithDot [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeCommandSegini [ " @@ -413,7 +411,7 @@ IASTToFamixVisitorTest >> testFamixEsopeCommandSegini [ self assert: famixSegini commandName equals: 'segini'. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopePointerAccess [ "SUBROUTINE sub ptr.att = 5 @@ -449,7 +447,7 @@ IASTToFamixVisitorTest >> testFamixEsopePointerAccess [ (acc attributeAt: #entity ifAbsent: ["impossible"]) entityName = 'att']). ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopePointerDeclaration [ " program main segment, pers @@ -475,7 +473,7 @@ IASTToFamixVisitorTest >> testFamixEsopePointerDeclaration [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeSegment [ " @@ -524,7 +522,7 @@ IASTToFamixVisitorTest >> testFamixEsopeSegment [ self assert: attribute declaredType name equals: 'integer'. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeSlashWithLitteralDim [ " @@ -569,7 +567,7 @@ c ptr.attr(/1) equals: 'ptr' ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77 [ | entity | @@ -594,7 +592,7 @@ IASTToFamixVisitorTest >> testFamixFortran77 [ ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77Call [ "subroutine mysub write(*,*) msg @@ -626,7 +624,7 @@ IASTToFamixVisitorTest >> testFamixFortran77Call [ self assert: entity accesses size equals: 1. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77Comment [ | entity | programFile body: { IASTComment new @@ -645,7 +643,7 @@ IASTToFamixVisitorTest >> testFamixFortran77Comment [ self assert: entity content equals: ' a comment'. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77CommentInSubRoutine [ | entity | programFile body: { IASTSubroutine new @@ -667,7 +665,7 @@ IASTToFamixVisitorTest >> testFamixFortran77CommentInSubRoutine [ self assert: entity content equals: ' a comment'. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixFortran77ESOAtWithArrayArgument [ "Special case of a D__ function call with an array as argument @@ -686,7 +684,7 @@ IASTToFamixVisitorTest >> testFamixFortran77ESOAtWithArrayArgument [ ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77Invocation [ | entity invocation caller callee | @@ -714,7 +712,7 @@ IASTToFamixVisitorTest >> testFamixFortran77Invocation [ self assert: (invocation attributeAt: #entity ifAbsent: [ nil ] ) isNotNil ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77LocalVariable [ | entity var | @@ -739,7 +737,7 @@ IASTToFamixVisitorTest >> testFamixFortran77LocalVariable [ equals: entity programUnits first ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77PUBlockdata [ | entity | @@ -758,7 +756,7 @@ IASTToFamixVisitorTest >> testFamixFortran77PUBlockdata [ self assert: entity programFile isNotNil. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77PUFunction [ | entity | @@ -776,7 +774,7 @@ IASTToFamixVisitorTest >> testFamixFortran77PUFunction [ self assert: entity programFile isNotNil. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77PUFunctionWithParameter [ | entity param | @@ -801,7 +799,7 @@ IASTToFamixVisitorTest >> testFamixFortran77PUFunctionWithParameter [ self assert: param parentBehaviouralEntity equals: entity. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77PUMain [ | entity | @@ -819,7 +817,7 @@ IASTToFamixVisitorTest >> testFamixFortran77PUMain [ self assert: entity programFile isNotNil. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77ProgramFile [ | entity | programFile accept: visitor. @@ -835,7 +833,7 @@ IASTToFamixVisitorTest >> testFamixFortran77ProgramFile [ self assert: entity programUnits size equals: 0 ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77SourceAnchor [ | entity | entity := self defaultAnchor accept: visitor. @@ -848,7 +846,7 @@ IASTToFamixVisitorTest >> testFamixFortran77SourceAnchor [ self assert: entity endColumn equals: 10. ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testFamixFortran77Subroutine [ | entity | @@ -867,7 +865,7 @@ IASTToFamixVisitorTest >> testFamixFortran77Subroutine [ self assert: entity parameters size equals: 0 ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testImplicitWithRange [ | entity sub | @@ -897,7 +895,7 @@ IASTToFamixVisitorTest >> testImplicitWithRange [ self assert: entity second equals: $f ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } IASTToFamixVisitorTest >> testIncludeFamixFortran77Subroutine [ " @@ -931,7 +929,7 @@ c@_#include ""point.seg"" self assert: include source equals: programFile." ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testMultipleImplicit [ | entity sub | @@ -965,7 +963,7 @@ IASTToFamixVisitorTest >> testMultipleImplicit [ self assert: entity second equals: $f ] -{ #category : 'tests-fortran' } +{ #category : #'tests-fortran' } IASTToFamixVisitorTest >> testSimpleImplicit [ | entity sub | diff --git a/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st b/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st index 074b51a..869179a 100644 --- a/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st +++ b/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st @@ -1,12 +1,10 @@ Class { - #name : 'JsonToIASTVisitorTest', - #superclass : 'TestCase', - #category : 'EsopeImporter-Tests-Visitor', - #package : 'EsopeImporter-Tests', - #tag : 'Visitor' + #name : #JsonToIASTVisitorTest, + #superclass : #TestCase, + #category : #'EsopeImporter-Tests-Visitor' } -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testAccessArrayWithIndices [ "subroutine hello integer arr(10) @@ -34,7 +32,7 @@ JsonToIASTVisitorTest >> testAccessArrayWithIndices [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testAccessArrayWithIndicesLiteral [ "subroutine hello integer arr(10) @@ -58,7 +56,7 @@ JsonToIASTVisitorTest >> testAccessArrayWithIndicesLiteral [ self assert: var indices first isNil. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testAccessArrayWithSeveralIndices [ "subroutine hello integer arr(10, 10, 10) @@ -89,7 +87,7 @@ JsonToIASTVisitorTest >> testAccessArrayWithSeveralIndices [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testAssignementStatement [ "subroutine hello someVar = otherVar @@ -113,7 +111,7 @@ JsonToIASTVisitorTest >> testAssignementStatement [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testAssignementStatementWithComplexRHS [ "subroutine hello someVar = otherVar + thirdVar @@ -139,7 +137,7 @@ JsonToIASTVisitorTest >> testAssignementStatementWithComplexRHS [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testAssignementStatementWithEsoAt [ "subroutine hello someVar = D__(var,1) @@ -160,7 +158,7 @@ JsonToIASTVisitorTest >> testAssignementStatementWithEsoAt [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testBackspaceStatement [ " program toto @@ -191,7 +189,7 @@ JsonToIASTVisitorTest >> testBackspaceStatement [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testBlockDataWithOneCommon [ "blockdata hello common /mycom/ i @@ -214,7 +212,7 @@ JsonToIASTVisitorTest >> testBlockDataWithOneCommon [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testBlockDataWithOneCommonOneData [ "block data hello common /mycom/ i @@ -238,7 +236,7 @@ JsonToIASTVisitorTest >> testBlockDataWithOneCommonOneData [ self assert: blockdata comments isEmpty. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testCallToWrite [ "subroutine mysub (msg) write(*,*) msg @@ -264,7 +262,7 @@ JsonToIASTVisitorTest >> testCallToWrite [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testComment [ "c blah" | programFile stmt | @@ -285,7 +283,7 @@ JsonToIASTVisitorTest >> testComment [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testCommentInside [ "integer function hello() c blah @@ -303,7 +301,7 @@ c blah ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testCommentOutside [ "c blah integer function hello() @@ -321,7 +319,7 @@ JsonToIASTVisitorTest >> testCommentOutside [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testContinueStatement [ " PROGRAM MYPROG continue @@ -335,7 +333,7 @@ JsonToIASTVisitorTest >> testContinueStatement [ self assert: programFile body first body isEmpty ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testDeref [ "subroutine hello ptr.att = 5 @@ -363,7 +361,7 @@ JsonToIASTVisitorTest >> testDeref [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testESOAtWithArrayArgument [ "Special case of a D__ function call with an array as argument @@ -399,7 +397,7 @@ JsonToIASTVisitorTest >> testESOAtWithArrayArgument [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptyBlockData [ "BLOCK data hello end @@ -417,7 +415,7 @@ JsonToIASTVisitorTest >> testEmptyBlockData [ self assert: block comments isEmpty. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testEmptyExitStatement [ " PROGRAM MYPROG exit @@ -431,7 +429,7 @@ JsonToIASTVisitorTest >> testEmptyExitStatement [ self assert: programFile body first body isEmpty ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptyFunction [ "integer function hello() end @@ -460,7 +458,7 @@ JsonToIASTVisitorTest >> testEmptyFunction [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptyFunctionWithArguments [ "integer function hello(i,j) end @@ -483,7 +481,7 @@ JsonToIASTVisitorTest >> testEmptyFunctionWithArguments [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptyProgram [ "program hello end @@ -510,7 +508,7 @@ JsonToIASTVisitorTest >> testEmptyProgram [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testEmptyReturnStatement [ " subroutine hello return @@ -525,7 +523,7 @@ JsonToIASTVisitorTest >> testEmptyReturnStatement [ self assert: fct body isEmpty ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptySubroutine [ "subroutine hello end @@ -551,7 +549,7 @@ JsonToIASTVisitorTest >> testEmptySubroutine [ self assert: sub sourceAnchor endColumn equals: 10. ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptySubroutineOneParam [ "subroutine hello( name ) end @@ -568,7 +566,7 @@ JsonToIASTVisitorTest >> testEmptySubroutineOneParam [ self assert: sub body isEmpty. ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testEmptySubroutineTwoParams [ "subroutine hello( param1, param2 ) end @@ -587,7 +585,7 @@ JsonToIASTVisitorTest >> testEmptySubroutineTwoParams [ self assert: sub body isEmpty. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoArTwoArgs [ "subroutine hello() d__(baz,bar) = 5 @@ -605,7 +603,7 @@ JsonToIASTVisitorTest >> testEsoArTwoArgs [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoArWithDotArg [ " subroutine hello( ) @@ -648,7 +646,7 @@ JsonToIASTVisitorTest >> testEsoArWithDotArg [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoArWithEsoAtArg [ " subroutine hello( ) d__(baz,bar(2)) = 5 @@ -678,7 +676,7 @@ JsonToIASTVisitorTest >> testEsoArWithEsoAtArg [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoArWithVarArg [ " subroutine hello( ) @@ -711,7 +709,7 @@ JsonToIASTVisitorTest >> testEsoArWithVarArg [ self assert: arg arguments first entityName equals: 'i' ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoAtOneArg [ " subroutine hello( ) d__(baz,2) = 5.3 @@ -731,7 +729,7 @@ JsonToIASTVisitorTest >> testEsoAtOneArg [ self deny: stmt entities first isWrite ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoAtTwoArgs [ " subroutine hello( ) d__(baz,bar) = 5 @@ -753,7 +751,7 @@ JsonToIASTVisitorTest >> testEsoAtTwoArgs [ ] ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoAtTwoArgsReceivesVar [ " subroutine hello( ) d__(baz,bar) = otherVar @@ -774,7 +772,7 @@ JsonToIASTVisitorTest >> testEsoAtTwoArgsReceivesVar [ self deny: var isWrite. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoSl [ " subroutine hello( ) n = s__(a,i) @@ -796,7 +794,7 @@ JsonToIASTVisitorTest >> testEsoSl [ self assert: stmt entities second entityName equals: 'i' ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoSlWithDot [ " subroutine hello( ) n = s__(d__(p,a),i) @@ -822,7 +820,7 @@ JsonToIASTVisitorTest >> testEsoSlWithDot [ self assert: stmt entities second entityName equals: 'i' ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsoSlWithTwoDot [ " subroutine hello( ) n = s__(d__(p,a),d__(p,i)) @@ -851,7 +849,7 @@ JsonToIASTVisitorTest >> testEsoSlWithTwoDot [ self assert: stmt entities second entities second entityName equals: 'i'. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testEsopeIfCommentStatement [ " subroutine sub() c@_ IF (N.GT.0) SEGINI P @@ -880,7 +878,7 @@ c@_ IF (N.GT.0) SEGINI P self assert: seg sourceAnchor endColumn equals: 29 ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testFunctionWithFunctionInvocation [ " integer function efunc() i = ifunc (i, j) @@ -901,7 +899,7 @@ JsonToIASTVisitorTest >> testFunctionWithFunctionInvocation [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testGotoStatement [ " PROGRAM MYPROG goto 100 @@ -915,7 +913,7 @@ JsonToIASTVisitorTest >> testGotoStatement [ self assert: programFile body first body isEmpty ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testIfStatement [ " integer function hello() if(a) a=1 @@ -933,7 +931,7 @@ JsonToIASTVisitorTest >> testIfStatement [ self assert: fct body first second first entityName equals: 'a'. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testImplicitNoneStatement [ "PROGRAM MYPROG implicit none @@ -951,7 +949,7 @@ JsonToIASTVisitorTest >> testImplicitNoneStatement [ self assert: stmt rules isNil. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testImplicitStatementSeveralRanges [ "PROGRAM MYPROG implicit character (c-e, h, l-m) @@ -988,7 +986,7 @@ JsonToIASTVisitorTest >> testImplicitStatementSeveralRanges [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testImplicitStatementSimpleChar [ "PROGRAM MYPROG implicit character (c) @@ -1017,7 +1015,7 @@ JsonToIASTVisitorTest >> testImplicitStatementSimpleChar [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testImplicitStatementSimpleRange [ "PROGRAM MYPROG implicit character (c-e) @@ -1042,7 +1040,7 @@ JsonToIASTVisitorTest >> testImplicitStatementSimpleRange [ ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testIncludeFile [ " subroutine hello( ) @@ -1062,7 +1060,7 @@ c@_#include ""file.inc"" self assert: stmt entityName equals: 'file.inc' ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testIntegerVariableDeclaration [ "subroutine hello integer i @@ -1083,7 +1081,7 @@ JsonToIASTVisitorTest >> testIntegerVariableDeclaration [ self assert: var sourceAnchor class equals: IASTIndexedFileAnchor ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testIntrinsicStatement [ " subroutine hello intrinsic SIN, COS @@ -1098,7 +1096,7 @@ JsonToIASTVisitorTest >> testIntrinsicStatement [ "note: currently not declaring the intrinsic sub-prgrams" ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testMultipleStatements [ "subroutine hello integer someVar @@ -1128,7 +1126,7 @@ JsonToIASTVisitorTest >> testMultipleStatements [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testParameterStatement [ " subroutine paramstmt PARAMETER (LEGERE=1, GRAVE=2, FATALE=3, FINALE=4) @@ -1157,7 +1155,7 @@ JsonToIASTVisitorTest >> testParameterStatement [ self assert: access sourceAnchor endColumn equals: 33 ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testPointeurDeclaration [ " subroutine hello c@_ pointeur p1.pstr @@ -1179,7 +1177,7 @@ c@_ pointeur p1.pstr self assert: seg sourceAnchor endColumn equals: 23 ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testProgramWithEmptyDoStatement [ "program hello do i=1, n @@ -1199,7 +1197,7 @@ JsonToIASTVisitorTest >> testProgramWithEmptyDoStatement [ ] -{ #category : 'tests-progUnit' } +{ #category : #'tests-progUnit' } JsonToIASTVisitorTest >> testProgramWithMultipleProgUnits [ "program myprog end @@ -1234,7 +1232,7 @@ JsonToIASTVisitorTest >> testProgramWithMultipleProgUnits [ self assert: node parameters first entityName equals: 'msg'. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testProgramWithOneStatement [ "program hello a = -b @@ -1255,7 +1253,7 @@ JsonToIASTVisitorTest >> testProgramWithOneStatement [ self assert: prog body first size equals: 2. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testProgramWithSimpleIfElseStatementWitBody [ "program hello if (i < j) then @@ -1281,7 +1279,7 @@ JsonToIASTVisitorTest >> testProgramWithSimpleIfElseStatementWitBody [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testProgramWithSimpleIfStatementWitBody [ "program hello if (i < j) then @@ -1303,7 +1301,7 @@ JsonToIASTVisitorTest >> testProgramWithSimpleIfStatementWitBody [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testProgramWithSimpleIfStatementWithoutBody [ "program hello if (i < j) then @@ -1323,7 +1321,7 @@ JsonToIASTVisitorTest >> testProgramWithSimpleIfStatementWithoutBody [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testReturnConstantStatement [ " integer function hello() return 42 @@ -1338,7 +1336,7 @@ JsonToIASTVisitorTest >> testReturnConstantStatement [ self assert: fct body isEmpty ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testReturnStatement [ " integer function hello() return someVar @@ -1354,7 +1352,7 @@ JsonToIASTVisitorTest >> testReturnStatement [ self assert: fct body first entityName equals: 'somevar'. ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegactCommand [ "subroutine hello c@_ segact, lb @@ -1377,7 +1375,7 @@ c@_ segact, lb self assert: seg sourceAnchor endColumn equals: 17 ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegadjCommand [ "subroutine hello c@_ segadj,lb @@ -1400,7 +1398,7 @@ c@_ segadj,lb self assert: seg sourceAnchor endColumn equals: 16 ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testSeginiCommand [ "subroutine hello c@_ segini,lb @@ -1423,7 +1421,7 @@ c@_ segini,lb self assert: seg sourceAnchor endColumn equals: 16 ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegmentDeclarationEmpty [ "subroutine hello c@_ segment,user @@ -1449,7 +1447,82 @@ c@_ end segment self assert: seg sourceAnchor endColumn equals: 18 ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } +JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayAttribute [ + + | programFile seg | + programFile := self visitF77Code: ' subroutine hello +c@_ segment, foo + integer bar(n) +c@_ end segment + end +'. + + self assert: programFile body first body size equals: 1. + seg := programFile body first body first. + + self assert: seg class equals: IASTEsopeSegment. + self assert: seg entityName equals: 'foo'. + self assert: seg declarations size equals: 1. + + self assert: seg declarations first entityName equals: 'bar'. + self assert: seg declarations first typeSpec entityName equals: 'integer'. + + self assert: seg declarations first dimensions size equals: 1. + self assert: seg declarations first dimensions first entityName equals: 'n'. + +] + +{ #category : #'tests-esope' } +JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayAttributes [ + + | programFile seg | + programFile := self visitF77Code: ' subroutine hello +c@_ segment, foo + integer bar(n, m) +c@_ end segment + end +'. + + self assert: programFile body first body size equals: 1. + seg := programFile body first body first. + + self assert: seg class equals: IASTEsopeSegment. + self assert: seg entityName equals: 'foo'. + self assert: seg declarations size equals: 1. + + self assert: seg declarations first entityName equals: 'bar'. + self assert: seg declarations first typeSpec entityName equals: 'integer'. + + self assert: seg declarations first dimensions size equals: 2. + self assert: seg declarations first dimensions first entityName equals: 'n'. + self assert: seg declarations first dimensions second entityName equals: 'm'. + +] + +{ #category : #'tests-esope' } +JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayPointeurAttribute [ + + | programFile seg | + programFile := self visitF77Code: ' subroutine hello +c@_ segment, foo +c@_ pointeur bar(n, m).titi +c@_ end segment + end +'. + + self assert: programFile body first body size equals: 1. + seg := programFile body first body first. + + self assert: seg class equals: IASTEsopeSegment. + self assert: seg entityName equals: 'foo'. + self assert: seg declarations size equals: 1. + + self assert: seg declarations first entityName equals: 'bar(n, m).titi'. + +] + +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegmentDeclarationWithContent [ "subroutine hello c@_ segment, user @@ -1475,7 +1548,7 @@ c@_ end segment ] -{ #category : 'tests-esope' } +{ #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegsupCommand [ "subroutine hello c@_ segsup, lb @@ -1498,7 +1571,7 @@ c@_ segsup, lb self assert: seg sourceAnchor endColumn equals: 17 ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testSpecialSubroutine [ " subroutine _$aFile_inc @@ -1545,7 +1618,7 @@ c@_ end segment self assert: entity typeSpec entityName equals: 'character' ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testStringVariableDeclaration [ "subroutine hello character*8 str @@ -1565,7 +1638,7 @@ JsonToIASTVisitorTest >> testStringVariableDeclaration [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testSubroutineInvocation [ "subroutine hello call someSubRoutine @@ -1584,7 +1657,7 @@ JsonToIASTVisitorTest >> testSubroutineInvocation [ ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testSubroutineInvocationWithArguments [ "subroutine hello call someSubRoutine(bar,5,baz) @@ -1610,7 +1683,7 @@ JsonToIASTVisitorTest >> testSubroutineInvocationWithArguments [ self assert: arg entityName equals: 'baz'. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testTwoIntegerVariableDeclarations [ "subroutine hello integer i,j @@ -1635,7 +1708,7 @@ JsonToIASTVisitorTest >> testTwoIntegerVariableDeclarations [ self assert: var typeSpec entityName equals: 'integer'. ] -{ #category : 'tests-statement' } +{ #category : #'tests-statement' } JsonToIASTVisitorTest >> testWriteStatementWithStringArgument [ " subroutine print @@ -1653,7 +1726,17 @@ JsonToIASTVisitorTest >> testWriteStatementWithStringArgument [ self assert: stmt arguments size equals: 0. ] -{ #category : 'running' } +{ #category : #running } +JsonToIASTVisitorTest >> visitF77Code: f77Code [ + | visitor | + visitor := JsonToIASTVisitor new. + ^visitor visitProgramFile: + (NeoJSONReader + fromString: (FortranProjectImporter parseString: f77Code) + ) +] + +{ #category : #running } JsonToIASTVisitorTest >> visitJsonCode: jsonCode [ | visitor | visitor := JsonToIASTVisitor new. diff --git a/src/EsopeImporter-Tests/ManifestEsopeImporterTests.class.st b/src/EsopeImporter-Tests/ManifestEsopeImporterTests.class.st index 33d983a..e46dc14 100644 --- a/src/EsopeImporter-Tests/ManifestEsopeImporterTests.class.st +++ b/src/EsopeImporter-Tests/ManifestEsopeImporterTests.class.st @@ -2,14 +2,12 @@ Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser " Class { - #name : 'ManifestEsopeImporterTests', - #superclass : 'PackageManifest', - #category : 'EsopeImporter-Tests-Manifest', - #package : 'EsopeImporter-Tests', - #tag : 'Manifest' + #name : #ManifestEsopeImporterTests, + #superclass : #PackageManifest, + #category : 'EsopeImporter-Tests-Manifest' } -{ #category : 'code-critics' } +{ #category : #'code-critics' } ManifestEsopeImporterTests class >> ruleShouldntRaiseErrorRuleV1FalsePositive [ diff --git a/src/EsopeImporter-Tests/package.st b/src/EsopeImporter-Tests/package.st index 5597e6c..3857b64 100644 --- a/src/EsopeImporter-Tests/package.st +++ b/src/EsopeImporter-Tests/package.st @@ -1 +1 @@ -Package { #name : 'EsopeImporter-Tests' } +Package { #name : #'EsopeImporter-Tests' } diff --git a/src/EsopeImporter/IASTToFamixEsopeVisitor.class.st b/src/EsopeImporter/IASTToFamixEsopeVisitor.class.st index 8815e42..3a05f85 100644 --- a/src/EsopeImporter/IASTToFamixEsopeVisitor.class.st +++ b/src/EsopeImporter/IASTToFamixEsopeVisitor.class.st @@ -1,7 +1,7 @@ Class { #name : #IASTToFamixEsopeVisitor, #superclass : #IASTAbstractFamixVisitor, - #category : 'EsopeImporter-Visitor' + #category : #'EsopeImporter-Visitor' } { #category : #'private-creation' } @@ -15,16 +15,18 @@ IASTToFamixEsopeVisitor >> newType: typeName sourceAnchor: sourceAnchor [ { #category : #visiting } IASTToFamixEsopeVisitor >> visitIASTEsopePointer: aPointerVar [ - | varsNames | + | varsNames pointer | varsNames := aPointerVar entityName substrings: '.'. - varsNames size < 2 ifTrue: [ ^ self ]. - - ^ (self model newVariableNamed: varsNames first) - sourceAnchor: - (self visitIndexedFileAnchor: aPointerVar sourceAnchor); - isEsope: true; - segment: varsNames second; - yourself + + pointer := (self model newVariableNamed: varsNames first) + sourceAnchor: (self visitIndexedFileAnchor: aPointerVar sourceAnchor); + isEsope: true; + yourself. + + varsNames size > 1 + ifTrue: [ pointer segment: varsNames second ]. + + ^ pointer ] { #category : #visiting } diff --git a/src/EsopeImporter/JsonToIASTVisitor.class.st b/src/EsopeImporter/JsonToIASTVisitor.class.st index d2ab3cb..8284a62 100644 --- a/src/EsopeImporter/JsonToIASTVisitor.class.st +++ b/src/EsopeImporter/JsonToIASTVisitor.class.st @@ -254,17 +254,23 @@ JsonToIASTVisitor >> visitDeclarationStatement: aDeclarationStatementNode [ { #category : #'visiting statement' } JsonToIASTVisitor >> visitDeclarator: aDeclaratorNode [ - ^self visitDeclaratorVariable: (aDeclaratorNode at: 'variable') + ^self visitDeclaratorVariable: aDeclaratorNode ] { #category : #'visiting statement' } JsonToIASTVisitor >> visitDeclaratorVariable: aDeclaratorVariableNode [ - | data | - data := super visitDeclaratorVariable: aDeclaratorVariableNode. + | data dimensions | + data := super visitDeclaratorVariable: (aDeclaratorVariableNode at: 'variable'). + dimensions := (aDeclaratorVariableNode at: 'dims' ifAbsent: []) + ifNotNil: [ :dims | self visitDims: dims ]. ^IASTVariable new sourceAnchor: (self makeIndexedAnchor: data first) ; entityName: data second ; + dimensions: (dimensions + ifNotNil: [ dimensions collect: [:dim | dim third] ] + ifNil: [ #() ] + ); yourself @@ -334,12 +340,17 @@ JsonToIASTVisitor >> visitEsopeIncludeComment: anEsopeIncludeCommentNode [ { #category : #'visiting esope' } JsonToIASTVisitor >> visitEsopePointeurComment: anEsopeCommentNode [ - | data | + | data pointer | data := super visitEsopePointeurComment: anEsopeCommentNode. - ^IASTEsopePointer new + + pointer := IASTEsopePointer new sourceAnchor: (self makeIndexedAnchor: data second) ; entityName: data fourth ; yourself. + + ^entityStack + ifNotEmpty: [ entityStack top addAllDeclarations: { pointer } . nil ] + ifEmpty: [ pointer ] ] From 9cba3968532c03b7f659c20fbc8a4e6a1eba34f9 Mon Sep 17 00:00:00 2001 From: uNouss Date: Wed, 31 Jul 2024 14:30:19 +0200 Subject: [PATCH 5/5] Fix error occuring by testing from fortran source instead of json ast --- .../IASTToFamixVisitorTest.class.st | 53 ++++++++++++++++++- .../JsonToIASTVisitorTest.class.st | 24 +++++---- 2 files changed, 67 insertions(+), 10 deletions(-) diff --git a/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st b/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st index 5f2ba44..87fbd44 100644 --- a/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st +++ b/src/EsopeImporter-Tests/IASTToFamixVisitorTest.class.st @@ -8,7 +8,7 @@ Class { 'visitor', 'programFile' ], - #category : 'EsopeImporter-Tests-Visitor' + #category : #'EsopeImporter-Tests-Visitor' } { #category : #running } @@ -522,6 +522,57 @@ IASTToFamixVisitorTest >> testFamixEsopeSegment [ self assert: attribute declaredType name equals: 'integer'. ] +{ #category : #'tests-esope' } +IASTToFamixVisitorTest >> testFamixEsopeSegmentWithPointeur [ + + " + segment myseg + integer a1(n) +c@_ pointeur a2(n).aseg + end segment + " + + | segment entity attribute | + + self skip: #TODO. "not yet implement". + + segment := self defaultSegment: 'myseg' with: { + (#a1 -> #integer). + (#status -> #logical). + (#age -> #integer) }. + + programFile body: { IASTSubroutine new + entityName: 'sub'; + body: { segment }; + yourself }. + + entity := programFile accept: visitor. + + self assert: entity programUnits size equals: 1. + + self assert: (visitor model allWithType: FamixEsopeSegment) size equals: 1. + entity := (visitor model allWithType: FamixEsopeSegment) first. + self assert: entity name equals: 'myseg'. + self assert: entity isType. + self assert: entity attributes size equals: 3. + + self assert: entity attributes size equals: 3. + attribute := entity attributes first. + self assert: attribute class equals: FamixFortranAttribute. + self assert: attribute name equals: 'uname'. + self assert: attribute declaredType name equals: 'character'. + + attribute := entity attributes second. + self assert: attribute class equals: FamixFortranAttribute. + self assert: attribute name equals: 'status'. + self assert: attribute declaredType name equals: 'logical'. + + attribute := entity attributes third. + self assert: attribute class equals: FamixFortranAttribute. + self assert: attribute name equals: 'age'. + self assert: attribute declaredType name equals: 'integer'. +] + { #category : #'tests-esope' } IASTToFamixVisitorTest >> testFamixEsopeSlashWithLitteralDim [ diff --git a/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st b/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st index 869179a..2636c85 100644 --- a/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st +++ b/src/EsopeImporter-Tests/JsonToIASTVisitorTest.class.st @@ -1450,13 +1450,16 @@ c@_ end segment { #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayAttribute [ - | programFile seg | - programFile := self visitF77Code: ' subroutine hello + " + subroutine hello c@_ segment, foo integer bar(n) c@_ end segment end -'. + " + + | programFile seg | + programFile := self visitJsonCode: '{"meta":{"miVersion":"fortran77","miFilename":""},"program_units":[{"anno":[],"arguments":null,"blocks":[{"anno":[],"comment":"@_ segment, foo","span":"(2:1)-(2:18)","tag":"comment"},{"anno":[],"label":null,"span":"(3:9)-(3:22)","statement":{"anno":[],"attributes":null,"declarators":{"anno":[],"list":[{"anno":[],"dims":{"anno":[],"list":[{"anno":[],"lower":null,"span":"(3:21)-(3:21)","upper":{"anno":[],"span":"(3:21)-(3:21)","tag":"value","value":{"contents":"n","tag":"variable"}}}],"span":"(3:21)-(3:21)"},"initial":null,"length":null,"span":"(3:17)-(3:22)","type":"array","variable":{"anno":[],"span":"(3:17)-(3:19)","tag":"value","value":{"contents":"bar","tag":"variable"}}}],"span":"(3:17)-(3:22)"},"span":"(3:9)-(3:22)","tag":"declaration","type":{"anno":[],"base_type":"integer","selector":null,"span":"(3:9)-(3:15)"}},"tag":"statement"},{"anno":[],"comment":"@_ end segment","span":"(4:1)-(4:17)","tag":"comment"}],"name":"hello","options":[null,null],"span":"(1:7)-(5:9)","subprograms":null,"tag":"subroutine"}]}'. self assert: programFile body first body size equals: 1. seg := programFile body first body first. @@ -1476,13 +1479,14 @@ c@_ end segment { #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayAttributes [ - | programFile seg | - programFile := self visitF77Code: ' subroutine hello +" subroutine hello c@_ segment, foo integer bar(n, m) c@_ end segment end -'. +" + | programFile seg | + programFile := self visitJsonCode: '{"meta":{"miVersion":"fortran77","miFilename":""},"program_units":[{"anno":[],"arguments":null,"blocks":[{"anno":[],"comment":"@_ segment, foo","span":"(2:1)-(2:18)","tag":"comment"},{"anno":[],"label":null,"span":"(3:9)-(3:25)","statement":{"anno":[],"attributes":null,"declarators":{"anno":[],"list":[{"anno":[],"dims":{"anno":[],"list":[{"anno":[],"lower":null,"span":"(3:21)-(3:21)","upper":{"anno":[],"span":"(3:21)-(3:21)","tag":"value","value":{"contents":"n","tag":"variable"}}},{"anno":[],"lower":null,"span":"(3:24)-(3:24)","upper":{"anno":[],"span":"(3:24)-(3:24)","tag":"value","value":{"contents":"m","tag":"variable"}}}],"span":"(3:21)-(3:24)"},"initial":null,"length":null,"span":"(3:17)-(3:25)","type":"array","variable":{"anno":[],"span":"(3:17)-(3:19)","tag":"value","value":{"contents":"bar","tag":"variable"}}}],"span":"(3:17)-(3:25)"},"span":"(3:9)-(3:25)","tag":"declaration","type":{"anno":[],"base_type":"integer","selector":null,"span":"(3:9)-(3:15)"}},"tag":"statement"},{"anno":[],"comment":"@_ end segment","span":"(4:1)-(4:17)","tag":"comment"}],"name":"hello","options":[null,null],"span":"(1:7)-(5:9)","subprograms":null,"tag":"subroutine"}]}'. self assert: programFile body first body size equals: 1. seg := programFile body first body first. @@ -1503,13 +1507,15 @@ c@_ end segment { #category : #'tests-esope' } JsonToIASTVisitorTest >> testSegmentDeclarationWithArrayPointeurAttribute [ - | programFile seg | - programFile := self visitF77Code: ' subroutine hello +" + subroutine hello c@_ segment, foo c@_ pointeur bar(n, m).titi c@_ end segment end -'. +" + | programFile seg | + programFile := self visitJsonCode: '{"meta":{"miVersion":"fortran77","miFilename":""},"program_units":[{"anno":[],"arguments":null,"blocks":[{"anno":[],"comment":"@_ segment, foo","span":"(2:1)-(2:18)","tag":"comment"},{"anno":[],"comment":"@_ pointeur bar(n, m).titi","span":"(3:1)-(3:31)","tag":"comment"},{"anno":[],"comment":"@_ end segment","span":"(4:1)-(4:17)","tag":"comment"}],"name":"hello","options":[null,null],"span":"(1:7)-(5:9)","subprograms":null,"tag":"subroutine"}]}'. self assert: programFile body first body size equals: 1. seg := programFile body first body first.