From 7577f6fb5da9db2501841f089151bd15084f8ec0 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 25 Jun 2026 19:33:25 +0200 Subject: [PATCH 001/151] Init local resolver --- .../FASTPythonLocalResolverTest.class.st | 37 +++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 62 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st new file mode 100644 index 0000000..17a726f --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -0,0 +1,37 @@ +Class { + #name : 'FASTPythonLocalResolverTest', + #superclass : 'FASTPythonAbstractTestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Tools-Tests-Utilities', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Utilities' +} + +{ #category : 'resolving' } +FASTPythonLocalResolverTest >> parseAndResolve: aString [ + + model := self parse: aString. + + FASTPythonLocalResolverVisitor resolve: model module +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 1. + + usedVariable := model module statements second. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses anyOne +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st new file mode 100644 index 0000000..6735ba9 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -0,0 +1,62 @@ +" +I am a visitor used to link variables usages to their declaration. + +You can run me like this: + +```st +FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" +``` + +Once I ran, all variables will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. + +In this version, this works only for variables declared in the entity to resolve. It will not work for example if you import a global variable from another module because it is not possible to know if this is a variable or something else. +" +Class { + #name : 'FASTPythonLocalResolverVisitor', + #superclass : 'FASTPythonVisitor', + #instVars : [ + 'scoper' + ], + #category : 'FAST-Python-Tools-Utilities', + #package : 'FAST-Python-Tools', + #tag : 'Utilities' +} + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ + + scoper := FASTLocalResolverScoping new. + aFASTBehaviouralEntity accept: self +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyAssignment: anAssignment [ + + anAssignment left isVariableEntity ifTrue: [ + scoper scopeAdd: anAssignment left name declaration: anAssignment. + + anAssignment left localDeclaration: anAssignment ]. + + super visitFASTPyAssignment: anAssignment +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ + + scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ + + "If I am on the left side of an assignation, no need to do anything, it's already done in my parent." + aVariable parentAssignmentLeft ifNotNil: [ ^ self ]. + + super visitFASTPyVariable: aVariable +] From c9e92018a7d26929e4c407907d192519559658a2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 25 Jun 2026 20:09:12 +0200 Subject: [PATCH 002/151] Manage multiple assignments to the same variable --- .../FASTPythonLocalResolverTest.class.st | 25 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 15 ++++++----- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 17a726f..44fa983 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -35,3 +35,28 @@ x'. self assert: usedVariable localDeclaration equals: assignment. self assert: usedVariable equals: assignedVariable localDeclaration localUses anyOne ] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneVariable [ + + | assignment1 assignment2 assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x = 2 +x'. + + assignment1 := model module statements first. + assignedVariable := assignment1 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + assignment2 := model module statements second. + assignedVariable := assignment2 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable equals: assignedVariable localDeclaration localUses first. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignment1. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 6735ba9..d618606 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -39,9 +39,12 @@ FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ FASTPythonLocalResolverVisitor >> visitFASTPyAssignment: anAssignment [ anAssignment left isVariableEntity ifTrue: [ - scoper scopeAdd: anAssignment left name declaration: anAssignment. + [ + scoper scopeAdd: anAssignment left name declaration: anAssignment. - anAssignment left localDeclaration: anAssignment ]. + anAssignment left localDeclaration: anAssignment ] + on: DuplicatedVariableError + do: [ "Do nothing on the second declaration." ] ]. super visitFASTPyAssignment: anAssignment ] @@ -55,8 +58,8 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ - "If I am on the left side of an assignation, no need to do anything, it's already done in my parent." - aVariable parentAssignmentLeft ifNotNil: [ ^ self ]. - - super visitFASTPyVariable: aVariable + "If I am the left side of my variable declaration, I do not create a local use." + aVariable localDeclarationIfPresent: [ :assignment | assignment left == aVariable ifTrue: [ ^ self ] ]. + + super visitFASTPyVariable: aVariable ] From 44ab6478890041f28a5a1e89e149fe5909a0dd1b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 10:37:13 +0200 Subject: [PATCH 003/151] Rename test --- .../FASTPythonLocalResolverTest.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 44fa983..5914233 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -37,7 +37,7 @@ x'. ] { #category : 'tests' } -FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneVariable [ +FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ | assignment1 assignment2 assignedVariable usedVariable | self parseAndResolve: 'x = 1 From ad72c3fd611fcf41301d233e398fb2bb9030d183 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 18:17:33 +0200 Subject: [PATCH 004/151] Set tree sitter version to the last release --- .../BaselineOfFASTPython.class.st | 2 +- .../FASTPythonLocalResolverTest.class.st | 62 ------------------ .../FASTPythonLocalResolverVisitor.class.st | 65 ------------------- 3 files changed, 1 insertion(+), 128 deletions(-) delete mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st diff --git a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st index 8cae698..332dec6 100644 --- a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st +++ b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st @@ -49,5 +49,5 @@ BaselineOfFASTPython >> projectClass [ { #category : 'dependencies' } BaselineOfFASTPython >> treeSitter: spec [ spec - baseline: 'TreeSitter' with: [ spec repository: 'github://Evref-BL/Pharo-Tree-Sitter:main/src' ] + baseline: 'TreeSitter' with: [ spec repository: 'github://Evref-BL/Pharo-Tree-Sitter:v.2.0.0/src' ] ] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st deleted file mode 100644 index 5914233..0000000 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ /dev/null @@ -1,62 +0,0 @@ -Class { - #name : 'FASTPythonLocalResolverTest', - #superclass : 'FASTPythonAbstractTestCase', - #instVars : [ - 'model' - ], - #category : 'FAST-Python-Tools-Tests-Utilities', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Utilities' -} - -{ #category : 'resolving' } -FASTPythonLocalResolverTest >> parseAndResolve: aString [ - - model := self parse: aString. - - FASTPythonLocalResolverVisitor resolve: model module -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ - - | assignment assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -x'. - - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 1. - - usedVariable := model module statements second. - self assert: usedVariable localDeclaration equals: assignment. - self assert: usedVariable equals: assignedVariable localDeclaration localUses anyOne -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ - - | assignment1 assignment2 assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -x = 2 -x'. - - assignment1 := model module statements first. - assignedVariable := assignment1 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - - assignment2 := model module statements second. - assignedVariable := assignment2 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable equals: assignedVariable localDeclaration localUses first. - - usedVariable := model module statements third. - self assert: usedVariable localDeclaration equals: assignment1. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st deleted file mode 100644 index d618606..0000000 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ /dev/null @@ -1,65 +0,0 @@ -" -I am a visitor used to link variables usages to their declaration. - -You can run me like this: - -```st -FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" -``` - -Once I ran, all variables will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. - -In this version, this works only for variables declared in the entity to resolve. It will not work for example if you import a global variable from another module because it is not possible to know if this is a variable or something else. -" -Class { - #name : 'FASTPythonLocalResolverVisitor', - #superclass : 'FASTPythonVisitor', - #instVars : [ - 'scoper' - ], - #category : 'FAST-Python-Tools-Utilities', - #package : 'FAST-Python-Tools', - #tag : 'Utilities' -} - -{ #category : 'instance creation' } -FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ - - ^ self new resolve: aPythonEntity -] - -{ #category : 'instance creation' } -FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ - - scoper := FASTLocalResolverScoping new. - aFASTBehaviouralEntity accept: self -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyAssignment: anAssignment [ - - anAssignment left isVariableEntity ifTrue: [ - [ - scoper scopeAdd: anAssignment left name declaration: anAssignment. - - anAssignment left localDeclaration: anAssignment ] - on: DuplicatedVariableError - do: [ "Do nothing on the second declaration." ] ]. - - super visitFASTPyAssignment: anAssignment -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - - scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ - - "If I am the left side of my variable declaration, I do not create a local use." - aVariable localDeclarationIfPresent: [ :assignment | assignment left == aVariable ifTrue: [ ^ self ] ]. - - super visitFASTPyVariable: aVariable -] From 41ddf78cbeaefac02e90e60751d2697e471b647d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 18:23:54 +0200 Subject: [PATCH 005/151] Merge branch 'main' into local-resolver --- .../FASTPythonLocalResolverTest.class.st | 62 ++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 65 +++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st new file mode 100644 index 0000000..5914233 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -0,0 +1,62 @@ +Class { + #name : 'FASTPythonLocalResolverTest', + #superclass : 'FASTPythonAbstractTestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Tools-Tests-Utilities', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Utilities' +} + +{ #category : 'resolving' } +FASTPythonLocalResolverTest >> parseAndResolve: aString [ + + model := self parse: aString. + + FASTPythonLocalResolverVisitor resolve: model module +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 1. + + usedVariable := model module statements second. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses anyOne +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ + + | assignment1 assignment2 assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x = 2 +x'. + + assignment1 := model module statements first. + assignedVariable := assignment1 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + assignment2 := model module statements second. + assignedVariable := assignment2 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable equals: assignedVariable localDeclaration localUses first. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignment1. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st new file mode 100644 index 0000000..d618606 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -0,0 +1,65 @@ +" +I am a visitor used to link variables usages to their declaration. + +You can run me like this: + +```st +FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" +``` + +Once I ran, all variables will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. + +In this version, this works only for variables declared in the entity to resolve. It will not work for example if you import a global variable from another module because it is not possible to know if this is a variable or something else. +" +Class { + #name : 'FASTPythonLocalResolverVisitor', + #superclass : 'FASTPythonVisitor', + #instVars : [ + 'scoper' + ], + #category : 'FAST-Python-Tools-Utilities', + #package : 'FAST-Python-Tools', + #tag : 'Utilities' +} + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ + + scoper := FASTLocalResolverScoping new. + aFASTBehaviouralEntity accept: self +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyAssignment: anAssignment [ + + anAssignment left isVariableEntity ifTrue: [ + [ + scoper scopeAdd: anAssignment left name declaration: anAssignment. + + anAssignment left localDeclaration: anAssignment ] + on: DuplicatedVariableError + do: [ "Do nothing on the second declaration." ] ]. + + super visitFASTPyAssignment: anAssignment +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ + + scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ + + "If I am the left side of my variable declaration, I do not create a local use." + aVariable localDeclarationIfPresent: [ :assignment | assignment left == aVariable ifTrue: [ ^ self ] ]. + + super visitFASTPyVariable: aVariable +] From 92f930bba72dd47431bcf54aac6767353ac1c659 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 18:57:56 +0200 Subject: [PATCH 006/151] Declaration should count in local uses + add skipped tests --- .../FASTPythonLocalResolverTest.class.st | 72 ++++++++++++++++++- .../FASTPythonLocalResolverVisitor.class.st | 33 +++++---- 2 files changed, 91 insertions(+), 14 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 5914233..a690a49 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -29,11 +29,12 @@ x'. self assert: assignedVariable localDeclaration equals: assignment. self assert: assignedVariable localDeclaration left name equals: 'x'. self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 1. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second. self assert: usedVariable localDeclaration equals: assignment. - self assert: usedVariable equals: assignedVariable localDeclaration localUses anyOne + self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests' } @@ -44,6 +45,53 @@ FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ x = 2 x'. + assignment1 := model module statements first. + assignedVariable := assignment1 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + assignment2 := model module statements second. + assignedVariable := assignment2 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignment1. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testUsageInCall [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ + + | assignment1 assignment2 assignedVariable usedVariable | + self skip. "Todo" + self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] +for x in fruits: + print(x)'. + assignment1 := model module statements first. assignedVariable := assignment1 left. self assert: assignedVariable localDeclaration equals: assignment1. @@ -60,3 +108,23 @@ x'. self assert: usedVariable localDeclaration equals: assignment1. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableOfFor [ + + | for declared usedVariable | + self skip. "Todo" + self parseAndResolve: 'for x in "banana": + print(x)'. + + for := model module statements first. + declared := for left. + self assert: declared localDeclaration equals: for. + self assert: declared localDeclaration left name equals: 'x'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 1. + + usedVariable := for statements first arguments first. + self assert: usedVariable localDeclaration equals: for. + self assert: usedVariable equals: declared localDeclaration localUses first +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index d618606..b56b86f 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -35,22 +35,26 @@ FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ aFASTBehaviouralEntity accept: self ] -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyAssignment: anAssignment [ - - anAssignment left isVariableEntity ifTrue: [ - [ - scoper scopeAdd: anAssignment left name declaration: anAssignment. +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ + "Reorginizing the order" - anAssignment left localDeclaration: anAssignment ] - on: DuplicatedVariableError - do: [ "Do nothing on the second declaration." ] ]. + self visitEntity: aForStatement left. + self visitEntity: aForStatement right. - super visitFASTPyAssignment: anAssignment + self visitFASTPyTWithElseClause: aForStatement. + self visitFASTTStatementBlock: aForStatement. + self visitFASTPyStatement: aForStatement ] { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ + "I define a variable in a for statement. Thus I need to create a new declaration" + + self halt. + anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | + scoper scopeAdd: anIdentifier sourceCode declaration: forStatement. + anIdentifier localDeclaration: forStatement ]. scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode ] @@ -58,8 +62,13 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ - "If I am the left side of my variable declaration, I do not create a local use." - aVariable localDeclarationIfPresent: [ :assignment | assignment left == aVariable ifTrue: [ ^ self ] ]. + "We are declaring a variable in an assignation" + aVariable parentAssignmentLeft ifNotNil: [ :assignment | + [ + scoper scopeAdd: aVariable name declaration: assignment. + aVariable localDeclaration: assignment ] + on: DuplicatedVariableError + do: [ "Do nothing on the second declaration." ] ]. super visitFASTPyVariable: aVariable ] From 9fdf72f60a98276d241a709312c3adbfd58e0503 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 19:01:01 +0200 Subject: [PATCH 007/151] Fix wrong parent name for entities in left and right side of a for statement --- .../FASTPythonMetamodelGenerator.class.st | 4 +- .../FASTPyExpression.class.st | 16 +-- .../FASTPyForStatement.class.st | 12 +- .../FASTPythonLocalResolverTest.class.st | 130 ------------------ .../FASTPythonLocalResolverVisitor.class.st | 74 ---------- 5 files changed, 16 insertions(+), 220 deletions(-) delete mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index f7c9d86..5a4ca7d 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -750,9 +750,9 @@ FASTPythonMetamodelGenerator >> defineRelations [ (forInClause property: #right) <>- (expression property: #parentForInClauseRight). ((forStatement property: #right) comment: 'The list that the for statement iterates over') - <>- ((expression property: #parentForStatementLeft) comment: 'The for statement owner (if possible)'). + <>- ((expression property: #parentForStatementRight) comment: 'The for statement right owner (if possible)'). ((forStatement property: #left) comment: 'The identifier of the created local variable or tuple') - <>- ((expression property: #parentForStatementRight) comment: 'The for statement owner (if possible)'). + <>- ((expression property: #parentForStatementLeft) comment: 'The for statement left owner (if possible)'). (functionDefinition property: #returnType) <>- (type property: #parentFunctionDefinition). diff --git a/src/FAST-Python-Model/FASTPyExpression.class.st b/src/FAST-Python-Model/FASTPyExpression.class.st index 5df9f83..0e9660c 100644 --- a/src/FAST-Python-Model/FASTPyExpression.class.st +++ b/src/FAST-Python-Model/FASTPyExpression.class.st @@ -28,8 +28,8 @@ | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentForInClauseLeft` | `FASTPyExpression` | `left` | `FASTPyForInClause` | | | `parentForInClauseRight` | `FASTPyExpression` | `right` | `FASTPyForInClause` | | -| `parentForStatementLeft` | `FASTPyExpression` | `right` | `FASTPyForStatement` | The for statement owner (if possible)| -| `parentForStatementRight` | `FASTPyExpression` | `left` | `FASTPyForStatement` | The for statement owner (if possible)| +| `parentForStatementLeft` | `FASTPyExpression` | `left` | `FASTPyForStatement` | The for statement left owner (if possible)| +| `parentForStatementRight` | `FASTPyExpression` | `right` | `FASTPyForStatement` | The for statement right owner (if possible)| | `parentIfClause` | `FASTPyExpression` | `expression` | `FASTPyIfClause` | | | `parentInterpolation` | `FASTPyExpression` | `expression` | `FASTPyInterpolation` | | | `parentKeywordArgument` | `FASTPyExpression` | `value` | `FASTPyKeywordArgument` | Keyword argument from which I am the value (if it's the case)| @@ -79,8 +79,8 @@ Class { '#parentExecStatementScopes => FMOne type: #FASTPyExecStatement opposite: #scopes', '#parentForInClauseLeft => FMOne type: #FASTPyForInClause opposite: #left', '#parentForInClauseRight => FMOne type: #FASTPyForInClause opposite: #right', - '#parentForStatementLeft => FMOne type: #FASTPyForStatement opposite: #right', - '#parentForStatementRight => FMOne type: #FASTPyForStatement opposite: #left', + '#parentForStatementLeft => FMOne type: #FASTPyForStatement opposite: #left', + '#parentForStatementRight => FMOne type: #FASTPyForStatement opposite: #right', '#parentIfClause => FMOne type: #FASTPyIfClause opposite: #expression', '#parentInterpolation => FMOne type: #FASTPyInterpolation opposite: #expression', '#parentKeywordArgument => FMOne type: #FASTPyKeywordArgument opposite: #value', @@ -396,10 +396,10 @@ FASTPyExpression >> parentForInClauseRight: anObject [ { #category : 'accessing' } FASTPyExpression >> parentForStatementLeft [ - "Relation named: #parentForStatementLeft type: #FASTPyForStatement opposite: #right" + "Relation named: #parentForStatementLeft type: #FASTPyForStatement opposite: #left" - + ^ parentForStatementLeft @@ -414,10 +414,10 @@ FASTPyExpression >> parentForStatementLeft: anObject [ { #category : 'accessing' } FASTPyExpression >> parentForStatementRight [ - "Relation named: #parentForStatementRight type: #FASTPyForStatement opposite: #left" + "Relation named: #parentForStatementRight type: #FASTPyForStatement opposite: #right" - + ^ parentForStatementRight diff --git a/src/FAST-Python-Model/FASTPyForStatement.class.st b/src/FAST-Python-Model/FASTPyForStatement.class.st index f6bf248..657ccd3 100644 --- a/src/FAST-Python-Model/FASTPyForStatement.class.st +++ b/src/FAST-Python-Model/FASTPyForStatement.class.st @@ -13,8 +13,8 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `elseClause` | `FASTPyTWithElseClause` | `parentIfStatement` | `FASTPyElseClause` | | -| `left` | `FASTPyForStatement` | `parentForStatementRight` | `FASTPyExpression` | The identifier of the created local variable or tuple| -| `right` | `FASTPyForStatement` | `parentForStatementLeft` | `FASTPyExpression` | The list that the for statement iterates over| +| `left` | `FASTPyForStatement` | `parentForStatementLeft` | `FASTPyExpression` | The identifier of the created local variable or tuple| +| `right` | `FASTPyForStatement` | `parentForStatementRight` | `FASTPyExpression` | The list that the for statement iterates over| | `statements` | `FASTTStatementBlock` | `statementContainer` | `FASTTStatement` | Statements enclosed in this block| @@ -33,8 +33,8 @@ Class { #traits : 'FASTPyTWithElseClause + FASTTStatementBlock', #classTraits : 'FASTPyTWithElseClause classTrait + FASTTStatementBlock classTrait', #instVars : [ - '#left => FMOne type: #FASTPyExpression opposite: #parentForStatementRight', - '#right => FMOne type: #FASTPyExpression opposite: #parentForStatementLeft' + '#left => FMOne type: #FASTPyExpression opposite: #parentForStatementLeft', + '#right => FMOne type: #FASTPyExpression opposite: #parentForStatementRight' ], #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', @@ -51,7 +51,7 @@ FASTPyForStatement class >> annotation [ { #category : 'accessing' } FASTPyForStatement >> left [ - "Relation named: #left type: #FASTPyExpression opposite: #parentForStatementRight" + "Relation named: #left type: #FASTPyExpression opposite: #parentForStatementLeft" @@ -67,7 +67,7 @@ FASTPyForStatement >> left: anObject [ { #category : 'accessing' } FASTPyForStatement >> right [ - "Relation named: #right type: #FASTPyExpression opposite: #parentForStatementLeft" + "Relation named: #right type: #FASTPyExpression opposite: #parentForStatementRight" diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st deleted file mode 100644 index a690a49..0000000 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ /dev/null @@ -1,130 +0,0 @@ -Class { - #name : 'FASTPythonLocalResolverTest', - #superclass : 'FASTPythonAbstractTestCase', - #instVars : [ - 'model' - ], - #category : 'FAST-Python-Tools-Tests-Utilities', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Utilities' -} - -{ #category : 'resolving' } -FASTPythonLocalResolverTest >> parseAndResolve: aString [ - - model := self parse: aString. - - FASTPythonLocalResolverVisitor resolve: model module -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ - - | assignment assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -x'. - - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second. - self assert: usedVariable localDeclaration equals: assignment. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ - - | assignment1 assignment2 assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -x = 2 -x'. - - assignment1 := model module statements first. - assignedVariable := assignment1 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - assignment2 := model module statements second. - assignedVariable := assignment2 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable equals: assignedVariable localDeclaration localUses second. - - usedVariable := model module statements third. - self assert: usedVariable localDeclaration equals: assignment1. - self assert: usedVariable equals: assignedVariable localDeclaration localUses third -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testUsageInCall [ - - | assignment assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -print(x)'. - - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignment. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ - - | assignment1 assignment2 assignedVariable usedVariable | - self skip. "Todo" - self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] -for x in fruits: - print(x)'. - - assignment1 := model module statements first. - assignedVariable := assignment1 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - - assignment2 := model module statements second. - assignedVariable := assignment2 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable equals: assignedVariable localDeclaration localUses first. - - usedVariable := model module statements third. - self assert: usedVariable localDeclaration equals: assignment1. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testVariableOfFor [ - - | for declared usedVariable | - self skip. "Todo" - self parseAndResolve: 'for x in "banana": - print(x)'. - - for := model module statements first. - declared := for left. - self assert: declared localDeclaration equals: for. - self assert: declared localDeclaration left name equals: 'x'. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 1. - - usedVariable := for statements first arguments first. - self assert: usedVariable localDeclaration equals: for. - self assert: usedVariable equals: declared localDeclaration localUses first -] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st deleted file mode 100644 index b56b86f..0000000 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -I am a visitor used to link variables usages to their declaration. - -You can run me like this: - -```st -FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" -``` - -Once I ran, all variables will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. - -In this version, this works only for variables declared in the entity to resolve. It will not work for example if you import a global variable from another module because it is not possible to know if this is a variable or something else. -" -Class { - #name : 'FASTPythonLocalResolverVisitor', - #superclass : 'FASTPythonVisitor', - #instVars : [ - 'scoper' - ], - #category : 'FAST-Python-Tools-Utilities', - #package : 'FAST-Python-Tools', - #tag : 'Utilities' -} - -{ #category : 'instance creation' } -FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ - - ^ self new resolve: aPythonEntity -] - -{ #category : 'instance creation' } -FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ - - scoper := FASTLocalResolverScoping new. - aFASTBehaviouralEntity accept: self -] - -{ #category : 'visiting - reordering' } -FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ - "Reorginizing the order" - - self visitEntity: aForStatement left. - self visitEntity: aForStatement right. - - self visitFASTPyTWithElseClause: aForStatement. - self visitFASTTStatementBlock: aForStatement. - self visitFASTPyStatement: aForStatement -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - "I define a variable in a for statement. Thus I need to create a new declaration" - - self halt. - anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | - scoper scopeAdd: anIdentifier sourceCode declaration: forStatement. - anIdentifier localDeclaration: forStatement ]. - - scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ - - "We are declaring a variable in an assignation" - aVariable parentAssignmentLeft ifNotNil: [ :assignment | - [ - scoper scopeAdd: aVariable name declaration: assignment. - aVariable localDeclaration: assignment ] - on: DuplicatedVariableError - do: [ "Do nothing on the second declaration." ] ]. - - super visitFASTPyVariable: aVariable -] From 79ff1e29e8e06c2b1b5ed24ca93d180174617cf9 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 19:01:20 +0200 Subject: [PATCH 008/151] Merge branch 'main' into local-resolver --- .../FASTPythonLocalResolverTest.class.st | 130 ++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 74 ++++++++++ 2 files changed, 204 insertions(+) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st new file mode 100644 index 0000000..a690a49 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -0,0 +1,130 @@ +Class { + #name : 'FASTPythonLocalResolverTest', + #superclass : 'FASTPythonAbstractTestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Tools-Tests-Utilities', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Utilities' +} + +{ #category : 'resolving' } +FASTPythonLocalResolverTest >> parseAndResolve: aString [ + + model := self parse: aString. + + FASTPythonLocalResolverVisitor resolve: model module +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ + + | assignment1 assignment2 assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x = 2 +x'. + + assignment1 := model module statements first. + assignedVariable := assignment1 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + assignment2 := model module statements second. + assignedVariable := assignment2 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignment1. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testUsageInCall [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ + + | assignment1 assignment2 assignedVariable usedVariable | + self skip. "Todo" + self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] +for x in fruits: + print(x)'. + + assignment1 := model module statements first. + assignedVariable := assignment1 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + assignment2 := model module statements second. + assignedVariable := assignment2 left. + self assert: assignedVariable localDeclaration equals: assignment1. + self assert: assignedVariable equals: assignedVariable localDeclaration localUses first. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignment1. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableOfFor [ + + | for declared usedVariable | + self skip. "Todo" + self parseAndResolve: 'for x in "banana": + print(x)'. + + for := model module statements first. + declared := for left. + self assert: declared localDeclaration equals: for. + self assert: declared localDeclaration left name equals: 'x'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 1. + + usedVariable := for statements first arguments first. + self assert: usedVariable localDeclaration equals: for. + self assert: usedVariable equals: declared localDeclaration localUses first +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st new file mode 100644 index 0000000..b56b86f --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -0,0 +1,74 @@ +" +I am a visitor used to link variables usages to their declaration. + +You can run me like this: + +```st +FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" +``` + +Once I ran, all variables will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. + +In this version, this works only for variables declared in the entity to resolve. It will not work for example if you import a global variable from another module because it is not possible to know if this is a variable or something else. +" +Class { + #name : 'FASTPythonLocalResolverVisitor', + #superclass : 'FASTPythonVisitor', + #instVars : [ + 'scoper' + ], + #category : 'FAST-Python-Tools-Utilities', + #package : 'FAST-Python-Tools', + #tag : 'Utilities' +} + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ + + scoper := FASTLocalResolverScoping new. + aFASTBehaviouralEntity accept: self +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ + "Reorginizing the order" + + self visitEntity: aForStatement left. + self visitEntity: aForStatement right. + + self visitFASTPyTWithElseClause: aForStatement. + self visitFASTTStatementBlock: aForStatement. + self visitFASTPyStatement: aForStatement +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ + "I define a variable in a for statement. Thus I need to create a new declaration" + + self halt. + anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | + scoper scopeAdd: anIdentifier sourceCode declaration: forStatement. + anIdentifier localDeclaration: forStatement ]. + + scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ + + "We are declaring a variable in an assignation" + aVariable parentAssignmentLeft ifNotNil: [ :assignment | + [ + scoper scopeAdd: aVariable name declaration: assignment. + aVariable localDeclaration: assignment ] + on: DuplicatedVariableError + do: [ "Do nothing on the second declaration." ] ]. + + super visitFASTPyVariable: aVariable +] From 4233076f32b62c2980e6c7e4bf881ff541c24437 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 29 Jun 2026 19:07:13 +0200 Subject: [PATCH 009/151] Manage for statement left and right --- .../FASTPythonLocalResolverTest.class.st | 30 ++++++++----------- .../FASTPythonLocalResolverVisitor.class.st | 10 ++++--- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index a690a49..d27274f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -86,26 +86,20 @@ print(x)'. { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ - | assignment1 assignment2 assignedVariable usedVariable | - self skip. "Todo" + | assignment assignedVariable usedVariable | self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] for x in fruits: - print(x)'. + pass'. - assignment1 := model module statements first. - assignedVariable := assignment1 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'fruits'. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. - assignment2 := model module statements second. - assignedVariable := assignment2 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable equals: assignedVariable localDeclaration localUses first. - - usedVariable := model module statements third. - self assert: usedVariable localDeclaration equals: assignment1. + usedVariable := model module statements second right. + self assert: usedVariable localDeclaration equals: assignment. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] @@ -113,18 +107,18 @@ for x in fruits: FASTPythonLocalResolverTest >> testVariableOfFor [ | for declared usedVariable | - self skip. "Todo" self parseAndResolve: 'for x in "banana": print(x)'. for := model module statements first. declared := for left. self assert: declared localDeclaration equals: for. - self assert: declared localDeclaration left name equals: 'x'. + self assert: declared localDeclaration left sourceCode equals: 'x'. self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 1. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. usedVariable := for statements first arguments first. self assert: usedVariable localDeclaration equals: for. - self assert: usedVariable equals: declared localDeclaration localUses first + self assert: usedVariable equals: declared localDeclaration localUses second ] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index b56b86f..1535ff2 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -49,14 +49,16 @@ FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - "I define a variable in a for statement. Thus I need to create a new declaration" - self halt. + | name | + name := anIdentifier sourceCode. + + "I define a variable in a for statement. Thus I need to create a new declaration" anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | - scoper scopeAdd: anIdentifier sourceCode declaration: forStatement. + scoper scopeAdd: name declaration: forStatement. anIdentifier localDeclaration: forStatement ]. - scoper bind: anIdentifier toLocalDeclaration: anIdentifier sourceCode + scoper bind: anIdentifier toLocalDeclaration: name ] { #category : 'visiting' } From 2a25f4b28b558cc5abe099502183064e12c2b9be Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 30 Jun 2026 10:19:12 +0200 Subject: [PATCH 010/151] Start to manage local variables --- .../FASTPythonLocalResolverTest.class.st | 90 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 12 ++- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index d27274f..bd5ad2c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -37,6 +37,96 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ + + | globalAssignment assignedGlobal usedGlobal temporaryAssignment assignedTemporary temporaryUsage1 temporaryUsage2 | + self parseAndResolve: 'glob = 1 + +def fun(): + glob = 3 + print(glob) + return glob + +fun() +print(glob)'. + + globalAssignment := model module statements first. + assignedGlobal := globalAssignment left. + self assert: assignedGlobal localDeclaration equals: globalAssignment. + self assert: assignedGlobal localDeclaration left name equals: 'glob'. + self deny: assignedGlobal localDeclaration isNonLocalDeclaration. + self assert: assignedGlobal localDeclaration localUses size equals: 2. + self assert: assignedGlobal localDeclaration localUses first equals: assignedGlobal. + + usedGlobal := model module statements fourth arguments first. + self assert: usedGlobal localDeclaration equals: globalAssignment. + self assert: usedGlobal equals: assignedGlobal localDeclaration localUses second. + + temporaryAssignment := model module statements second statements first. + assignedTemporary := temporaryAssignment left. + self assert: assignedTemporary localDeclaration equals: temporaryAssignment. + self assert: assignedTemporary localDeclaration left name equals: 'glob'. + self deny: assignedTemporary localDeclaration isNonLocalDeclaration. + self assert: assignedTemporary localDeclaration localUses size equals: 3. + self assert: assignedTemporary localDeclaration localUses first equals: assignedTemporary. + + temporaryUsage1 := model module statements second statements second arguments first. + self assert: temporaryUsage1 localDeclaration equals: temporaryAssignment. + self assert: temporaryUsage1 equals: assignedTemporary localDeclaration localUses second. + + temporaryUsage2 := model module statements second statements third expression. + self assert: temporaryUsage2 localDeclaration equals: temporaryAssignment. + self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'glob = 1 + +def fun(): + return glob + +print(fun())'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'glob'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second statements first expression. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testLocalVariableInFunction [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'def f(): + x = 1 + return x + +print(f())'. + + assignment := model module statements first statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 1535ff2..1212eec 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -63,8 +63,8 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ - "We are declaring a variable in an assignation" + aVariable parentAssignmentLeft ifNotNil: [ :assignment | [ scoper scopeAdd: aVariable name declaration: assignment. @@ -74,3 +74,13 @@ FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ super visitFASTPyVariable: aVariable ] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTTStatementBlock: aFASTJavaStatementBlock [ + + scoper pushScope. + + super visitFASTTStatementBlock: aFASTJavaStatementBlock. + + ^ scoper popScope +] From 4836c423e7248e37a00be9ef51c81bae6ddad597 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 30 Jun 2026 10:32:34 +0200 Subject: [PATCH 011/151] Implement a visitor specific to python because it is too different from other languages --- .../FASTPythonLocalResolverTest.class.st | 52 +++++++++++ .../FASTPythonLRAbstractScope.class.st | 46 ++++++++++ .../FASTPythonLRClassScope.class.st | 7 ++ .../FASTPythonLRScope.class.st | 7 ++ .../FASTPythonLocalResolverVisitor.class.st | 90 +++++++++++++------ 5 files changed, 177 insertions(+), 25 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonLRClassScope.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonLRScope.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index bd5ad2c..d3688d8 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -193,6 +193,31 @@ for x in fruits: self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableAccessedInIf [ + + | assignment assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'glob = 1 + +if glob < 3: + print(glob)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'glob'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + usedVariable1 := model module statements second condition operands first. + self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements second thenClause statements first arguments first. + self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableOfFor [ @@ -212,3 +237,30 @@ FASTPythonLocalResolverTest >> testVariableOfFor [ self assert: usedVariable localDeclaration equals: for. self assert: usedVariable equals: declared localDeclaration localUses second ] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ + + | assignment assignedVariable assignedVariable2 usedVariable | + self parseAndResolve: 'glob = 1 + +if True: + glob = 3 + +print(glob)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'glob'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + assignedVariable2 := model module statements second thenClause statements first left. + self assert: assignedVariable2 localDeclaration equals: assignment. + self assert: assignedVariable2 equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st new file mode 100644 index 0000000..6ccdbb5 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st @@ -0,0 +1,46 @@ +Class { + #name : 'FASTPythonLRAbstractScope', + #superclass : 'Object', + #instVars : [ + 'nameDictionary', + 'entity' + ], + #category : 'FAST-Python-Tools-LocalResolver', + #package : 'FAST-Python-Tools', + #tag : 'LocalResolver' +} + +{ #category : 'instance creation' } +FASTPythonLRAbstractScope class >> for: anEntity [ + + ^ self new + entity: anEntity; + yourself +] + +{ #category : 'as yet unclassified' } +FASTPythonLRAbstractScope >> declarationNamed: aVariableName ifPresent: aBlock [ + + ^ nameDictionary at: aVariableName ifPresent: aBlock +] + +{ #category : 'as yet unclassified' } +FASTPythonLRAbstractScope >> ensureDeclarationOf: aVariableName assignment: anAssignment [ + "If it is already present we do nothing " + + ^ nameDictionary at: aVariableName ifAbsentPut: [ + anAssignment clearLocalUses. + anAssignment ] +] + +{ #category : 'accessing' } +FASTPythonLRAbstractScope >> entity: anObject [ + entity := anObject +] + +{ #category : 'initialization' } +FASTPythonLRAbstractScope >> initialize [ + + super initialize. + nameDictionary := Dictionary new +] diff --git a/src/FAST-Python-Tools/FASTPythonLRClassScope.class.st b/src/FAST-Python-Tools/FASTPythonLRClassScope.class.st new file mode 100644 index 0000000..9f330d7 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLRClassScope.class.st @@ -0,0 +1,7 @@ +Class { + #name : 'FASTPythonLRClassScope', + #superclass : 'FASTPythonLRAbstractScope', + #category : 'FAST-Python-Tools-LocalResolver', + #package : 'FAST-Python-Tools', + #tag : 'LocalResolver' +} diff --git a/src/FAST-Python-Tools/FASTPythonLRScope.class.st b/src/FAST-Python-Tools/FASTPythonLRScope.class.st new file mode 100644 index 0000000..fbdffe6 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLRScope.class.st @@ -0,0 +1,7 @@ +Class { + #name : 'FASTPythonLRScope', + #superclass : 'FASTPythonLRAbstractScope', + #category : 'FAST-Python-Tools-LocalResolver', + #package : 'FAST-Python-Tools', + #tag : 'LocalResolver' +} diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 1212eec..412f542 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -15,11 +15,11 @@ Class { #name : 'FASTPythonLocalResolverVisitor', #superclass : 'FASTPythonVisitor', #instVars : [ - 'scoper' + 'scopes' ], - #category : 'FAST-Python-Tools-Utilities', + #category : 'FAST-Python-Tools-LocalResolver', #package : 'FAST-Python-Tools', - #tag : 'Utilities' + #tag : 'LocalResolver' } { #category : 'instance creation' } @@ -28,11 +28,58 @@ FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ ^ self new resolve: aPythonEntity ] +{ #category : 'as yet unclassified' } +FASTPythonLocalResolverVisitor >> bind: aVariable toDeclarationNamed: aVariableName [ + + | declaration | + declaration := (self declarationNamed: aVariableName) ifNil: [ self error: 'Not yet implemented.' ]. + + aVariable localDeclaration: declaration. + declaration addLocalUse: aVariable +] + +{ #category : 'as yet unclassified' } +FASTPythonLocalResolverVisitor >> declarationNamed: aVariableName [ + + scopes do: [ :scope | scope declarationNamed: aVariableName ifPresent: [ :declaration | ^ declaration ] ]. + ^ nil +] + +{ #category : 'as yet unclassified' } +FASTPythonLocalResolverVisitor >> ensureDeclarationOf: aVariable named: aVariableName assignment: anAssignment [ + + scopes top ensureDeclarationOf: aVariableName assignment: anAssignment. + self bind: aVariable toDeclarationNamed: aVariableName +] + +{ #category : 'initialization' } +FASTPythonLocalResolverVisitor >> initialize [ + + super initialize. + scopes := Stack new +] + { #category : 'instance creation' } FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ - scoper := FASTLocalResolverScoping new. - aFASTBehaviouralEntity accept: self + scopes push: ((aFASTBehaviouralEntity isClassDefinition + ifTrue: [ FASTPythonLRClassScope ] + ifFalse: [ FASTPythonLRScope ]) for: aFASTBehaviouralEntity). + + aFASTBehaviouralEntity accept: self. + scopes pop. + self assert: scopes isEmpty +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> shouldSkipIdentifier: anIdentifier [ + "In fact we could have a variable, but I'll manage it later. + https://github.com/moosetechnology/FAST-Python/issues/20" + + self flag: #todo. + anIdentifier caller ifNotNil: [ ^ true ]. + + ^ false ] { #category : 'visiting - reordering' } @@ -47,40 +94,33 @@ FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ self visitFASTPyStatement: aForStatement ] +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + + scopes push: (FASTPythonLRScope for: aFunctionDefinition). + super visitFASTPyFunctionDefinition: aFunctionDefinition. + scopes pop +] + { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ | name | + (self shouldSkipIdentifier: anIdentifier) ifTrue: [ ^ self ]. + name := anIdentifier sourceCode. "I define a variable in a for statement. Thus I need to create a new declaration" - anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | - scoper scopeAdd: name declaration: forStatement. - anIdentifier localDeclaration: forStatement ]. + anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | ^ self ensureDeclarationOf: anIdentifier named: name assignment: forStatement ]. - scoper bind: anIdentifier toLocalDeclaration: name + self bind: anIdentifier toDeclarationNamed: name ] { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ "We are declaring a variable in an assignation" - aVariable parentAssignmentLeft ifNotNil: [ :assignment | - [ - scoper scopeAdd: aVariable name declaration: assignment. - aVariable localDeclaration: assignment ] - on: DuplicatedVariableError - do: [ "Do nothing on the second declaration." ] ]. + aVariable parentAssignmentLeft ifNotNil: [ :assignment | ^ self ensureDeclarationOf: aVariable named: aVariable name assignment: assignment ]. super visitFASTPyVariable: aVariable ] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTTStatementBlock: aFASTJavaStatementBlock [ - - scoper pushScope. - - super visitFASTTStatementBlock: aFASTJavaStatementBlock. - - ^ scoper popScope -] From 73f597988e2b91e28908abf1152c8dab1676793e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 30 Jun 2026 18:35:07 +0200 Subject: [PATCH 012/151] Add tests on edge cases of loops --- .../FASTPythonLocalResolverTest.class.st | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index d3688d8..3ea7e19 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -238,6 +238,54 @@ FASTPythonLocalResolverTest >> testVariableOfFor [ self assert: usedVariable equals: declared localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableOfForClashingWithOtherVariables [ + + | assignation assignedVariable assignedVariableInFor usedVariable | + self parseAndResolve: 'x = 3 + +for x in range(5): + print(x)'. + + assignation := model module statements first. + assignedVariable := assignation left. + self assert: assignedVariable localDeclaration equals: assignation. + self assert: assignedVariable localDeclaration left sourceCode equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + assignedVariableInFor := model module statements second left. + self assert: assignedVariableInFor localDeclaration equals: assignation. + self assert: assignedVariableInFor equals: assignedVariableInFor localDeclaration localUses second. + + usedVariable := model module statements second statements first arguments first. + self assert: usedVariable localDeclaration equals: assignation. + self assert: usedVariable equals: usedVariable localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ + + | for assignedVariable usedVariable | + self parseAndResolve: 'for x in range(5): + pass + +print(x)'. + + for := model module statements first. + assignedVariable := for left. + self assert: assignedVariable localDeclaration equals: for. + self assert: assignedVariable localDeclaration left sourceCode equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: for. + self assert: usedVariable equals: usedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ From 169ce55410c231532010448054a3f98e6f2fb688 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 3 Jul 2026 10:44:05 +0200 Subject: [PATCH 013/151] Manage variables declared in while or for --- .../FASTPythonLocalResolverTest.class.st | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 3ea7e19..cd57195 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -218,7 +218,51 @@ if glob < 3: self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third ] -{ #category : 'tests' } +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableDeclaredInFor [ + + | assignement declared usedVariable | + self parseAndResolve: 'for x in "banana": + i = 2 + +print(i)'. + + assignement := model module statements first statements first. + declared := assignement left. + self assert: declared localDeclaration equals: assignement. + self assert: declared localDeclaration left sourceCode equals: 'i'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignement. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testVariableDeclaredInWhile [ + + | assignement declared usedVariable | + self parseAndResolve: 'while False: + i = 2 + +print(i)'. + + assignement := model module statements first statements first. + declared := assignement left. + self assert: declared localDeclaration equals: assignement. + self assert: declared localDeclaration left sourceCode equals: 'i'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignement. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfFor [ | for declared usedVariable | @@ -238,7 +282,7 @@ FASTPythonLocalResolverTest >> testVariableOfFor [ self assert: usedVariable equals: declared localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForClashingWithOtherVariables [ | assignation assignedVariable assignedVariableInFor usedVariable | @@ -264,7 +308,7 @@ for x in range(5): self assert: usedVariable equals: usedVariable localDeclaration localUses third ] -{ #category : 'tests' } +{ #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ | for assignedVariable usedVariable | From 6792292dbbc8e4b3e3ae5dde2d9d73d42e4e2ef0 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 15 Jul 2026 10:18:26 +0200 Subject: [PATCH 014/151] Mannage globals accessed in lambdas --- .../FASTPythonLocalResolverTest.class.st | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index cd57195..c8ad200 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -104,6 +104,27 @@ print(fun())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalUsedInLambda [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 + +lambda: x'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second expression. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testLocalVariableInFunction [ From 4b8ab0a5a51acf25490b87d9289362d240c80ac6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 15 Jul 2026 11:42:46 +0200 Subject: [PATCH 015/151] Manage lambda parameters --- .../FASTPythonLocalResolverTest.class.st | 18 ++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index c8ad200..688a0ee 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -125,6 +125,24 @@ lambda: x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testLambdaParameter [ + + | declaration usedVariable | + self parseAndResolve: 'lambda y: y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testLocalVariableInFunction [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 412f542..e1442c4 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -116,6 +116,13 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ self bind: anIdentifier toDeclarationNamed: name ] +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ + + self ensureDeclarationOf: aParameter named: aParameter name assignment: aParameter. + super visitFASTPyParameter: aParameter +] + { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ "We are declaring a variable in an assignation" From 6790e5ed9884b7b25481c7d2ac6ce0c83faf0804 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 15 Jul 2026 14:59:03 +0200 Subject: [PATCH 016/151] Begin to manage function parameters --- .../FASTPythonLocalResolverTest.class.st | 21 ++++++++++++++- .../FASTPythonLocalResolverVisitor.class.st | 27 ++++++++++++++----- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 688a0ee..f0de58d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -37,6 +37,25 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameter [ + + | declaration usedVariable | + self parseAndResolve: 'def funct(y): + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ @@ -125,7 +144,7 @@ lambda: x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testLambdaParameter [ | declaration usedVariable | diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index e1442c4..734c4d0 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -28,7 +28,7 @@ FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ ^ self new resolve: aPythonEntity ] -{ #category : 'as yet unclassified' } +{ #category : 'declarations' } FASTPythonLocalResolverVisitor >> bind: aVariable toDeclarationNamed: aVariableName [ | declaration | @@ -38,14 +38,14 @@ FASTPythonLocalResolverVisitor >> bind: aVariable toDeclarationNamed: aVariableN declaration addLocalUse: aVariable ] -{ #category : 'as yet unclassified' } +{ #category : 'declarations' } FASTPythonLocalResolverVisitor >> declarationNamed: aVariableName [ scopes do: [ :scope | scope declarationNamed: aVariableName ifPresent: [ :declaration | ^ declaration ] ]. ^ nil ] -{ #category : 'as yet unclassified' } +{ #category : 'declarations' } FASTPythonLocalResolverVisitor >> ensureDeclarationOf: aVariable named: aVariableName assignment: anAssignment [ scopes top ensureDeclarationOf: aVariableName assignment: anAssignment. @@ -59,7 +59,7 @@ FASTPythonLocalResolverVisitor >> initialize [ scopes := Stack new ] -{ #category : 'instance creation' } +{ #category : 'initialization' } FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ scopes push: ((aFASTBehaviouralEntity isClassDefinition @@ -82,6 +82,14 @@ FASTPythonLocalResolverVisitor >> shouldSkipIdentifier: anIdentifier [ ^ false ] +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ + + scopes push: aScope. + + [ aBlock value ] ensure: [ scopes pop ] +] + { #category : 'visiting - reordering' } FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ "Reorginizing the order" @@ -97,9 +105,14 @@ FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ - scopes push: (FASTPythonLRScope for: aFunctionDefinition). - super visitFASTPyFunctionDefinition: aFunctionDefinition. - scopes pop + self + useScope: (FASTPythonLRScope for: aFunctionDefinition) + during: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." + self visitFASTTWithParameters: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition ] ] { #category : 'visiting' } From 34761a3200d555be5171d0281dfa6370b72b2e32 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 15 Jul 2026 17:41:51 +0200 Subject: [PATCH 017/151] Manage collection initializers --- .../FASTPythonLocalResolverTest.class.st | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index f0de58d..99c4ba6 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -56,6 +56,25 @@ FASTPythonLocalResolverTest >> testFunctionParameter [ self assert: usedVariable equals: declaration localDeclaration localUses second ] +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ + + | declaration usedVariable | + self parseAndResolve: 'def funct(y=3): + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ @@ -99,6 +118,27 @@ print(glob)'. self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +{x: 2}'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first key. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ @@ -144,6 +184,69 @@ lambda: x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalUsedInList [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +[ x ]'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalUsedInSet [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +{ x }'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +(x, 2)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testLambdaParameter [ From a1200fdeed7968cd01afbbdffaf5619bd7278d3c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 16 Jul 2026 10:18:39 +0200 Subject: [PATCH 018/151] Get further in the analysis of the notebooks by ignoring variables not declared --- .../FASTPythonLocalResolverTest.class.st | 29 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 3 +- .../FASTTEntity.extension.st | 9 ++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/FAST-Python-Tools/FASTTEntity.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 99c4ba6..269c432 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -17,6 +17,23 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ + + | assignment assignedVariable | + self parseAndResolve: 'x = 3 + +# {x: 2}'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 1. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ @@ -247,6 +264,18 @@ FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - not variables' } +FASTPythonLocalResolverTest >> testImportedIdentifier [ + + | receiver | + self parseAndResolve: 'import pandas as pd +pd.readCSV("path")'. + + receiver := model module statements second callee value. + self assert: receiver sourceCode equals: 'pd'. + self deny: receiver hasLocalDeclaration +] + { #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testLambdaParameter [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 734c4d0..1237490 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -32,7 +32,8 @@ FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ FASTPythonLocalResolverVisitor >> bind: aVariable toDeclarationNamed: aVariableName [ | declaration | - declaration := (self declarationNamed: aVariableName) ifNil: [ self error: 'Not yet implemented.' ]. + declaration := (self declarationNamed: aVariableName) ifNil: [ + ^ self "In python we cannot know if an identifier that was not assigned is a variable or something else such as a function. So we do not bind anything if we have no variable of this name declared" ]. aVariable localDeclaration: declaration. declaration addLocalUse: aVariable diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st new file mode 100644 index 0000000..b4b12bf --- /dev/null +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -0,0 +1,9 @@ +Extension { #name : 'FASTTEntity' } + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> hasLocalDeclaration [ + + self attributeAt: #localDeclaration ifAbsent: [ ^ false ]. + + ^ true +] From 6f57fedd93d1cb171c507e82ec3272ba5d1c5dac Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 16 Jul 2026 15:55:12 +0200 Subject: [PATCH 019/151] Add doc --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 0a8a9f1..040033f 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,32 @@ A CFG can be done on a function, method, class, module or lambda. You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` +## Local variable resolutions + +It is possible to apply a local variable name resolution on a FAST-Python model by executing this piece of code: + +```smalltalk +FASTPythonLocalResolverVisitor resolve: model module +``` + +Once this is executed, all nodes representing a variable will be able to provide a `#localDeclaration` pointing to the first use of the variable. This local declaration also knows all the `#localUses` of the variable. + +### Limitations + +This has some limitations. For example, if we import a global variable, we cannot know if this is a global variable or something else. So we will not link it to any declaration. + +Also, this kind of uses are not supported: + +```python +a.b.c = 3 +d = a.b +print(d.c) +``` + +Here `a.b.c` will have a local declaration, but it will not know that`d.c` is a local use of this declared variable. + + + ## Moose versions compatibility | Version | Compatible Moose versions | From 7e3e75ffae3d44b2c158b55f6aff64914e5259fe Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 16 Jul 2026 17:48:52 +0200 Subject: [PATCH 020/151] Manage unbinding of variables if an import alias has the same name --- .../FASTPyImportedEntity.class.st | 6 +++++ .../FASTPythonLocalResolverTest.class.st | 27 +++++++++++++++++++ .../FASTPythonLRAbstractScope.class.st | 6 +++++ .../FASTPythonLocalResolverVisitor.class.st | 11 ++++++++ 4 files changed, 50 insertions(+) diff --git a/src/FAST-Python-Model/FASTPyImportedEntity.class.st b/src/FAST-Python-Model/FASTPyImportedEntity.class.st index be0334c..f5c8600 100644 --- a/src/FAST-Python-Model/FASTPyImportedEntity.class.st +++ b/src/FAST-Python-Model/FASTPyImportedEntity.class.st @@ -53,6 +53,12 @@ FASTPyImportedEntity >> alias: anObject [ alias := anObject ] +{ #category : 'testing' } +FASTPyImportedEntity >> hasAlias [ + + ^ self alias isNotNil +] + { #category : 'accessing' } FASTPyImportedEntity >> import [ "Relation named: #import type: #FASTPyImport opposite: #importedEntities" diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 269c432..3e28300 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -135,6 +135,33 @@ print(glob)'. self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImportAlias [ + "Here we cannot know if the second printing is of a variable." + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x) + +import a as x + +print(x)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + self deny: model module statements fourth arguments first hasLocalDeclaration +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st index 6ccdbb5..df3c6f9 100644 --- a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st @@ -38,6 +38,12 @@ FASTPythonLRAbstractScope >> entity: anObject [ entity := anObject ] +{ #category : 'as yet unclassified' } +FASTPythonLRAbstractScope >> forgetDeclarationOf: aName [ + + nameDictionary removeKey: aName ifAbsent: [ "Do nothing" ] +] + { #category : 'initialization' } FASTPythonLRAbstractScope >> initialize [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 1237490..9de71eb 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -130,6 +130,17 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ self bind: anIdentifier toDeclarationNamed: name ] +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ + + anImport importedEntities do: [ :entity | + entity hasAlias + ifTrue: [ scopes top forgetDeclarationOf: entity alias ] + ifFalse: [ self halt ] ]. + + super visitFASTPyImport: anImport +] + { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ From 3ee2a2a8e35c111f269229b69e98e52e1f8324a7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 17 Jul 2026 10:27:18 +0200 Subject: [PATCH 021/151] Refactoring to support more resolution than just variables Start to manage definition of functions --- .../FASTPythonLocalResolverTest.class.st | 81 ++++++++++++------- .../FASTPythonLocalResolverVisitor.class.st | 40 ++++----- 2 files changed, 73 insertions(+), 48 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 3e28300..01a65f5 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -17,7 +17,7 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ | assignment assignedVariable | @@ -34,7 +34,7 @@ FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ self assert: assignedVariable localDeclaration localUses first equals: assignedVariable ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ | assignment assignedVariable usedVariable | @@ -54,6 +54,27 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testFunctionDeclaredAndCalled [ + + | functionDefinition call | + self parseAndResolve: 'def func(): + pass + +func()'. + + functionDefinition := model module statements first. + self assert: functionDefinition localDeclaration equals: functionDefinition. + self assert: functionDefinition localDeclaration name equals: 'func'. + self deny: functionDefinition localDeclaration isNonLocalDeclaration. + self assert: functionDefinition localDeclaration localUses size equals: 2. + self assert: functionDefinition localDeclaration localUses first equals: functionDefinition. + + call := model module statements second callee. + self assert: call localDeclaration equals: functionDefinition. + self assert: call equals: functionDefinition localDeclaration localUses second +] + { #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testFunctionParameter [ @@ -92,7 +113,7 @@ FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ self assert: usedVariable equals: declaration localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ | globalAssignment assignedGlobal usedGlobal temporaryAssignment assignedTemporary temporaryUsage1 temporaryUsage2 | @@ -162,7 +183,27 @@ print(x)'. self deny: model module statements fourth arguments first hasLocalDeclaration ] -{ #category : 'tests' } +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsageInCall [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ | assignment assignedVariable usedVariable | @@ -183,7 +224,7 @@ FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ | assignment assignedVariable usedVariable | @@ -207,7 +248,7 @@ print(fun())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInLambda [ | assignment assignedVariable usedVariable | @@ -228,7 +269,7 @@ lambda: x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInList [ | assignment assignedVariable usedVariable | @@ -249,7 +290,7 @@ FASTPythonLocalResolverTest >> testGlobalUsedInList [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInSet [ | assignment assignedVariable usedVariable | @@ -270,7 +311,7 @@ FASTPythonLocalResolverTest >> testGlobalUsedInSet [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ | assignment assignedVariable usedVariable | @@ -321,7 +362,7 @@ FASTPythonLocalResolverTest >> testLambdaParameter [ self assert: usedVariable equals: declaration localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - local variables' } FASTPythonLocalResolverTest >> testLocalVariableInFunction [ | assignment assignedVariable usedVariable | @@ -370,26 +411,6 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses third ] -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testUsageInCall [ - - | assignment assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -print(x)'. - - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignment. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 9de71eb..c393e1d 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -1,5 +1,5 @@ " -I am a visitor used to link variables usages to their declaration. +I am a visitor used to link entities usages to their declaration. You can run me like this: @@ -7,9 +7,14 @@ You can run me like this: FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" ``` -Once I ran, all variables will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. +Once I ran, all entities will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. -In this version, this works only for variables declared in the entity to resolve. It will not work for example if you import a global variable from another module because it is not possible to know if this is a variable or something else. +The declaration can be various things: +- First variable assignement +- Function definition +- Variable declared in a loop structure (like in the left side of a for each) +- An imported entity +... " Class { #name : 'FASTPythonLocalResolverVisitor', @@ -29,28 +34,28 @@ FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ ] { #category : 'declarations' } -FASTPythonLocalResolverVisitor >> bind: aVariable toDeclarationNamed: aVariableName [ +FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ | declaration | - declaration := (self declarationNamed: aVariableName) ifNil: [ + declaration := (self declarationNamed: aName) ifNil: [ ^ self "In python we cannot know if an identifier that was not assigned is a variable or something else such as a function. So we do not bind anything if we have no variable of this name declared" ]. - aVariable localDeclaration: declaration. - declaration addLocalUse: aVariable + aFASTNode localDeclaration: declaration. + declaration addLocalUse: aFASTNode ] { #category : 'declarations' } -FASTPythonLocalResolverVisitor >> declarationNamed: aVariableName [ +FASTPythonLocalResolverVisitor >> declarationNamed: aName [ - scopes do: [ :scope | scope declarationNamed: aVariableName ifPresent: [ :declaration | ^ declaration ] ]. + scopes do: [ :scope | scope declarationNamed: aName ifPresent: [ :declaration | ^ declaration ] ]. ^ nil ] { #category : 'declarations' } -FASTPythonLocalResolverVisitor >> ensureDeclarationOf: aVariable named: aVariableName assignment: anAssignment [ +FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName declaration: aFASTNode [ - scopes top ensureDeclarationOf: aVariableName assignment: anAssignment. - self bind: aVariable toDeclarationNamed: aVariableName + scopes top ensureDeclarationOf: aName assignment: aFASTNode. + self bind: anEntity toDeclarationNamed: aName ] { #category : 'initialization' } @@ -106,6 +111,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + self ensureDeclarationOf: aFunctionDefinition named: aFunctionDefinition name declaration: aFunctionDefinition. self useScope: (FASTPythonLRScope for: aFunctionDefinition) during: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." @@ -120,12 +126,10 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ | name | - (self shouldSkipIdentifier: anIdentifier) ifTrue: [ ^ self ]. - name := anIdentifier sourceCode. "I define a variable in a for statement. Thus I need to create a new declaration" - anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | ^ self ensureDeclarationOf: anIdentifier named: name assignment: forStatement ]. + anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | ^ self ensureDeclarationOf: anIdentifier named: name declaration: forStatement ]. self bind: anIdentifier toDeclarationNamed: name ] @@ -136,7 +140,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ anImport importedEntities do: [ :entity | entity hasAlias ifTrue: [ scopes top forgetDeclarationOf: entity alias ] - ifFalse: [ self halt ] ]. + ifFalse: [ self flag: #todo ] ]. super visitFASTPyImport: anImport ] @@ -144,7 +148,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ - self ensureDeclarationOf: aParameter named: aParameter name assignment: aParameter. + self ensureDeclarationOf: aParameter named: aParameter name declaration: aParameter. super visitFASTPyParameter: aParameter ] @@ -152,7 +156,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ "We are declaring a variable in an assignation" - aVariable parentAssignmentLeft ifNotNil: [ :assignment | ^ self ensureDeclarationOf: aVariable named: aVariable name assignment: assignment ]. + aVariable parentAssignmentLeft ifNotNil: [ :assignment | ^ self ensureDeclarationOf: aVariable named: aVariable name declaration: assignment ]. super visitFASTPyVariable: aVariable ] From 3f0981fc0bc5a9e3dcc85e85fce088236abe922c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 17 Jul 2026 15:44:35 +0200 Subject: [PATCH 022/151] Commit some tests I'll need to rework --- .../FASTPythonLocalResolverTest.class.st | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 01a65f5..5a7113f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -156,6 +156,33 @@ print(glob)'. self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x) + +import x + +print(x)'. + self skip. "To update and fix" + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + self deny: model module statements fourth arguments first hasLocalDeclaration +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testGlobalShadowedByImportAlias [ "Here we cannot know if the second printing is of a variable." @@ -183,6 +210,38 @@ print(x)'. self deny: model module statements fourth arguments first hasLocalDeclaration ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImportInFunction [ + + | assignment assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'matplotlib = 3 + +print(matplotlib) + +def f(): + import matplotlib + return matplotlib + +print(matplotlib)'. + + self skip. "To update and fix" + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'matplotlib'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fourth arguments first. + self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsageInCall [ From ed832f6ca32cd51d48da25fa5327cf30902c2968 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 17 Jul 2026 15:52:48 +0200 Subject: [PATCH 023/151] Begin to manage resolution of imports --- .../FASTPythonLocalResolverTest.class.st | 24 ++++++++++++++++++- .../FASTPythonLRAbstractScope.class.st | 6 ----- .../FASTPythonLocalResolverVisitor.class.st | 7 ++++-- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 5a7113f..04d2270 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -54,7 +54,7 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests - globals' } +{ #category : 'tests - functions' } FASTPythonLocalResolverTest >> testFunctionDeclaredAndCalled [ | functionDefinition call | @@ -195,6 +195,7 @@ import a as x print(x)'. + self skip. "We need to update the behavior" assignment := model module statements first. assignedVariable := assignment left. self assert: assignedVariable localDeclaration equals: assignment. @@ -391,6 +392,27 @@ FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntity [ + + | import importedEntity call | + self parseAndResolve: 'import func + +func()'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + { #category : 'tests - not variables' } FASTPythonLocalResolverTest >> testImportedIdentifier [ diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st index df3c6f9..6ccdbb5 100644 --- a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st @@ -38,12 +38,6 @@ FASTPythonLRAbstractScope >> entity: anObject [ entity := anObject ] -{ #category : 'as yet unclassified' } -FASTPythonLRAbstractScope >> forgetDeclarationOf: aName [ - - nameDictionary removeKey: aName ifAbsent: [ "Do nothing" ] -] - { #category : 'initialization' } FASTPythonLRAbstractScope >> initialize [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index c393e1d..181dbf0 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -139,8 +139,11 @@ FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ anImport importedEntities do: [ :entity | entity hasAlias - ifTrue: [ scopes top forgetDeclarationOf: entity alias ] - ifFalse: [ self flag: #todo ] ]. + ifTrue: [ self flag: #todo ] + ifFalse: [ + entity segments size = 1 + ifTrue: [ self ensureDeclarationOf: entity named: entity segments last declaration: anImport ] + ifFalse: [ self flag: #todo "I don't know yet how to manage this" ] ] ]. super visitFASTPyImport: anImport ] From 16d8d1c34d334b4d128141430baa35fdace5ad0b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 17 Jul 2026 16:16:18 +0200 Subject: [PATCH 024/151] Manage aliases of imports --- .../FASTPythonLocalResolverTest.class.st | 67 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 04d2270..0aab7ec 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -403,6 +403,7 @@ func()'. import := model module statements first. importedEntity := import importedEntities anyOne. self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. self assert: importedEntity localDeclaration importedEntities first segments last equals: 'func'. self deny: importedEntity localDeclaration isNonLocalDeclaration. self assert: importedEntity localDeclaration localUses size equals: 2. @@ -413,6 +414,72 @@ func()'. self assert: call equals: importedEntity localDeclaration localUses second ] +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntityWithAlias [ + + | import importedEntity call | + self parseAndResolve: 'import functi as func + +func()'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntityWithAliasDoesNotShadowVariable [ + + | import importedEntity call assignment assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'x = 1 + +print(x) + +import x as func + +func() + +print(x)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fifth arguments first. + self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements fourth callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + { #category : 'tests - not variables' } FASTPythonLocalResolverTest >> testImportedIdentifier [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 181dbf0..9dd9486 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -139,7 +139,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ anImport importedEntities do: [ :entity | entity hasAlias - ifTrue: [ self flag: #todo ] + ifTrue: [ self ensureDeclarationOf: entity named: entity alias declaration: anImport ] ifFalse: [ entity segments size = 1 ifTrue: [ self ensureDeclarationOf: entity named: entity segments last declaration: anImport ] From 9f65882f3bf04f61a789aa1ae523a7b60c47a90d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 17 Jul 2026 17:12:23 +0200 Subject: [PATCH 025/151] Start shadowing management --- .../FASTPythonLocalResolverTest.class.st | 29 +++++++++---------- .../FASTPyAssignment.extension.st | 7 +++++ .../FASTPyEntity.extension.st | 9 ++++++ .../FASTPyForStatement.extension.st | 7 +++++ .../FASTPyImportStatement.extension.st | 7 +++++ .../FASTPythonLRAbstractScope.class.st | 14 +++++++-- 6 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPyAssignment.extension.st create mode 100644 src/FAST-Python-Tools/FASTPyForStatement.extension.st create mode 100644 src/FAST-Python-Tools/FASTPyImportStatement.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 0aab7ec..c055df1 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -160,14 +160,14 @@ print(glob)'. FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ "Here we cannot know if the second printing is of a variable." - | assignment assignedVariable usedVariable | + | assignment assignedVariable usedVariable import importedEntity usedImportedEntity | self parseAndResolve: 'x = 1 print(x) import x print(x)'. - self skip. "To update and fix" + assignment := model module statements first. assignedVariable := assignment left. self assert: assignedVariable localDeclaration equals: assignment. @@ -180,7 +180,18 @@ print(x)'. self assert: usedVariable localDeclaration equals: assignment. self assert: usedVariable equals: assignedVariable localDeclaration localUses second. - self deny: model module statements fourth arguments first hasLocalDeclaration + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second ] { #category : 'tests - shadowing' } @@ -480,18 +491,6 @@ print(x)'. self assert: call equals: importedEntity localDeclaration localUses second ] -{ #category : 'tests - not variables' } -FASTPythonLocalResolverTest >> testImportedIdentifier [ - - | receiver | - self parseAndResolve: 'import pandas as pd -pd.readCSV("path")'. - - receiver := model module statements second callee value. - self assert: receiver sourceCode equals: 'pd'. - self deny: receiver hasLocalDeclaration -] - { #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testLambdaParameter [ diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st new file mode 100644 index 0000000..5cd1bda --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyAssignment' } + +{ #category : '*FAST-Python-Tools' } +FASTPyAssignment >> localResolverKind [ + + ^ #variable +] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index d85df03..e2dcc16 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -11,3 +11,12 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> localResolverKind [ + "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. + + I am used to know the kind of entity that is been declared." + + ^ self subclassResponsibility +] diff --git a/src/FAST-Python-Tools/FASTPyForStatement.extension.st b/src/FAST-Python-Tools/FASTPyForStatement.extension.st new file mode 100644 index 0000000..e14bf85 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyForStatement.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyForStatement' } + +{ #category : '*FAST-Python-Tools' } +FASTPyForStatement >> localResolverKind [ + + ^ #variable +] diff --git a/src/FAST-Python-Tools/FASTPyImportStatement.extension.st b/src/FAST-Python-Tools/FASTPyImportStatement.extension.st new file mode 100644 index 0000000..dcfd00a --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyImportStatement.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyImportStatement' } + +{ #category : '*FAST-Python-Tools' } +FASTPyImportStatement >> localResolverKind [ + + ^ #unknown +] diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st index 6ccdbb5..7765782 100644 --- a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st @@ -28,9 +28,17 @@ FASTPythonLRAbstractScope >> declarationNamed: aVariableName ifPresent: aBlock [ FASTPythonLRAbstractScope >> ensureDeclarationOf: aVariableName assignment: anAssignment [ "If it is already present we do nothing " - ^ nameDictionary at: aVariableName ifAbsentPut: [ - anAssignment clearLocalUses. - anAssignment ] + ^ nameDictionary + at: aVariableName + ifPresent: [ :declaration | + declaration localResolverKind = anAssignment localResolverKind + ifTrue: [ ^ declaration ] + ifFalse: [ "If the kind is different, we save a new declaration." + anAssignment clearLocalUses. + nameDictionary at: aVariableName put: anAssignment ] ] + ifAbsentPut: [ + anAssignment clearLocalUses. + anAssignment ] ] { #category : 'accessing' } From b7a5153c2756fbbfc3f7e312cd78752668445d86 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Jul 2026 10:42:42 +0200 Subject: [PATCH 026/151] Ensure from imports are working as imports --- .../FASTPythonLocalResolverTest.class.st | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index c055df1..d69e6de 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -54,6 +54,94 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntity [ + + | import importedEntity call | + self parseAndResolve: 'from matplotlib import __version__ + +print(__version__)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: '__version__'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second arguments first. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntityWithAlias [ + + | import importedEntity call | + self parseAndResolve: 'from matplotlib import __version__ as v + +print(v)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'v'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second arguments first. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntityWithAliasDoesNotShadowVariable [ + + | import importedEntity call assignment assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'x = 1 + +print(x) + +from y import x as func + +func() + +print(x)'. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fifth arguments first. + self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements fourth callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + { #category : 'tests - functions' } FASTPythonLocalResolverTest >> testFunctionDeclaredAndCalled [ From ae685e1a3889b46487907e112f383913afb17b61 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Jul 2026 14:57:41 +0200 Subject: [PATCH 027/151] Update documentation --- README.md | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 040033f..2b9a0b9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,23 @@ Famix AST representation for Python based on TreeSitter + + +- [FAST-Python](#fast-python) + - [Installation](#installation) + - [Quick start](#quick-start) + - [Documentation](#documentation) + - [Control flow graph](#control-flow-graph) + - [Local resolutions](#local-resolutions) + - [Shadowing](#shadowing) + - [Limitations](#limitations) + - [Moose versions compatibility](#moose-versions-compatibility) + - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) + - [Python version compatibility](#python-version-compatibility) + - [Contact](#contact) + + + ## Installation To install this project on your Pharo image, execute the following script: @@ -64,21 +81,35 @@ A CFG can be done on a function, method, class, module or lambda. You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` -## Local variable resolutions +## Local resolutions -It is possible to apply a local variable name resolution on a FAST-Python model by executing this piece of code: +It is possible to apply a local name resolution on a FAST-Python model by executing this piece of code: ```smalltalk -FASTPythonLocalResolverVisitor resolve: model module +FASTPythonLocalResolverVisitor resolve: model module "Can be any behavioral entity" ``` -Once this is executed, all nodes representing a variable will be able to provide a `#localDeclaration` pointing to the first use of the variable. This local declaration also knows all the `#localUses` of the variable. +Once this is executed, all nodes resolved will be able to provide a `#localDeclaration` pointing to the declaration/first use of the entity. This local declaration also knows all the `#localUses` of the entity. -### Limitations +The local declaration can be multiple things such as: +- An assignement +- A function/class/method declaration +- An import +- A parameter declaration +- A for loop to declare a variable +- ... + +### Shadowing -This has some limitations. For example, if we import a global variable, we cannot know if this is a global variable or something else. So we will not link it to any declaration. +In Python anything named can shadow anything named. For example we can declare a global variable then shadow it with an import, then shadow it with a function... + +In the case of a shadowing, we manage it in two distinct ways: +- If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration +- If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration + +### Limitations -Also, this kind of uses are not supported: +This has some limitations. In case we have a dotted name but we do not use the same way to declare it, we are currently not keeping track of the declaration. For example, ßhis kind of uses are not supported: ```python a.b.c = 3 From 1dced696fb5bfef7d7644d2f95e1e88a59b5b4a7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Jul 2026 14:58:57 +0200 Subject: [PATCH 028/151] Support shadowing of parameters --- .../FASTPythonLocalResolverTest.class.st | 33 +++++++++++++++++++ .../FASTPyParameter.extension.st | 7 ++++ 2 files changed, 40 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTPyParameter.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index d69e6de..ac0537e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -620,6 +620,39 @@ print(f())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ + + | parameter usedParameter assignment assignedVariable usedVariable | + self parseAndResolve: 'def func(param): + print(param) + param = 3 + print(param)'. + + parameter := model module statements first parameters first. + self assert: parameter localDeclaration equals: parameter. + self assert: parameter localDeclaration name equals: 'param'. + self deny: parameter localDeclaration isNonLocalDeclaration. + self assert: parameter localDeclaration localUses size equals: 2. + self assert: parameter localDeclaration localUses first equals: parameter. + + usedParameter := model module statements first statements first arguments first. + self assert: usedParameter localDeclaration equals: parameter. + self assert: usedParameter equals: parameter localDeclaration localUses second. + + assignment := model module statements first statements second. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'param'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements first statements third arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st new file mode 100644 index 0000000..cc97ca3 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyParameter' } + +{ #category : '*FAST-Python-Tools' } +FASTPyParameter >> localResolverKind [ + + ^ #parameter +] From f72a1d63301b14b39c57eeefdf3e9a7fe9699813 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Jul 2026 15:24:01 +0200 Subject: [PATCH 029/151] Fix import shadowed by other imports --- .../FASTPythonLocalResolverTest.class.st | 35 +++++++++++++++++++ .../FASTPyImport.extension.st | 7 ++++ .../FASTPyImportStatement.extension.st | 7 ---- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPyImport.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPyImportStatement.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index ac0537e..ca9be22 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -491,6 +491,41 @@ FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testImportShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | import importedEntity1 usedImportedEntity1 importedEntity2 usedImportedEntity2 | + self parseAndResolve: 'import time + +print(time) + +from time import time + +print(time)'. + + import := model module statements first. + importedEntity1 := import importedEntities anyOne. + self assert: importedEntity1 localDeclaration equals: import. + self deny: importedEntity1 localDeclaration importedEntities first hasAlias. + self assert: importedEntity1 localDeclaration importedEntities first segments last equals: 'time'. + self deny: importedEntity1 localDeclaration isNonLocalDeclaration. + self assert: importedEntity1 localDeclaration localUses size equals: 4. + self assert: importedEntity1 localDeclaration localUses first equals: importedEntity1. + + usedImportedEntity1 := model module statements second arguments first. + self assert: usedImportedEntity1 localDeclaration equals: import. + self assert: usedImportedEntity1 equals: importedEntity1 localDeclaration localUses second. + + importedEntity2 := model module statements third importedEntities anyOne. + self assert: importedEntity2 localDeclaration equals: import. + self assert: importedEntity2 localDeclaration localUses third equals: importedEntity2. + + usedImportedEntity2 := model module statements fourth arguments first. + self assert: usedImportedEntity2 localDeclaration equals: import. + self assert: usedImportedEntity2 equals: importedEntity2 localDeclaration localUses fourth +] + { #category : 'tests - imports' } FASTPythonLocalResolverTest >> testImportedEntity [ diff --git a/src/FAST-Python-Tools/FASTPyImport.extension.st b/src/FAST-Python-Tools/FASTPyImport.extension.st new file mode 100644 index 0000000..2d8f610 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyImport.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyImport' } + +{ #category : '*FAST-Python-Tools' } +FASTPyImport >> localResolverKind [ + + ^ #import +] diff --git a/src/FAST-Python-Tools/FASTPyImportStatement.extension.st b/src/FAST-Python-Tools/FASTPyImportStatement.extension.st deleted file mode 100644 index dcfd00a..0000000 --- a/src/FAST-Python-Tools/FASTPyImportStatement.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTPyImportStatement' } - -{ #category : '*FAST-Python-Tools' } -FASTPyImportStatement >> localResolverKind [ - - ^ #unknown -] From 63e2aa72a886597af85c1e87900e3a2fa8100b74 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Jul 2026 18:36:41 +0200 Subject: [PATCH 030/151] Start to manage non local declarations --- .../FASTPythonLocalResolverTest.class.st | 19 +++++++++++++++++++ .../FASTPythonLRAbstractScope.class.st | 14 +++++++------- .../FASTPythonLocalResolverVisitor.class.st | 8 +++++--- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index ca9be22..54ad883 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -655,6 +655,25 @@ print(f())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - non local declarations' } +FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ + + | nonLocalCall nonLocalAccess | + self parseAndResolve: 'print(x)'. + + nonLocalCall := model module statements first callee. + self assert: nonLocalCall localDeclaration name equals: 'print'. + self assert: nonLocalCall localDeclaration isNonLocalDeclaration. + self assert: nonLocalCall localDeclaration localUses size equals: 1. + self assert: nonLocalCall localDeclaration localUses first equals: nonLocalCall. + + nonLocalAccess := model module statements first arguments first. + self assert: nonLocalAccess localDeclaration name equals: 'x'. + self assert: nonLocalAccess localDeclaration isNonLocalDeclaration. + self assert: nonLocalAccess localDeclaration localUses size equals: 1. + self assert: nonLocalAccess localDeclaration localUses first equals: nonLocalAccess +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st index 7765782..41aa6cf 100644 --- a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st @@ -25,20 +25,20 @@ FASTPythonLRAbstractScope >> declarationNamed: aVariableName ifPresent: aBlock [ ] { #category : 'as yet unclassified' } -FASTPythonLRAbstractScope >> ensureDeclarationOf: aVariableName assignment: anAssignment [ +FASTPythonLRAbstractScope >> ensureDeclarationOf: aName declaration: aFASTNode [ "If it is already present we do nothing " ^ nameDictionary - at: aVariableName + at: aName ifPresent: [ :declaration | - declaration localResolverKind = anAssignment localResolverKind + declaration localResolverKind = aFASTNode localResolverKind ifTrue: [ ^ declaration ] ifFalse: [ "If the kind is different, we save a new declaration." - anAssignment clearLocalUses. - nameDictionary at: aVariableName put: anAssignment ] ] + aFASTNode clearLocalUses. + nameDictionary at: aName put: aFASTNode ] ] ifAbsentPut: [ - anAssignment clearLocalUses. - anAssignment ] + aFASTNode clearLocalUses. + aFASTNode ] ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 9dd9486..fb94831 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -37,8 +37,10 @@ FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ | declaration | - declaration := (self declarationNamed: aName) ifNil: [ - ^ self "In python we cannot know if an identifier that was not assigned is a variable or something else such as a function. So we do not bind anything if we have no variable of this name declared" ]. + declaration := (self declarationNamed: aName) ifNil: [ "If it is undeclared, we create an undeclared in the lowest scope in the stack." + scopes first ensureDeclarationOf: aName declaration: (FASTNonLocalDeclaration new + name: aName; + yourself) ]. aFASTNode localDeclaration: declaration. declaration addLocalUse: aFASTNode @@ -54,7 +56,7 @@ FASTPythonLocalResolverVisitor >> declarationNamed: aName [ { #category : 'declarations' } FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName declaration: aFASTNode [ - scopes top ensureDeclarationOf: aName assignment: aFASTNode. + scopes top ensureDeclarationOf: aName declaration: aFASTNode. self bind: anEntity toDeclarationNamed: aName ] From 74034615f50e9e17a663bcdf1bfcceecfeef72fd Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 10:38:46 +0200 Subject: [PATCH 031/151] Add doc --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b9a0b9..c4f5329 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Famix AST representation for Python based on TreeSitter - [Local resolutions](#local-resolutions) - [Shadowing](#shadowing) - [Limitations](#limitations) + - [Separated dotted names](#separated-dotted-names) + - [Access to non local entities](#access-to-non-local-entities) - [Moose versions compatibility](#moose-versions-compatibility) - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) - [Python version compatibility](#python-version-compatibility) @@ -109,7 +111,11 @@ In the case of a shadowing, we manage it in two distinct ways: ### Limitations -This has some limitations. In case we have a dotted name but we do not use the same way to declare it, we are currently not keeping track of the declaration. For example, ßhis kind of uses are not supported: +This project has a few limitations. + +#### Separated dotted names + +In case we have a dotted name but we do not use the same way to declare it, we are currently not keeping track of the declaration. For example, ßhis kind of uses are not supported: ```python a.b.c = 3 @@ -119,7 +125,21 @@ print(d.c) Here `a.b.c` will have a local declaration, but it will not know that`d.c` is a local use of this declared variable. +#### Access to non local entities + +If the code has access to entities that we do not know, then we create a `FASTNonLocalDeclaration`. For example: + +```python +import x + +x.y +``` + +Here, in the expression `x.y` we will be able to link `x` to its declaration in the import, but we have no declaration for y since this is done in another project. +In that case, we associate it to a non local declaration. +But, this has the current limit that if you access multiple times this `y` field of `x`, then each of them ill have their own non local declaration. +This is not the way I would like the project to work and this could be improved by having all references point to the same non local declaration object, but we need time for this :) ## Moose versions compatibility From 0eead1e396df6f7aceeb7ec67895ad8ce986ee7b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 14:31:18 +0200 Subject: [PATCH 032/151] Begin to manage attribute accesses by creating non local declarations for the fields --- .../FASTPythonLocalResolverTest.class.st | 29 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 17 +++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 54ad883..2c7971e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -17,6 +17,35 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] +{ #category : 'tests - non local declarations' } +FASTPythonLocalResolverTest >> testAttributeAccessHalfResolved [ + "Here x is resolved but y is not resolved locally." + + | import importedEntity receiver value | + self parseAndResolve: 'import x + +x.y'. + + import := model module statements first. + importedEntity := import importedEntities first. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + receiver := model module statements second value. + self assert: receiver localDeclaration equals: import. + self deny: receiver localDeclaration isNonLocalDeclaration. + self assert: receiver localDeclaration localUses second equals: receiver. + + value := model module statements second. + self assert: value localDeclaration name equals: 'y'. + self assert: value localDeclaration isNonLocalDeclaration. + self assert: value localDeclaration localUses size equals: 1. + self assert: value localDeclaration localUses first equals: value +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index fb94831..b5f9b57 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -98,6 +98,23 @@ FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ [ aBlock value ] ensure: [ scopes pop ] ] +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ + "This should be improved later to check if we already encountered this accessed attribute and maybe this should go in the scopes?." + + | declaration | + declaration := FASTNonLocalDeclaration new + name: anAttribute name; + yourself. + + declaration clearLocalUses. + + anAttribute localDeclaration: declaration. + declaration addLocalUse: anAttribute. + + super visitFASTPyAttributeAccess: anAttribute +] + { #category : 'visiting - reordering' } FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ "Reorginizing the order" From 4536897ecd310e6051d27677c68dd5b2513921ec Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 15:16:27 +0200 Subject: [PATCH 033/151] Add doc on limitations of the local resolver --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index c4f5329..7864658 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Famix AST representation for Python based on TreeSitter - [Limitations](#limitations) - [Separated dotted names](#separated-dotted-names) - [Access to non local entities](#access-to-non-local-entities) + - [Python 2 management](#python-2-management) - [Moose versions compatibility](#moose-versions-compatibility) - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) - [Python version compatibility](#python-version-compatibility) @@ -141,6 +142,16 @@ In that case, we associate it to a non local declaration. But, this has the current limit that if you access multiple times this `y` field of `x`, then each of them ill have their own non local declaration. This is not the way I would like the project to work and this could be improved by having all references point to the same non local declaration object, but we need time for this :) +See (https://github.com/moosetechnology/FAST-Python/issues/26)[https://github.com/moosetechnology/FAST-Python/issues/26] + +#### Python 2 management + +Currently, the Local resolver is based on Python 3. In the future we should add the support for Python 2 and let the user configure his version of Python. + +This has an influence for example on the scope of comprehensions. In Python 2 comprehensions do not have any scope and the variable declared in it leak while in Python 3 there is a scope and the variable does not leak. + +See (https://github.com/moosetechnology/FAST-Python/issues/27)[https://github.com/moosetechnology/FAST-Python/issues/27] + ## Moose versions compatibility | Version | Compatible Moose versions | From 8f6bbe13bb9abd6a266fcc8075209f5a39eee460 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 15:17:16 +0200 Subject: [PATCH 034/151] Add testing method on Tuples This will be needed to manage assignments in tuples later --- .../FASTPythonMetamodelGenerator.class.st | 1 + src/FAST-Python-Model/FASTPyEntity.class.st | 7 +++++++ src/FAST-Python-Model/FASTPyTuple.class.st | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 5a4ca7d..cf710dd 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -333,6 +333,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ thenClause := builder newClassNamed: #ThenClause. tryStatement := builder newClassNamed: #TryStatement. tuple := builder newClassNamed: #Tuple. + tuple withTesting. type := builder newClassNamed: #Type. typeAliasStatement := builder newClassNamed: #TypeAliasStatement. typeConversion := builder newClassNamed: #TypeConversion. diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 97ffa8b..9c851de 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -148,6 +148,13 @@ FASTPyEntity >> isStringLiteral [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isTuple [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isVariableEntity [ diff --git a/src/FAST-Python-Model/FASTPyTuple.class.st b/src/FAST-Python-Model/FASTPyTuple.class.st index 6f59475..4a059d7 100644 --- a/src/FAST-Python-Model/FASTPyTuple.class.st +++ b/src/FAST-Python-Model/FASTPyTuple.class.st @@ -30,3 +30,10 @@ FASTPyTuple class >> annotation [ ] + +{ #category : 'testing' } +FASTPyTuple >> isTuple [ + + + ^ true +] From f2a044c8fadf730f3bb02f1d53c2c6deca3c5de6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 15:43:37 +0200 Subject: [PATCH 035/151] Ensure we can resolve multiple times a model without clashing --- .../FASTPythonLocalResolverTest.class.st | 23 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 3 +++ .../FASTTEntity.extension.st | 7 ++++++ 3 files changed, 33 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 2c7971e..17a17ac 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -762,6 +762,29 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses third ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoResolutionsDoNotClash [ + + | assignment assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + "Do a second resolution to ensure the first one is cleared" + FASTPythonLocalResolverVisitor resolve: model module. + + assignment := model module statements first. + assignedVariable := assignment left. + self assert: assignedVariable localDeclaration equals: assignment. + self assert: assignedVariable localDeclaration left name equals: 'x'. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index b5f9b57..55cd122 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -73,6 +73,9 @@ FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ scopes push: ((aFASTBehaviouralEntity isClassDefinition ifTrue: [ FASTPythonLRClassScope ] ifFalse: [ FASTPythonLRScope ]) for: aFASTBehaviouralEntity). + + "We fulsh the attributes in case this is not the fist resolution" + aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. aFASTBehaviouralEntity accept: self. scopes pop. diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st index b4b12bf..72cdec3 100644 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -7,3 +7,10 @@ FASTTEntity >> hasLocalDeclaration [ ^ true ] + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> resetLocalResolution [ + + self removeAttribute: #localDeclaration. + self removeAttribute: #localUses +] From 5f0ccee1e85f5818d60a8d68cdd67ab6dc63d724 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 15:51:31 +0200 Subject: [PATCH 036/151] Manage basic assignment in tuples --- .../FASTPythonLocalResolverTest.class.st | 25 +++++++++++++++++++ .../FASTPythonLRAbstractScope.class.st | 15 ++++++----- .../FASTPythonLocalResolverVisitor.class.st | 17 +++++++++++++ .../FASTTEntity.extension.st | 6 +++++ 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 17a17ac..90377f9 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -17,6 +17,31 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] +{ #category : 'tests - tuples assignment' } +FASTPythonLocalResolverTest >> testAssignementToTuple [ + + | assignment assignedVariableX assignedVariableY usedVariableX | + self parseAndResolve: 'x, y = 1, 2 + +print(x)'. + + assignment := model module statements first. + assignedVariableX := assignment left initializers first. + self assert: assignedVariableX localDeclaration equals: assignment. + self assert: assignedVariableX localDeclaration left sourceCode equals: 'x, y'. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 3. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + assignedVariableY := assignment left initializers second. + self assert: assignedVariableY localDeclaration equals: assignment. + self assert: assignedVariableY localDeclaration localUses second equals: assignedVariableY. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignment. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses third +] + { #category : 'tests - non local declarations' } FASTPythonLocalResolverTest >> testAttributeAccessHalfResolved [ "Here x is resolved but y is not resolved locally." diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st index 41aa6cf..abb1564 100644 --- a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st @@ -18,15 +18,17 @@ FASTPythonLRAbstractScope class >> for: anEntity [ yourself ] -{ #category : 'as yet unclassified' } +{ #category : 'actions' } FASTPythonLRAbstractScope >> declarationNamed: aVariableName ifPresent: aBlock [ ^ nameDictionary at: aVariableName ifPresent: aBlock ] -{ #category : 'as yet unclassified' } +{ #category : 'actions' } FASTPythonLRAbstractScope >> ensureDeclarationOf: aName declaration: aFASTNode [ - "If it is already present we do nothing " + "If it is already present we do nothing. Else we create the local declaration. + + I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." ^ nameDictionary at: aName @@ -34,11 +36,12 @@ FASTPythonLRAbstractScope >> ensureDeclarationOf: aName declaration: aFASTNode [ declaration localResolverKind = aFASTNode localResolverKind ifTrue: [ ^ declaration ] ifFalse: [ "If the kind is different, we save a new declaration." - aFASTNode clearLocalUses. + aFASTNode ensureLocalUses. nameDictionary at: aName put: aFASTNode ] ] ifAbsentPut: [ - aFASTNode clearLocalUses. - aFASTNode ] + aFASTNode + ensureLocalUses; + yourself ] ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 55cd122..db34ddd 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -67,6 +67,19 @@ FASTPythonLocalResolverVisitor >> initialize [ scopes := Stack new ] +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> isInTupleAssignment: anIdentifier [ + "I return true if my parent is a tuple on the left side of an assignment" + + anIdentifier collectionInitializer ifNil: [ ^ false ]. + + anIdentifier collectionInitializer isTuple ifFalse: [ ^ false ]. + + anIdentifier collectionInitializer parentAssignmentLeft ifNil: [ ^ false ]. + + ^ true +] + { #category : 'initialization' } FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ @@ -153,6 +166,10 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ "I define a variable in a for statement. Thus I need to create a new declaration" anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | ^ self ensureDeclarationOf: anIdentifier named: name declaration: forStatement ]. + "If I am in a tuple that is on the left side of an assignement, then I must declare a new variable" + (self isInTupleAssignment: anIdentifier) ifTrue: [ + ^ self ensureDeclarationOf: anIdentifier named: name declaration: anIdentifier collectionInitializer parentAssignmentLeft ]. + self bind: anIdentifier toDeclarationNamed: name ] diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st index 72cdec3..b7d1040 100644 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -1,5 +1,11 @@ Extension { #name : 'FASTTEntity' } +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> ensureLocalUses [ + + self attributeAt: #localUses ifAbsentPut: OrderedCollection new +] + { #category : '*FAST-Python-Tools' } FASTTEntity >> hasLocalDeclaration [ From fa6996d4cea4df38f622e31815214e3e9bd898a7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 15:54:55 +0200 Subject: [PATCH 037/151] Simplify scoping because it does not seems I need it for now and I prefer to keep the code simple --- .../FASTPythonLRAbstractScope.class.st | 57 ------------------- .../FASTPythonLRClassScope.class.st | 7 --- .../FASTPythonLRScope.class.st | 52 ++++++++++++++++- .../FASTPythonLocalResolverVisitor.class.st | 6 +- 4 files changed, 53 insertions(+), 69 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonLRClassScope.class.st diff --git a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st b/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st deleted file mode 100644 index abb1564..0000000 --- a/src/FAST-Python-Tools/FASTPythonLRAbstractScope.class.st +++ /dev/null @@ -1,57 +0,0 @@ -Class { - #name : 'FASTPythonLRAbstractScope', - #superclass : 'Object', - #instVars : [ - 'nameDictionary', - 'entity' - ], - #category : 'FAST-Python-Tools-LocalResolver', - #package : 'FAST-Python-Tools', - #tag : 'LocalResolver' -} - -{ #category : 'instance creation' } -FASTPythonLRAbstractScope class >> for: anEntity [ - - ^ self new - entity: anEntity; - yourself -] - -{ #category : 'actions' } -FASTPythonLRAbstractScope >> declarationNamed: aVariableName ifPresent: aBlock [ - - ^ nameDictionary at: aVariableName ifPresent: aBlock -] - -{ #category : 'actions' } -FASTPythonLRAbstractScope >> ensureDeclarationOf: aName declaration: aFASTNode [ - "If it is already present we do nothing. Else we create the local declaration. - - I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." - - ^ nameDictionary - at: aName - ifPresent: [ :declaration | - declaration localResolverKind = aFASTNode localResolverKind - ifTrue: [ ^ declaration ] - ifFalse: [ "If the kind is different, we save a new declaration." - aFASTNode ensureLocalUses. - nameDictionary at: aName put: aFASTNode ] ] - ifAbsentPut: [ - aFASTNode - ensureLocalUses; - yourself ] -] - -{ #category : 'accessing' } -FASTPythonLRAbstractScope >> entity: anObject [ - entity := anObject -] - -{ #category : 'initialization' } -FASTPythonLRAbstractScope >> initialize [ - - super initialize. - nameDictionary := Dictionary new -] diff --git a/src/FAST-Python-Tools/FASTPythonLRClassScope.class.st b/src/FAST-Python-Tools/FASTPythonLRClassScope.class.st deleted file mode 100644 index 9f330d7..0000000 --- a/src/FAST-Python-Tools/FASTPythonLRClassScope.class.st +++ /dev/null @@ -1,7 +0,0 @@ -Class { - #name : 'FASTPythonLRClassScope', - #superclass : 'FASTPythonLRAbstractScope', - #category : 'FAST-Python-Tools-LocalResolver', - #package : 'FAST-Python-Tools', - #tag : 'LocalResolver' -} diff --git a/src/FAST-Python-Tools/FASTPythonLRScope.class.st b/src/FAST-Python-Tools/FASTPythonLRScope.class.st index fbdffe6..46857e3 100644 --- a/src/FAST-Python-Tools/FASTPythonLRScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRScope.class.st @@ -1,7 +1,57 @@ Class { #name : 'FASTPythonLRScope', - #superclass : 'FASTPythonLRAbstractScope', + #superclass : 'Object', + #instVars : [ + 'entity', + 'nameDictionary' + ], #category : 'FAST-Python-Tools-LocalResolver', #package : 'FAST-Python-Tools', #tag : 'LocalResolver' } + +{ #category : 'instance creation' } +FASTPythonLRScope class >> for: anEntity [ + + ^ self new + entity: anEntity; + yourself +] + +{ #category : 'actions' } +FASTPythonLRScope >> declarationNamed: aVariableName ifPresent: aBlock [ + + ^ nameDictionary at: aVariableName ifPresent: aBlock +] + +{ #category : 'actions' } +FASTPythonLRScope >> ensureDeclarationOf: aName declaration: aFASTNode [ + "If it is already present we do nothing. Else we create the local declaration. + + I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." + + ^ nameDictionary + at: aName + ifPresent: [ :declaration | + declaration localResolverKind = aFASTNode localResolverKind + ifTrue: [ ^ declaration ] + ifFalse: [ "If the kind is different, we save a new declaration." + aFASTNode ensureLocalUses. + nameDictionary at: aName put: aFASTNode ] ] + ifAbsentPut: [ + aFASTNode + ensureLocalUses; + yourself ] +] + +{ #category : 'accessing' } +FASTPythonLRScope >> entity: anObject [ + entity := anObject +] + +{ #category : 'initialization' } +FASTPythonLRScope >> initialize [ + + super initialize. + nameDictionary := Dictionary new +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index db34ddd..83386c5 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -83,10 +83,8 @@ FASTPythonLocalResolverVisitor >> isInTupleAssignment: anIdentifier [ { #category : 'initialization' } FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ - scopes push: ((aFASTBehaviouralEntity isClassDefinition - ifTrue: [ FASTPythonLRClassScope ] - ifFalse: [ FASTPythonLRScope ]) for: aFASTBehaviouralEntity). - + scopes push: (FASTPythonLRScope for: aFASTBehaviouralEntity). + "We fulsh the attributes in case this is not the fist resolution" aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. From 6103fbfd7f90978ac3fabc5a28ef17d41e974d2d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 16:10:03 +0200 Subject: [PATCH 038/151] Begin to manage comprehensions --- .../FASTPythonLocalResolverTest.class.st | 21 ++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 28 +++++++++++-------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 90377f9..1329286 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -899,6 +899,27 @@ print(i)'. self assert: usedVariable equals: declared localDeclaration localUses second ] +{ #category : 'tests - comprehensions' } +FASTPythonLocalResolverTest >> testVariableInListComprehensions [ + + | forClause declared usedVariable | + self parseAndResolve: 'fruits = ["apple", "banana", "cherry", "kiwi", "mango"] + +[x for x in fruits]'. + + forClause := model module statements second forClauses first. + declared := forClause left. + self assert: declared localDeclaration equals: forClause. + self assert: declared localDeclaration left sourceCode equals: 'x'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second body. + self assert: usedVariable localDeclaration equals: forClause. + self assert: usedVariable equals: declared localDeclaration localUses second +] + { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfFor [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 83386c5..c5a9728 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -67,7 +67,7 @@ FASTPythonLocalResolverVisitor >> initialize [ scopes := Stack new ] -{ #category : 'visiting' } +{ #category : 'testing' } FASTPythonLocalResolverVisitor >> isInTupleAssignment: anIdentifier [ "I return true if my parent is a tuple on the left side of an assignment" @@ -93,17 +93,6 @@ FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ self assert: scopes isEmpty ] -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> shouldSkipIdentifier: anIdentifier [ - "In fact we could have a variable, but I'll manage it later. - https://github.com/moosetechnology/FAST-Python/issues/20" - - self flag: #todo. - anIdentifier caller ifNotNil: [ ^ true ]. - - ^ false -] - { #category : 'declarations' } FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ @@ -129,6 +118,18 @@ FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ super visitFASTPyAttributeAccess: anAttribute ] +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ + "Reordering the visit of children to ensure for clauses are visited before the body and conditions since they can refer to it." + + self visitFASTPyTSplatExpression: aComprehension. + self visitFASTPyExpression: aComprehension. + + self visitCollection: aComprehension forClauses. + self visitCollection: aComprehension conditions. + self visitEntity: aComprehension body +] + { #category : 'visiting - reordering' } FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ "Reorginizing the order" @@ -168,6 +169,9 @@ FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ (self isInTupleAssignment: anIdentifier) ifTrue: [ ^ self ensureDeclarationOf: anIdentifier named: name declaration: anIdentifier collectionInitializer parentAssignmentLeft ]. + "I could be the declaration of a variable in a for clause used in comprehensions" + (anIdentifier parentForInClauseLeft) ifNotNil: [ :forClause | ^ self ensureDeclarationOf: anIdentifier named: name declaration: forClause ]. + self bind: anIdentifier toDeclarationNamed: name ] From 2d1db5791bce36339743f74977a53f1219049787 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 21 Jul 2026 16:16:13 +0200 Subject: [PATCH 039/151] Manage scoping of list comprehensions --- .../FASTPythonLocalResolverTest.class.st | 39 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 13 ++++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 1329286..63982f4 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -920,6 +920,45 @@ FASTPythonLocalResolverTest >> testVariableInListComprehensions [ self assert: usedVariable equals: declared localDeclaration localUses second ] +{ #category : 'tests - comprehensions' } +FASTPythonLocalResolverTest >> testVariableInListComprehensionsDoesNotLeak [ + "Here the x of the comprehension should not leek outside of it if we consider we are in Python 3" + + | import importedEntity forClause declared usedVariable usedImportedEntity | + self parseAndResolve: 'import x + +fruits = ["apple", "banana", "cherry", "kiwi", "mango"] + +[x for x in fruits] + +print(x)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + forClause := model module statements third forClauses first. + declared := forClause left. + self assert: declared localDeclaration equals: forClause. + self assert: declared localDeclaration left sourceCode equals: 'x'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements third body. + self assert: usedVariable localDeclaration equals: forClause. + self assert: usedVariable equals: declared localDeclaration localUses second +] + { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfFor [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index c5a9728..b717951 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -122,12 +122,15 @@ FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ "Reordering the visit of children to ensure for clauses are visited before the body and conditions since they can refer to it." - self visitFASTPyTSplatExpression: aComprehension. - self visitFASTPyExpression: aComprehension. + "In Python 3, the comprehension has its own scope. In the future we should also manage python 2 that had no scope and could leek its variables." - self visitCollection: aComprehension forClauses. - self visitCollection: aComprehension conditions. - self visitEntity: aComprehension body + self useScope: (FASTPythonLRScope for: aComprehension) during: [ + self visitFASTPyTSplatExpression: aComprehension. + self visitFASTPyExpression: aComprehension. + + self visitCollection: aComprehension forClauses. + self visitCollection: aComprehension conditions. + self visitEntity: aComprehension body ] ] { #category : 'visiting - reordering' } From df60c2199ec6ead4ad9a0a5b7acf660b54f7da4e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 10:39:05 +0200 Subject: [PATCH 040/151] Add a method to know if a local declaration is a variable assignment. It will be used for the SSA --- .../FASTPythonLocalResolverTest.class.st | 1 + src/FAST-Python-Tools/FASTPyAssignment.extension.st | 6 ++++++ src/FAST-Python-Tools/FASTPyEntity.extension.st | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 63982f4..7fba315 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -100,6 +100,7 @@ x'. self assert: assignedVariable localDeclaration equals: assignment. self assert: assignedVariable localDeclaration left name equals: 'x'. self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration isVariableAssignment. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st index 5cd1bda..bbd9b0a 100644 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -1,5 +1,11 @@ Extension { #name : 'FASTPyAssignment' } +{ #category : '*FAST-Python-Tools' } +FASTPyAssignment >> isVariableAssignment [ + + ^ true +] + { #category : '*FAST-Python-Tools' } FASTPyAssignment >> localResolverKind [ diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index e2dcc16..c42e628 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -12,6 +12,13 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> isVariableAssignment [ + "I am used in the SSA builder to know if I represent the assignment of a variable." + + ^ false +] + { #category : '*FAST-Python-Tools' } FASTPyEntity >> localResolverKind [ "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. From 082b78b5819dfaf05221dfd3751e96b7f4801f38 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 15:39:19 +0200 Subject: [PATCH 041/151] Group some classes in the same package tag --- src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st | 4 ++-- src/FAST-Python-Tools/FASTPythonLRScope.class.st | 4 ++-- src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 9608efa..e850dde 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -35,9 +35,9 @@ Class { 'started', 'cfgs' ], - #category : 'FAST-Python-Tools-CFG/DataFlow', + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' + #tag : 'CFG/LocalResolver/SSA' } { #category : 'running' } diff --git a/src/FAST-Python-Tools/FASTPythonLRScope.class.st b/src/FAST-Python-Tools/FASTPythonLRScope.class.st index 46857e3..72628a6 100644 --- a/src/FAST-Python-Tools/FASTPythonLRScope.class.st +++ b/src/FAST-Python-Tools/FASTPythonLRScope.class.st @@ -5,9 +5,9 @@ Class { 'entity', 'nameDictionary' ], - #category : 'FAST-Python-Tools-LocalResolver', + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', - #tag : 'LocalResolver' + #tag : 'CFG/LocalResolver/SSA' } { #category : 'instance creation' } diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index b717951..77cf90e 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -22,9 +22,9 @@ Class { #instVars : [ 'scopes' ], - #category : 'FAST-Python-Tools-LocalResolver', + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', - #tag : 'LocalResolver' + #tag : 'CFG/LocalResolver/SSA' } { #category : 'instance creation' } From 7492ac63e11907795944c17fe6eca6bc52cbf864 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 15:39:51 +0200 Subject: [PATCH 042/151] Add API for SSA building (This will probably move to FAST) --- src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st | 7 +++++++ src/FAST-Python-Tools/FASTPyAssignment.extension.st | 6 ++++++ src/FAST-Python-Tools/FASTPyIdentifier.extension.st | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st create mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st diff --git a/src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st b/src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st new file mode 100644 index 0000000..a4d4d1d --- /dev/null +++ b/src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTNonLocalDeclaration' } + +{ #category : '*FAST-Python-Tools' } +FASTNonLocalDeclaration >> activeVersion [ + + ^ self localUses first activeVersion +] diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st index bbd9b0a..cbc8a8c 100644 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -6,6 +6,12 @@ FASTPyAssignment >> isVariableAssignment [ ^ true ] +{ #category : '*FAST-Python-Tools' } +FASTPyAssignment >> localDeclarationName [ + + ^ left localDeclarationName +] + { #category : '*FAST-Python-Tools' } FASTPyAssignment >> localResolverKind [ diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st new file mode 100644 index 0000000..48726cf --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyIdentifier' } + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> localDeclarationName [ + + ^ self name +] From 6e5f51e9f0f5df37dd35f47509cf2108b3a720bf Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 15:40:16 +0200 Subject: [PATCH 043/151] Init SSA Visitor --- .../FASTPythonSSAVisitor.class.st | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st new file mode 100644 index 0000000..dc53630 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -0,0 +1,74 @@ +Class { + #name : 'FASTPythonSSAVisitor', + #superclass : 'FASTPythonVisitor', + #traits : 'FASTCFGTVisitor', + #classTraits : 'FASTCFGTVisitor classTrait', + #instVars : [ + 'variableVersions' + ], + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #package : 'FAST-Python-Tools', + #tag : 'CFG/LocalResolver/SSA' +} + +{ #category : 'resolving' } +FASTPythonSSAVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ + + | newSSA | + newSSA := FASTVariableVersionSSA for: aFASTEntity. + aFASTEntity localDeclaration activeVersion ifNotNil: [ :lastSSA | newSSA version: lastSSA version ]. + + aFASTEntity localDeclaration activeVersion: newSSA. + + variableVersions add: aFASTEntity localDeclaration. + + ^ newSSA +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ + + aFASTEntity ssaVersion: ((self createVariableVersionFor: aFASTEntity) + newVersionNumber; + yourself) +] + +{ #category : 'initialization' } +FASTPythonSSAVisitor >> initialize [ + + super initialize. + variableVersions := IdentitySet new +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ + + | cfg | + "First we do a local resolution so that each entity are linked to their local declaration" + FASTPythonLocalResolverVisitor resolve: aFASTBehaviouralEntity. + + "Then we build the CFG to know the different paths on the entity" + cfg := aFASTBehaviouralEntity cfg. + + "And lastly, I can build the SSA now that I have the CFG and Local declarations." + self visit: cfg +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ + + self flag: #todo. "Should be moved to the CFG visitor of FAST" + ^ aCFGBlockOrFASTEntity ifNotNil: [ aCFGBlockOrFASTEntity accept: self ] +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ + + anIdentifier localDeclaration isVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ] +] From 0c477d2f1dc9dc88aff42fd6f35e95dfe65f9842 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 15:40:32 +0200 Subject: [PATCH 044/151] Init tests for SSA --- .../FASTPythonSSATest.class.st | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st new file mode 100644 index 0000000..fd23927 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -0,0 +1,32 @@ +Class { + #name : 'FASTPythonSSATest', + #superclass : 'FASTPythonAbstractTestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Tools-Tests-Utilities', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Utilities' +} + +{ #category : 'parsing' } +FASTPythonSSATest >> parseAndResolve: aString [ + + model := self parse: aString. + + FASTPythonSSAVisitor resolve: model module +] + +{ #category : 'tests' } +FASTPythonSSATest >> testSingleAssignement [ + + | assignedVar | + self parseAndResolve: 'x = 5'. + + assignedVar := model module statements first left. + + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + + self assert: assignedVar localDeclaration newVersionNumber equals: 2 +] From 41c1ed819db8ca5c03290463b3926d3c5dc9012b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 16:53:25 +0200 Subject: [PATCH 045/151] Move some methods to FAST + rearrange tags --- .../FASTPythonAbstractTestCase.class.st | 5 +++-- src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st | 5 +++-- .../FASTPythonImporterTest.class.st | 5 +++-- .../FASTPythonLocalResolverTest.class.st | 4 ++-- src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st | 4 ++-- .../FASTNonLocalDeclaration.extension.st | 7 ------- src/FAST-Python-Tools/FASTPyEntity.extension.st | 2 +- src/FAST-Python-Tools/FASTPyIdentifier.extension.st | 7 ------- src/FAST-Python-Tools/FASTTEntity.extension.st | 8 -------- 9 files changed, 14 insertions(+), 33 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st index 72f2c13..07b2367 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st @@ -1,8 +1,9 @@ Class { #name : 'FASTPythonAbstractTestCase', #superclass : 'TestCase', - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Core', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Core' } { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index f27731e..47b8e99 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -4,8 +4,9 @@ Class { #instVars : [ 'startBlock' ], - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' } { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index fcebba6..0b90fbd 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -37,8 +37,9 @@ Dictionary new Class { #name : 'FASTPythonImporterTest', #superclass : 'TSFASTAbstractImporterTest', - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Importer', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Importer' } { #category : 'class initialization' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 7fba315..c9e7d9d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -4,9 +4,9 @@ Class { #instVars : [ 'model' ], - #category : 'FAST-Python-Tools-Tests-Utilities', + #category : 'FAST-Python-Tools-Tests-Algos', #package : 'FAST-Python-Tools-Tests', - #tag : 'Utilities' + #tag : 'Algos' } { #category : 'resolving' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index fd23927..fbfc10c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -4,9 +4,9 @@ Class { #instVars : [ 'model' ], - #category : 'FAST-Python-Tools-Tests-Utilities', + #category : 'FAST-Python-Tools-Tests-Algos', #package : 'FAST-Python-Tools-Tests', - #tag : 'Utilities' + #tag : 'Algos' } { #category : 'parsing' } diff --git a/src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st b/src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st deleted file mode 100644 index a4d4d1d..0000000 --- a/src/FAST-Python-Tools/FASTNonLocalDeclaration.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTNonLocalDeclaration' } - -{ #category : '*FAST-Python-Tools' } -FASTNonLocalDeclaration >> activeVersion [ - - ^ self localUses first activeVersion -] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index c42e628..13e6b8f 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -25,5 +25,5 @@ FASTPyEntity >> localResolverKind [ I am used to know the kind of entity that is been declared." - ^ self subclassResponsibility + ^ self error: 'This entity cannot be a local declaration or is missing the overriding method.' ] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st deleted file mode 100644 index 48726cf..0000000 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTPyIdentifier' } - -{ #category : '*FAST-Python-Tools' } -FASTPyIdentifier >> localDeclarationName [ - - ^ self name -] diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st index b7d1040..622a8a4 100644 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -6,14 +6,6 @@ FASTTEntity >> ensureLocalUses [ self attributeAt: #localUses ifAbsentPut: OrderedCollection new ] -{ #category : '*FAST-Python-Tools' } -FASTTEntity >> hasLocalDeclaration [ - - self attributeAt: #localDeclaration ifAbsent: [ ^ false ]. - - ^ true -] - { #category : '*FAST-Python-Tools' } FASTTEntity >> resetLocalResolution [ From 12431b72e2a539cfde8cddbab4fd54b199bb54ea Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 17:07:06 +0200 Subject: [PATCH 046/151] Start to manage usage of assigned variables when there is no condition --- .../FASTPythonSSATest.class.st | 19 +++++++++++++++++-- .../FASTPythonSSAVisitor.class.st | 2 +- .../FASTTEntity.extension.st | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index fbfc10c..64a3fa9 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -17,16 +17,31 @@ FASTPythonSSATest >> parseAndResolve: aString [ FASTPythonSSAVisitor resolve: model module ] -{ #category : 'tests' } +{ #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ | assignedVar | self parseAndResolve: 'x = 5'. assignedVar := model module statements first left. - self assert: assignedVar ssaVersion version equals: 1. self assert: assignedVar ssaName equals: 'x_1'. self assert: assignedVar localDeclaration newVersionNumber equals: 2 ] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testSingleAssignementAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 5 + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + + usedVar := model module statements second arguments first. + self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion +] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index dc53630..d898ace 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -70,5 +70,5 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - anIdentifier localDeclaration isVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ] + anIdentifier withLocalDeclarationDo: [ :declaration | declaration isVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ] ] ] diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st index 622a8a4..73d34ea 100644 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -12,3 +12,17 @@ FASTTEntity >> resetLocalResolution [ self removeAttribute: #localDeclaration. self removeAttribute: #localUses ] + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> withLocalDeclarationDo: aBlock [ + "Used for LocalResolver" + + | declaration | + self flag: #todo. "Move to FAST" + declaration := self attributeAt: #localDeclaration. + + "Do nothing on non local declaration." + declaration isNonLocalDeclaration ifTrue: [ ^ nil ]. + + ^ aBlock cull: declaration +] From 36ec0650f18cac834103c5ed4d979ed98b63ff25 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 17:53:45 +0200 Subject: [PATCH 047/151] Manage undeclared var usage --- src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 64a3fa9..9509c95 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -45,3 +45,13 @@ print(x)'. usedVar := model module statements second arguments first. self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion ] + +{ #category : 'tests - non local declarations' } +FASTPythonSSATest >> testUndeclaredVariable [ + + | undeclared | + self parseAndResolve: 'print(x)'. + + undeclared := model module statements first arguments first. + self assert: undeclared ssaVersion isNil +] From 8f0ee7094abf4e8652712f29dcb1331140f3e17c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 18:30:41 +0200 Subject: [PATCH 048/151] Avoid names that can be confusing --- .../FASTPythonLocalResolverTest.class.st | 2 +- src/FAST-Python-Tools/FASTPyAssignment.extension.st | 2 +- src/FAST-Python-Tools/FASTPyEntity.extension.st | 2 +- src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index c9e7d9d..19abf15 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -100,7 +100,7 @@ x'. self assert: assignedVariable localDeclaration equals: assignment. self assert: assignedVariable localDeclaration left name equals: 'x'. self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration isVariableAssignment. + self assert: assignedVariable localDeclaration isSSAVariableAssignment. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st index cbc8a8c..1fef780 100644 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -1,7 +1,7 @@ Extension { #name : 'FASTPyAssignment' } { #category : '*FAST-Python-Tools' } -FASTPyAssignment >> isVariableAssignment [ +FASTPyAssignment >> isSSAVariableAssignment [ ^ true ] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 13e6b8f..2b42dc7 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -13,7 +13,7 @@ FASTPyEntity >> fullCfg [ ] { #category : '*FAST-Python-Tools' } -FASTPyEntity >> isVariableAssignment [ +FASTPyEntity >> isSSAVariableAssignment [ "I am used in the SSA builder to know if I represent the assignment of a variable." ^ false diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index d898ace..eccd0fd 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -70,5 +70,5 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - anIdentifier withLocalDeclarationDo: [ :declaration | declaration isVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ] ] + anIdentifier withLocalDeclarationDo: [ :declaration | declaration isSSAVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ] ] ] From 099637dbb30cde279968b85cb30c563c60a6d605 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 18:31:48 +0200 Subject: [PATCH 049/151] Fix bug causing too many creation of SSAVariable --- src/FAST-Python-Model/FASTPyIdentifier.class.st | 10 ++++++++++ src/FAST-Python-Tools/FASTPyAssignment.extension.st | 6 ------ src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 949880f..198f0b3 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -38,3 +38,13 @@ FASTPyIdentifier class >> annotation [ ] + +{ #category : 'testing' } +FASTPyIdentifier >> isSSAVariableAssignment [ + "Checking my parents to know if I'm a variable been assigned." + + "If I'm the left side of an assignment then I'm an assigned variable." + self parentAssignmentLeft ifNotNil: [ ^ true ]. + + ^ super isSSAVariableAssignment +] diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st index 1fef780..de4a9f3 100644 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -1,11 +1,5 @@ Extension { #name : 'FASTPyAssignment' } -{ #category : '*FAST-Python-Tools' } -FASTPyAssignment >> isSSAVariableAssignment [ - - ^ true -] - { #category : '*FAST-Python-Tools' } FASTPyAssignment >> localDeclarationName [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index eccd0fd..a4028d8 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -70,5 +70,7 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - anIdentifier withLocalDeclarationDo: [ :declaration | declaration isSSAVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ] ] + anIdentifier isSSAVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ]. + + super visitFASTPyIdentifier: anIdentifier ] From c230c7c2b2bf9a99ef9ff3fc0c2deff9759eb334 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 29 Jul 2026 18:32:11 +0200 Subject: [PATCH 050/151] Begin to manage parameters --- .../FASTPythonSSATest.class.st | 15 +++++++++++++++ .../FASTPyParameter.extension.st | 6 ++++++ .../FASTPythonSSAVisitor.class.st | 9 +++++++++ 3 files changed, 30 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 9509c95..abc7726 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -17,6 +17,21 @@ FASTPythonSSATest >> parseAndResolve: aString [ FASTPythonSSAVisitor resolve: model module ] +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def func(x): + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + + parameterUsage := model module statements first statements first arguments first. + self assert: parameterDeclaration ssaVersion identicalTo: parameterDeclaration ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st index cc97ca3..48cd1c4 100644 --- a/src/FAST-Python-Tools/FASTPyParameter.extension.st +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -1,5 +1,11 @@ Extension { #name : 'FASTPyParameter' } +{ #category : '*FAST-Python-Tools' } +FASTPyParameter >> isSSAVariableAssignment [ + + ^ true +] + { #category : '*FAST-Python-Tools' } FASTPyParameter >> localResolverKind [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index a4028d8..180d44e 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -74,3 +74,12 @@ FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ super visitFASTPyIdentifier: anIdentifier ] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ + "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" + + aParameter localDeclaration isSSAVariableAssignment ifTrue: [ self handleNewAssignemntTo: aParameter ]. + + super visitFASTPyParameter: aParameter +] From 8ddacd70780745919fc24959f445e8ce2eaa6ebe Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 10:32:57 +0200 Subject: [PATCH 051/151] Add tests to ensure parameters knows they are declarations --- .../FASTPythonLocalResolverTest.class.st | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 19abf15..6e7b150 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -99,8 +99,8 @@ x'. assignedVariable := assignment left. self assert: assignedVariable localDeclaration equals: assignment. self assert: assignedVariable localDeclaration left name equals: 'x'. + self assert: assignedVariable localDeclaration left isSSAVariableAssignment. self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration isSSAVariableAssignment. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. @@ -228,6 +228,7 @@ FASTPythonLocalResolverTest >> testFunctionParameter [ declaration := model module statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isSSAVariableAssignment. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -247,6 +248,7 @@ FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ declaration := model module statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isSSAVariableAssignment. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -678,6 +680,7 @@ FASTPythonLocalResolverTest >> testLambdaParameter [ declaration := model module statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isSSAVariableAssignment. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. From 39ba4e0aec54ade9e4058061e1c53adaa5a6afc9 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 14:41:45 +0200 Subject: [PATCH 052/151] Fix bug in local resolutions of method parameters --- .../FASTPythonLocalResolverTest.class.st | 42 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 7 ++++ 2 files changed, 49 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 6e7b150..1487b67 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -713,6 +713,48 @@ print(f())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testMethodSelfParameter [ + + | declaration usedVariable | + self parseAndResolve: 'class C: + def meth(self): + return self'. + + declaration := model module statements first statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'self'. + self assert: declaration localDeclaration isSSAVariableAssignment. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ + + | declaration usedVariable | + self parseAndResolve: 'class C: + def meth(this): + return this'. + + declaration := model module statements first statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'this'. + self assert: declaration localDeclaration isSSAVariableAssignment. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + { #category : 'tests - non local declarations' } FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 77cf90e..389df2f 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -192,6 +192,13 @@ FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ super visitFASTPyImport: anImport ] +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ + "We resolve in the same way as functions." + + self visitFASTPyFunctionDefinition: aMethodDefinition +] + { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ From 9af81bfe25bd0c8c8fc7e097292f1f960e2d011a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 14:43:51 +0200 Subject: [PATCH 053/151] Add rule to avoid inconsistant classification violations since I categorize visit methods in different visit protocols for organization --- .../ManifestFASTPythonTools.class.st | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/FAST-Python-Tools/ManifestFASTPythonTools.class.st diff --git a/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st new file mode 100644 index 0000000..775889d --- /dev/null +++ b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st @@ -0,0 +1,17 @@ +" +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 : 'ManifestFASTPythonTools', + #superclass : 'PackageManifest', + #category : 'FAST-Python-Tools-Manifest', + #package : 'FAST-Python-Tools', + #tag : 'Manifest' +} + +{ #category : 'code-critics' } +ManifestFASTPythonTools class >> ruleInconsistentMethodClassificationRuleV1FalsePositive [ + + + ^ #(#(#(#RGClassDefinition #(#FASTPythonLocalResolverVisitor)) #'2026-07-30T14:41:37.271103+02:00') ) +] From bf882940920ac9ed80a74c462ecaa1cb3b43b35a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 14:51:38 +0200 Subject: [PATCH 054/151] Fix bug in method redefining another method --- .../FASTPythonLocalResolverTest.class.st | 23 +++++++++++++++++++ .../FASTPyMethodDefinition.extension.st | 7 ++++++ 2 files changed, 30 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 1487b67..e3d37c8 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -713,6 +713,29 @@ print(f())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - methods' } +FASTPythonLocalResolverTest >> testMethodRedefined [ + + | declaration1 declaration2 | + self parseAndResolve: 'class C: + def meth(self): + return self + + def meth(self): + return self'. + + declaration1 := model module statements first statements first. + self assert: declaration1 localDeclaration equals: declaration1. + self assert: declaration1 localDeclaration name equals: 'meth'. + self deny: declaration1 localDeclaration isNonLocalDeclaration. + self assert: declaration1 localDeclaration localUses size equals: 2. + self assert: declaration1 localDeclaration localUses first equals: declaration1. + + declaration2 := model module statements first statements second. + self assert: declaration2 localDeclaration equals: declaration1. + self assert: declaration1 localDeclaration localUses second equals: declaration2 +] + { #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testMethodSelfParameter [ diff --git a/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st new file mode 100644 index 0000000..3e8ae44 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyMethodDefinition' } + +{ #category : '*FAST-Python-Tools' } +FASTPyMethodDefinition >> localResolverKind [ + + ^ #method +] From 27f7ed55e0a81a808d5eb82cd8a88e142b4b5319 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 15:29:37 +0200 Subject: [PATCH 055/151] Add test ensuring the variable of a for can be redeclared in the local resolver The SSA fails on this piece of code. So this proves it's not relatded to the local resoler --- .../FASTPythonLocalResolverTest.class.st | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index e3d37c8..7ab0b07 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1074,6 +1074,26 @@ for x in range(5): self assert: usedVariable equals: usedVariable localDeclaration localUses third ] +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForRedefinedInside [ + + | for declared usedVariable | + self parseAndResolve: 'for x in range(5): + x += 1'. + + for := model module statements first. + declared := for left. + self assert: declared localDeclaration equals: for. + self assert: declared localDeclaration left sourceCode equals: 'x'. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := for statements first left. + self assert: usedVariable localDeclaration equals: for. + self assert: usedVariable equals: declared localDeclaration localUses second +] + { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ From d4c1efd64a0777f38a397c842e6421676715c62e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 16:13:19 +0200 Subject: [PATCH 056/151] Cleanup dead code --- src/FAST-Python-Tools/FASTTEntity.extension.st | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st index 73d34ea..622a8a4 100644 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -12,17 +12,3 @@ FASTTEntity >> resetLocalResolution [ self removeAttribute: #localDeclaration. self removeAttribute: #localUses ] - -{ #category : '*FAST-Python-Tools' } -FASTTEntity >> withLocalDeclarationDo: aBlock [ - "Used for LocalResolver" - - | declaration | - self flag: #todo. "Move to FAST" - declaration := self attributeAt: #localDeclaration. - - "Do nothing on non local declaration." - declaration isNonLocalDeclaration ifTrue: [ ^ nil ]. - - ^ aBlock cull: declaration -] From 170add2364c3b8d045bfd7c1dc83ad3174cde88c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 16:13:56 +0200 Subject: [PATCH 057/151] Variables declared in for should know they are a variable assignment --- src/FAST-Python-Model/FASTPyIdentifier.class.st | 3 +++ .../FASTPythonLocalResolverTest.class.st | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 198f0b3..a508d28 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -45,6 +45,9 @@ FASTPyIdentifier >> isSSAVariableAssignment [ "If I'm the left side of an assignment then I'm an assigned variable." self parentAssignmentLeft ifNotNil: [ ^ true ]. + + "Variable declared in a foreach." + self parentForStatementLeft ifNotNil: [ ^ true ]. ^ super isSSAVariableAssignment ] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 7ab0b07..e151331 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -937,6 +937,7 @@ print(i)'. declared := assignement left. self assert: declared localDeclaration equals: assignement. self assert: declared localDeclaration left sourceCode equals: 'i'. + self assert: declared localDeclaration left isSSAVariableAssignment. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. @@ -1039,6 +1040,7 @@ FASTPythonLocalResolverTest >> testVariableOfFor [ declared := for left. self assert: declared localDeclaration equals: for. self assert: declared localDeclaration left sourceCode equals: 'x'. + self assert: declared localDeclaration left isSSAVariableAssignment. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. From 56fe964e08dc5adf9c0a1e059a36b1203a856f97 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 16:17:43 +0200 Subject: [PATCH 058/151] SSA: Fixing declaration of variables in for --- .../FASTPythonSSATest.class.st | 15 +++++++++++++++ .../FASTPyForStatement.extension.st | 6 ++++++ .../FASTPyIdentifier.extension.st | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index abc7726..46e451e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -17,6 +17,21 @@ FASTPythonSSATest >> parseAndResolve: aString [ FASTPythonSSAVisitor resolve: model module ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariableUsed [ + + | assignedVar usedVar | + self parseAndResolve: 'for x in range(5): + print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + + usedVar := model module statements first statements first arguments first. + self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - parameters' } FASTPythonSSATest >> testParameterUsed [ diff --git a/src/FAST-Python-Tools/FASTPyForStatement.extension.st b/src/FAST-Python-Tools/FASTPyForStatement.extension.st index e14bf85..46cf5fd 100644 --- a/src/FAST-Python-Tools/FASTPyForStatement.extension.st +++ b/src/FAST-Python-Tools/FASTPyForStatement.extension.st @@ -1,5 +1,11 @@ Extension { #name : 'FASTPyForStatement' } +{ #category : '*FAST-Python-Tools' } +FASTPyForStatement >> localDeclarationName [ + + ^ left localDeclarationName +] + { #category : '*FAST-Python-Tools' } FASTPyForStatement >> localResolverKind [ diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st new file mode 100644 index 0000000..2c28167 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'FASTPyIdentifier' } + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> localDeclarationName [ + ^ self sourceCode +] From a50bce2f5dfbdc1e0f108135c4f68ce501f0c450 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 17:32:24 +0200 Subject: [PATCH 059/151] Rename method to make it more generic between LR and SSA --- src/FAST-Python-Model/FASTPyIdentifier.class.st | 4 ++-- .../FASTPythonLocalResolverTest.class.st | 16 ++++++++-------- src/FAST-Python-Tools/FASTPyEntity.extension.st | 2 +- .../FASTPyParameter.extension.st | 2 +- .../FASTPythonSSAVisitor.class.st | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index a508d28..ea65af6 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -40,7 +40,7 @@ FASTPyIdentifier class >> annotation [ ] { #category : 'testing' } -FASTPyIdentifier >> isSSAVariableAssignment [ +FASTPyIdentifier >> isVariableWriteAccess [ "Checking my parents to know if I'm a variable been assigned." "If I'm the left side of an assignment then I'm an assigned variable." @@ -49,5 +49,5 @@ FASTPyIdentifier >> isSSAVariableAssignment [ "Variable declared in a foreach." self parentForStatementLeft ifNotNil: [ ^ true ]. - ^ super isSSAVariableAssignment + ^ super isVariableWriteAccess ] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index e151331..6283d28 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -99,7 +99,7 @@ x'. assignedVariable := assignment left. self assert: assignedVariable localDeclaration equals: assignment. self assert: assignedVariable localDeclaration left name equals: 'x'. - self assert: assignedVariable localDeclaration left isSSAVariableAssignment. + self assert: assignedVariable localDeclaration left isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. @@ -228,7 +228,7 @@ FASTPythonLocalResolverTest >> testFunctionParameter [ declaration := model module statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'y'. - self assert: declaration localDeclaration isSSAVariableAssignment. + self assert: declaration localDeclaration isVariableWriteAccess. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -248,7 +248,7 @@ FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ declaration := model module statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'y'. - self assert: declaration localDeclaration isSSAVariableAssignment. + self assert: declaration localDeclaration isVariableWriteAccess. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -680,7 +680,7 @@ FASTPythonLocalResolverTest >> testLambdaParameter [ declaration := model module statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'y'. - self assert: declaration localDeclaration isSSAVariableAssignment. + self assert: declaration localDeclaration isVariableWriteAccess. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -747,7 +747,7 @@ FASTPythonLocalResolverTest >> testMethodSelfParameter [ declaration := model module statements first statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'self'. - self assert: declaration localDeclaration isSSAVariableAssignment. + self assert: declaration localDeclaration isVariableWriteAccess. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -768,7 +768,7 @@ FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ declaration := model module statements first statements first parameters first. self assert: declaration localDeclaration equals: declaration. self assert: declaration localDeclaration name equals: 'this'. - self assert: declaration localDeclaration isSSAVariableAssignment. + self assert: declaration localDeclaration isVariableWriteAccess. self deny: declaration localDeclaration isNonLocalDeclaration. self assert: declaration localDeclaration localUses size equals: 2. self assert: declaration localDeclaration localUses first equals: declaration. @@ -937,7 +937,7 @@ print(i)'. declared := assignement left. self assert: declared localDeclaration equals: assignement. self assert: declared localDeclaration left sourceCode equals: 'i'. - self assert: declared localDeclaration left isSSAVariableAssignment. + self assert: declared localDeclaration left isVariableWriteAccess. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. @@ -1040,7 +1040,7 @@ FASTPythonLocalResolverTest >> testVariableOfFor [ declared := for left. self assert: declared localDeclaration equals: for. self assert: declared localDeclaration left sourceCode equals: 'x'. - self assert: declared localDeclaration left isSSAVariableAssignment. + self assert: declared localDeclaration left isVariableWriteAccess. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 2b42dc7..7d76e1f 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -13,7 +13,7 @@ FASTPyEntity >> fullCfg [ ] { #category : '*FAST-Python-Tools' } -FASTPyEntity >> isSSAVariableAssignment [ +FASTPyEntity >> isVariableWriteAccess [ "I am used in the SSA builder to know if I represent the assignment of a variable." ^ false diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st index 48cd1c4..996ef6b 100644 --- a/src/FAST-Python-Tools/FASTPyParameter.extension.st +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -1,7 +1,7 @@ Extension { #name : 'FASTPyParameter' } { #category : '*FAST-Python-Tools' } -FASTPyParameter >> isSSAVariableAssignment [ +FASTPyParameter >> isVariableWriteAccess [ ^ true ] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 180d44e..496fd13 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -70,7 +70,7 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - anIdentifier isSSAVariableAssignment ifTrue: [ self handleNewAssignemntTo: anIdentifier ]. + anIdentifier isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: anIdentifier ]. super visitFASTPyIdentifier: anIdentifier ] @@ -79,7 +79,7 @@ FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" - aParameter localDeclaration isSSAVariableAssignment ifTrue: [ self handleNewAssignemntTo: aParameter ]. + aParameter localDeclaration isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: aParameter ]. super visitFASTPyParameter: aParameter ] From 491bcf7fcee5f32eff1003a621d544c95b476937 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 17:33:56 +0200 Subject: [PATCH 060/151] Improve implementation of #isVariableWriteAccess Now it relies on checking for the variable declarator node which will be used later in the LR --- .../FASTPyIdentifier.class.st | 21 ++++++++++++------- .../FASTPyEntity.extension.st | 14 +++++++++++-- .../FASTPyParameter.extension.st | 9 ++++---- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index ea65af6..fe0de1a 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -40,14 +40,19 @@ FASTPyIdentifier class >> annotation [ ] { #category : 'testing' } -FASTPyIdentifier >> isVariableWriteAccess [ - "Checking my parents to know if I'm a variable been assigned." +FASTPyIdentifier >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." - "If I'm the left side of an assignment then I'm an assigned variable." - self parentAssignmentLeft ifNotNil: [ ^ true ]. - - "Variable declared in a foreach." - self parentForStatementLeft ifNotNil: [ ^ true ]. + | node | + "In case I'm in a tuple, I should do the checks for the tuple instead of me." + node := self. + self collectionInitializer ifNotNil: [ :collection | collection isTuple ifTrue: [ node := collection ] ]. - ^ super isVariableWriteAccess + node parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + node parentForStatementLeft ifNotNil: [ :for | ^ for ]. + + node parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. + + ^ super variableDeclarator ] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 7d76e1f..82b79af 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -14,9 +14,9 @@ FASTPyEntity >> fullCfg [ { #category : '*FAST-Python-Tools' } FASTPyEntity >> isVariableWriteAccess [ - "I am used in the SSA builder to know if I represent the assignment of a variable." + "I am used in the LR and SSA builder to know if I represent the assignment of a variable." - ^ false + ^ self variableDeclarator isNotNil ] { #category : '*FAST-Python-Tools' } @@ -27,3 +27,13 @@ FASTPyEntity >> localResolverKind [ ^ self error: 'This entity cannot be a local declaration or is missing the overriding method.' ] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> variableDeclarator [ + "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. + Nodes representing potential variable write access should override me. + + I am used by the LocalResolver and potentially SSA" + + ^ nil +] diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st index 996ef6b..2ecef63 100644 --- a/src/FAST-Python-Tools/FASTPyParameter.extension.st +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -1,13 +1,14 @@ Extension { #name : 'FASTPyParameter' } { #category : '*FAST-Python-Tools' } -FASTPyParameter >> isVariableWriteAccess [ +FASTPyParameter >> localResolverKind [ - ^ true + ^ #parameter ] { #category : '*FAST-Python-Tools' } -FASTPyParameter >> localResolverKind [ +FASTPyParameter >> variableDeclarator [ + "For parameters, they are their own declarator." - ^ #parameter + ^ self ] From 79f12937fca901ae4446262208e13dc3ed9182c6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 17:34:43 +0200 Subject: [PATCH 061/151] LR: Manage tuple declaration in the left field of foreach --- .../FASTPythonLocalResolverTest.class.st | 32 ++++++++++++++++++- .../FASTPythonLocalResolverVisitor.class.st | 29 ++--------------- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 6283d28..37880f7 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -879,7 +879,7 @@ print(x)'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] -{ #category : 'tests' } +{ #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ | assignment assignedVariable usedVariable | @@ -1118,6 +1118,36 @@ print(x)'. self assert: usedVariable equals: usedVariable localDeclaration localUses second ] +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForWithTuple [ + + | for declaredA usedVariableA declaredB usedVariableB | + self parseAndResolve: 'for a, b in arg: + print(a, b)'. + + for := model module statements first. + declaredA := for left initializers first. + self assert: declaredA localDeclaration equals: for. + self assert: declaredA localDeclaration left sourceCode equals: 'a, b'. + self assert: declaredA localDeclaration left initializers first isVariableWriteAccess. + self assert: declaredA localDeclaration left initializers second isVariableWriteAccess. + self deny: declaredA localDeclaration isNonLocalDeclaration. + self assert: declaredA localDeclaration localUses size equals: 4. + self assert: declaredA localDeclaration localUses first equals: declaredA. + + declaredB := for left initializers second. + self assert: declaredB localDeclaration equals: for. + self assert: declaredB localDeclaration localUses second equals: declaredB. + + usedVariableA := for statements first arguments first. + self assert: usedVariableA localDeclaration equals: for. + self assert: usedVariableA equals: declaredA localDeclaration localUses third. + + usedVariableB := for statements first arguments second. + self assert: usedVariableB localDeclaration equals: for. + self assert: usedVariableB equals: declaredB localDeclaration localUses fourth +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 389df2f..a2b9b78 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -67,19 +67,6 @@ FASTPythonLocalResolverVisitor >> initialize [ scopes := Stack new ] -{ #category : 'testing' } -FASTPythonLocalResolverVisitor >> isInTupleAssignment: anIdentifier [ - "I return true if my parent is a tuple on the left side of an assignment" - - anIdentifier collectionInitializer ifNil: [ ^ false ]. - - anIdentifier collectionInitializer isTuple ifFalse: [ ^ false ]. - - anIdentifier collectionInitializer parentAssignmentLeft ifNil: [ ^ false ]. - - ^ true -] - { #category : 'initialization' } FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ @@ -162,20 +149,10 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - | name | - name := anIdentifier sourceCode. - - "I define a variable in a for statement. Thus I need to create a new declaration" - anIdentifier parentForStatementLeft ifNotNil: [ :forStatement | ^ self ensureDeclarationOf: anIdentifier named: name declaration: forStatement ]. - - "If I am in a tuple that is on the left side of an assignement, then I must declare a new variable" - (self isInTupleAssignment: anIdentifier) ifTrue: [ - ^ self ensureDeclarationOf: anIdentifier named: name declaration: anIdentifier collectionInitializer parentAssignmentLeft ]. - - "I could be the declaration of a variable in a for clause used in comprehensions" - (anIdentifier parentForInClauseLeft) ifNotNil: [ :forClause | ^ self ensureDeclarationOf: anIdentifier named: name declaration: forClause ]. + anIdentifier isVariableWriteAccess ifTrue: [ + ^ self ensureDeclarationOf: anIdentifier named: anIdentifier sourceCode declaration: anIdentifier variableDeclarator ]. - self bind: anIdentifier toDeclarationNamed: name + self bind: anIdentifier toDeclarationNamed: anIdentifier sourceCode ] { #category : 'visiting' } From 0f30e13815782a27b3534cb2c6bae2272d18ae22 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 17:40:01 +0200 Subject: [PATCH 062/151] Make identifier a TNamedEntity --- .../FASTPythonMetamodelGenerator.class.st | 1 + .../FASTPyIdentifier.class.st | 13 +- src/FAST-Python-Model/FASTPyTVisitor.trait.st | 5 +- .../FASTPythonImporterTest.class.st | 2232 +++++++++++++---- .../FASTPythonTreeSitterVisitor.class.st | 15 +- 5 files changed, 1802 insertions(+), 464 deletions(-) diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index cf710dd..c8de6d7 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -488,6 +488,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ identifier --|> tReturnReferenceable. identifier --|> tAsPatternTarget. identifier --|> tSplatParameterTarget. + identifier --|> tNamedEntity. ifClause --|> expression. "This is wrong! I am just here temporarily until we rework the relation to the for in clause (I need to be able to be a clause of a list comprehension)" diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index fe0de1a..fc3dcf0 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -6,6 +6,7 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `caller` | `FASTPyTCallable` | `callee` | `FASTPyCall` | The call entity calling me (if it's the case)| +| `invokedIn` | `FASTTNamedEntity` | `invoked` | `FASTTInvocation` | Optional invocation where this name is used| | `parentAsPatternSource` | `FASTPyTAsPatternSource` | `source` | `FASTPyAsPattern` | | | `parentAsPatternTarget` | `FASTPyTAsPatternTarget` | `target` | `FASTPyAsPattern` | | | `parentAssignmentLeft` | `FASTPyTAssignable` | `left` | `FASTPyAssignment` | | @@ -19,13 +20,21 @@ | `parentSplatParameter` | `FASTPyTSplatParameterTarget` | `target` | `FASTPySplatParameter` | | +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `name` | `String` | nil | | +| `startPos` | `Number` | nil | | " Class { #name : 'FASTPyIdentifier', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 6eece1e..12d25dc 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -491,6 +491,7 @@ FASTPyTVisitor >> visitFASTPyIdentifier: anIdentifier [ self visitFASTPyTAsPatternTarget: anIdentifier. self visitFASTPyTReturnReferenceable: anIdentifier. self visitFASTPyTSplatParameterTarget: anIdentifier. + self visitFASTTNamedEntity: anIdentifier. self visitFASTPyExpression: anIdentifier ] @@ -1295,7 +1296,9 @@ FASTPyTVisitor >> visitFASTTStringLiteral: aTStringLiteral [ FASTPyTVisitor >> visitFASTTVariableEntity: aTVariableEntity [ - self visitFASTTNamedEntity: aTVariableEntity. + "We do not visit all behaviorals because some classes already visit it in their superclasses in this language implementation. Visiting them here also would cause a double visit of this trait." + ({ FASTPyVariable } includes: aTVariableEntity class) + ifFalse: [ self visitFASTTNamedEntity: aTVariableEntity ]. ] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index 0b90fbd..4be1b1e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -125,6 +125,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -142,6 +143,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'container'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'container'. stack pop. stack pop. stack pop. @@ -197,6 +199,7 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -213,11 +216,13 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'reader'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'reader'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'writer'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'writer'. stack pop. stack pop. stack pop. @@ -271,6 +276,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -280,6 +286,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -333,6 +340,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -342,6 +350,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -385,6 +394,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation target" @@ -393,6 +403,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -444,6 +455,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation value" @@ -452,6 +464,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -461,6 +474,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -516,6 +530,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -559,6 +574,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'targets'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'targets'. stack pop. stack pop. stack pop. @@ -615,6 +631,7 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -631,11 +648,13 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'g'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'g'. stack pop. stack pop. stack pop. @@ -711,6 +730,7 @@ FASTPythonImporterTest >> testAssertStatement [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack push: (stack top operands at: 2). @@ -843,6 +863,7 @@ FASTPythonImporterTest >> testAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -887,6 +908,7 @@ FASTPythonImporterTest >> testAssignmentInList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote'. stack pop. stack pop. @@ -931,11 +953,13 @@ FASTPythonImporterTest >> testAssignmentInPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1001,11 +1025,13 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'j'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'j'. stack pop. stack pop. @@ -1015,6 +1041,7 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst'. stack pop. stack pop. @@ -1023,7 +1050,8 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'seq'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'seq' ] { #category : 'tests - assignments' } @@ -1067,6 +1095,7 @@ FASTPythonImporterTest >> testAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'variables'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'variables'. stack pop. stack pop. @@ -1110,11 +1139,13 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1123,7 +1154,8 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1167,7 +1199,8 @@ FASTPythonImporterTest >> testAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1269,6 +1302,7 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -1277,7 +1311,8 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - assignments' } @@ -1322,7 +1357,8 @@ FASTPythonImporterTest >> testAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -1469,6 +1505,7 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -1476,7 +1513,8 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1684,7 +1722,8 @@ FASTPythonImporterTest >> testAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -1767,6 +1806,7 @@ FASTPythonImporterTest >> testAssignmentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -1819,7 +1859,8 @@ FASTPythonImporterTest >> testAssignmentToList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - assignments' } @@ -1866,6 +1907,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -1881,6 +1923,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -1907,7 +1950,8 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -1987,7 +2031,8 @@ FASTPythonImporterTest >> testAssignmentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - assignments' } @@ -2031,11 +2076,13 @@ FASTPythonImporterTest >> testAssignmentToPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -2127,6 +2174,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -2142,6 +2190,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -2168,7 +2217,8 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -2259,7 +2309,8 @@ FASTPythonImporterTest >> testAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -2443,7 +2494,8 @@ FASTPythonImporterTest >> testAssignmentType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - accesses' } @@ -2468,7 +2520,8 @@ FASTPythonImporterTest >> testAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - accesses' } @@ -2501,7 +2554,8 @@ FASTPythonImporterTest >> testAttributeAccessNested [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -2534,7 +2588,8 @@ FASTPythonImporterTest >> testAttributeAccessOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2616,6 +2671,7 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -2624,7 +2680,8 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - attributes' } @@ -2659,7 +2716,8 @@ FASTPythonImporterTest >> testAttributeAccessOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -2776,6 +2834,7 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -2783,7 +2842,8 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2879,6 +2939,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -2887,6 +2948,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -2903,6 +2965,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -2910,7 +2973,8 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2989,7 +3053,8 @@ FASTPythonImporterTest >> testAttributeAccessOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -3022,7 +3087,8 @@ FASTPythonImporterTest >> testAttributeAccessOnList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - attributes' } @@ -3059,6 +3125,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3074,6 +3141,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3100,7 +3168,8 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - attributes' } @@ -3160,7 +3229,8 @@ FASTPythonImporterTest >> testAttributeAccessOnNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - attributes' } @@ -3232,6 +3302,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3247,6 +3318,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3273,7 +3345,8 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - attributes' } @@ -3344,7 +3417,8 @@ FASTPythonImporterTest >> testAttributeAccessOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - attributes' } @@ -3405,11 +3479,13 @@ FASTPythonImporterTest >> testAttributeAccessOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - attributes' } @@ -3472,7 +3548,8 @@ FASTPythonImporterTest >> testAttributeAccessWithReceiverParenthesised [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -3507,6 +3584,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3600,6 +3678,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3645,11 +3724,13 @@ FASTPythonImporterTest >> testAugmentedAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3706,7 +3787,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -3810,7 +3892,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -3905,6 +3988,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -3912,7 +3996,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -3986,7 +4071,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -4079,7 +4165,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -4152,7 +4239,8 @@ FASTPythonImporterTest >> testAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'future'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'future' ] { #category : 'tests - await' } @@ -4188,6 +4276,7 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4196,7 +4285,8 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4231,6 +4321,7 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4239,7 +4330,8 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4275,6 +4367,7 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -4283,7 +4376,8 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4330,6 +4424,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4338,6 +4433,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4346,7 +4442,8 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4373,6 +4470,7 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -4380,7 +4478,8 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4426,6 +4525,7 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4434,7 +4534,8 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - operators' } @@ -4514,6 +4615,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4531,7 +4633,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -4643,6 +4746,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -4660,6 +4764,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4669,6 +4774,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4679,7 +4785,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -4715,6 +4822,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4733,7 +4841,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -4890,6 +4999,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4906,6 +5016,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4915,6 +5026,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4924,7 +5036,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -5057,6 +5170,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5065,6 +5179,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5081,6 +5196,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5089,6 +5205,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -5114,6 +5231,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5122,6 +5240,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5138,6 +5257,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5145,7 +5265,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -5247,6 +5368,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: '+'. @@ -5255,7 +5377,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -5327,6 +5450,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5343,7 +5467,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - operators' } @@ -5380,6 +5505,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5395,6 +5521,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5422,6 +5549,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5441,6 +5569,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5456,6 +5585,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5482,7 +5612,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - operators' } @@ -5517,6 +5648,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: ') + ('. @@ -5534,7 +5666,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -5625,6 +5758,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5640,6 +5774,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5667,6 +5802,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5686,6 +5822,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5701,6 +5838,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5727,7 +5865,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - operators' } @@ -5810,6 +5949,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5836,7 +5976,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -5908,11 +6049,13 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5930,11 +6073,13 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - operators' } @@ -6111,6 +6256,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6128,7 +6274,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -6163,6 +6310,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6172,6 +6320,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6190,6 +6339,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6198,7 +6348,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -6240,6 +6391,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6249,6 +6401,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6259,6 +6412,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6268,7 +6422,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -6304,6 +6459,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6322,7 +6478,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -6487,6 +6644,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -6503,6 +6661,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6512,6 +6671,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -6521,7 +6681,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -6713,6 +6874,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6721,7 +6883,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -6828,6 +6991,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6845,7 +7009,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -6982,6 +7147,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7008,7 +7174,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -7080,11 +7247,13 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7102,11 +7271,13 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - operators' } @@ -7242,6 +7413,7 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7250,7 +7422,8 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7285,6 +7458,7 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7293,7 +7467,8 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7341,6 +7516,7 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7349,7 +7525,8 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7385,6 +7562,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -7394,6 +7572,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -7402,7 +7581,8 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7438,6 +7618,7 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -7446,7 +7627,8 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7481,11 +7663,13 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -7495,7 +7679,8 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7532,7 +7717,8 @@ FASTPythonImporterTest >> testCalWithArgumentComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7579,6 +7765,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -7587,6 +7774,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7595,7 +7783,8 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7649,6 +7838,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -7658,7 +7848,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7702,6 +7893,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -7710,6 +7902,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7726,6 +7919,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -7734,6 +7928,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -7743,7 +7938,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7778,6 +7974,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -7786,7 +7983,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7822,7 +8020,8 @@ FASTPythonImporterTest >> testCalWithArgumentEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7859,7 +8058,8 @@ FASTPythonImporterTest >> testCalWithArgumentFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7896,7 +8096,8 @@ FASTPythonImporterTest >> testCalWithArgumentFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7923,6 +8124,7 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -7930,7 +8132,8 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7967,7 +8170,8 @@ FASTPythonImporterTest >> testCalWithArgumentInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8004,6 +8208,7 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -8022,7 +8227,8 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8068,7 +8274,8 @@ FASTPythonImporterTest >> testCalWithArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8114,6 +8321,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8123,6 +8331,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8139,6 +8348,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8166,6 +8376,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8176,7 +8387,8 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8211,6 +8423,7 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -8219,7 +8432,8 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8255,7 +8469,8 @@ FASTPythonImporterTest >> testCalWithArgumentNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8291,6 +8506,7 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -8299,7 +8515,8 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8345,7 +8562,8 @@ FASTPythonImporterTest >> testCalWithArgumentSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8391,6 +8609,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8400,6 +8619,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8416,6 +8636,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8443,6 +8664,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8453,7 +8675,8 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8490,7 +8713,8 @@ FASTPythonImporterTest >> testCalWithArgumentString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8536,6 +8760,7 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8544,7 +8769,8 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8581,7 +8807,8 @@ FASTPythonImporterTest >> testCalWithArgumentTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8616,11 +8843,13 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -8629,7 +8858,8 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8665,6 +8895,7 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -8674,7 +8905,8 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8711,7 +8943,8 @@ FASTPythonImporterTest >> testCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print' ] { #category : 'tests - calls' } @@ -8747,6 +8980,7 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CFG'. stack pop. stack pop. @@ -8755,7 +8989,8 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8811,6 +9046,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'train_bs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'train_bs'. stack pop. stack pop. self assert: self topEntity operator equals: '*'. @@ -8821,6 +9057,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'epochs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'epochs'. stack pop. stack pop. @@ -8829,7 +9066,8 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8911,6 +9149,7 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'data'. stack pop. stack pop. stack pop. @@ -8921,7 +9160,8 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8956,11 +9196,13 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'shape0'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'shape0'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'resize'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'resize'. stack pop. self assert: self topEntity operators equals: #('!='). stack pop. @@ -8970,7 +9212,8 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9033,6 +9276,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_ids'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pred_ids'. stack pop. stack pop. @@ -9056,6 +9300,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_classes'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pred_classes'. stack pop. stack pop. stack pop. @@ -9065,7 +9310,8 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9109,7 +9355,8 @@ FASTPythonImporterTest >> testCallArgumentWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9164,7 +9411,8 @@ FASTPythonImporterTest >> testCallArgumentWithKeywordArgument [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9192,6 +9440,7 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'img'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'img'. stack pop. stack push: (stack top arguments at: 2). @@ -9204,11 +9453,13 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'padx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'padx'. stack pop. stack pop. @@ -9217,7 +9468,8 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9263,7 +9515,8 @@ FASTPythonImporterTest >> testCallChained [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9319,6 +9572,7 @@ FASTPythonImporterTest >> testCallLambda [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -9372,7 +9626,8 @@ FASTPythonImporterTest >> testCallOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - calls' } @@ -9407,7 +9662,8 @@ FASTPythonImporterTest >> testCallOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - calls' } @@ -9454,6 +9710,7 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -9461,7 +9718,8 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - calls' } @@ -9487,7 +9745,8 @@ FASTPythonImporterTest >> testCallOnIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - calls' } @@ -9524,6 +9783,7 @@ FASTPythonImporterTest >> testCallOnLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -9578,7 +9838,8 @@ FASTPythonImporterTest >> testCallOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions' ] { #category : 'tests - calls' } @@ -9634,7 +9895,8 @@ FASTPythonImporterTest >> testCallSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - calls' } @@ -9669,7 +9931,8 @@ FASTPythonImporterTest >> testCallWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'tqdm'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'tqdm' ] { #category : 'tests - calls' } @@ -9715,6 +9978,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -9724,6 +9988,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -9740,6 +10005,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -9767,6 +10033,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -9777,7 +10044,8 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'sum'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'sum' ] { #category : 'tests - operators' } @@ -9867,6 +10135,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclass [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. self assert: self topEntity name equals: 'aClass'. @@ -9914,6 +10183,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclassCustomizations [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. @@ -9976,16 +10246,19 @@ FASTPythonImporterTest >> testClassDefinitionWithMultipleSuperclasses [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'Super1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super1'. stack pop. stack push: (stack top superclasses at: 2). self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super2'. stack pop. stack push: (stack top superclasses at: 3). self assert: self topEntity sourceCode equals: 'Super3'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super3' ] { #category : 'tests - classes' } @@ -10030,7 +10303,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'module' ] { #category : 'tests - classes' } @@ -10076,7 +10350,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - classes' } @@ -10133,6 +10408,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super2'. stack pop. "Testing value of monovalue relation thenExpression" @@ -10140,7 +10416,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Super1'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super1' ] { #category : 'tests - classes' } @@ -10176,7 +10453,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassIdentifier [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'SuperClass'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'SuperClass' ] { #category : 'tests - classes' } @@ -10220,7 +10498,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - classes' } @@ -10275,7 +10554,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'classes'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'classes' ] { #category : 'tests - classes' } @@ -10320,6 +10600,7 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -10332,7 +10613,8 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'V'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'V' ] { #category : 'tests - comments' } @@ -10392,6 +10674,7 @@ FASTPythonImporterTest >> testCommentInArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct'. stack pop. "Testing value of multivalued relation comments" @@ -10456,6 +10739,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10511,6 +10795,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10547,6 +10832,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -10563,6 +10849,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10606,6 +10893,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -10695,6 +10983,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10710,7 +10999,8 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -10799,6 +11089,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithEllipsis [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -10902,6 +11193,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithIdentifier [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -11046,6 +11338,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithNotOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack push: (stack top operands at: 2). @@ -11177,6 +11470,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -11254,11 +11548,13 @@ FASTPythonImporterTest >> testComparisonOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -11374,6 +11670,7 @@ FASTPythonImporterTest >> testConcatenatedString [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'name'. stack pop. stack pop. stack pop. @@ -11427,6 +11724,7 @@ FASTPythonImporterTest >> testConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -11513,6 +11811,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11529,7 +11828,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -11575,6 +11875,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11584,6 +11885,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11601,6 +11903,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11609,7 +11912,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -11655,6 +11959,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11664,6 +11969,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -11681,6 +11987,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11689,7 +11996,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -11736,6 +12044,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -11753,7 +12062,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - conditional expressions' } @@ -11798,11 +12108,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -11820,11 +12132,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -11910,6 +12224,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11919,6 +12234,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -11964,6 +12280,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11973,6 +12290,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11982,6 +12300,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12027,6 +12346,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -12036,6 +12356,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -12045,6 +12366,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12091,6 +12413,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -12100,6 +12423,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12144,11 +12468,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -12159,6 +12485,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12206,6 +12533,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComplexe [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12261,6 +12589,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12269,6 +12598,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12278,6 +12608,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12325,6 +12656,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFalse [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12372,6 +12704,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFloat [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12408,6 +12741,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation elseExpression" @@ -12416,6 +12750,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12462,6 +12797,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionInteger [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12507,6 +12843,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -12516,6 +12853,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12570,6 +12908,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -12579,6 +12918,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12626,6 +12966,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionTrue [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12671,6 +13012,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -12681,6 +13023,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12745,6 +13088,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12753,6 +13097,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12780,6 +13125,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12787,7 +13133,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -12851,6 +13198,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -12884,7 +13232,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -12938,6 +13287,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -12946,6 +13296,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12962,6 +13313,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -12970,6 +13322,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -12994,6 +13347,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -13002,6 +13356,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13018,6 +13373,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -13025,7 +13381,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -13203,6 +13560,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13210,7 +13568,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -13305,6 +13664,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13332,6 +13692,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13462,6 +13823,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13471,6 +13833,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13487,6 +13850,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13514,6 +13878,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -13540,6 +13905,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13549,6 +13915,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13565,6 +13932,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13591,7 +13959,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - conditional expressions' } @@ -13636,6 +14005,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -13651,7 +14021,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - conditional expressions' } @@ -13743,6 +14114,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -13759,7 +14131,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - conditional expressions' } @@ -13786,6 +14159,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). @@ -13809,6 +14183,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13817,12 +14192,14 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - conditional expressions' } @@ -13943,6 +14320,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13952,6 +14330,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13968,6 +14347,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13995,6 +14375,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -14021,6 +14402,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -14030,6 +14412,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -14046,6 +14429,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -14072,7 +14456,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - conditional expressions' } @@ -14176,6 +14561,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -14201,7 +14587,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions' ] { #category : 'tests - conditional expressions' } @@ -14293,11 +14680,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -14314,11 +14703,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -14364,6 +14755,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -14382,6 +14774,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -14444,6 +14837,7 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -14459,7 +14853,8 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T' ] { #category : 'tests - statements' } @@ -14540,6 +14935,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decorator'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decorator'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -14586,6 +14982,7 @@ class MyComponent: pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'register_component'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'register_component'. stack pop. stack pop. self assert: self topEntity name equals: 'MyComponent'. @@ -14633,6 +15030,7 @@ def func(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'func'. @@ -14694,6 +15092,7 @@ FASTPythonImporterTest >> testDecoratorOnMethodDefinition [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'meth'. @@ -14750,6 +15149,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functools'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functools'. stack pop. stack pop. stack pop. @@ -14817,6 +15217,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -14876,6 +15277,7 @@ def funct(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of multivalued relation parameters" @@ -14953,6 +15355,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'decorators'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decorators'. stack pop. stack pop. stack pop. @@ -15004,6 +15407,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorA'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decoratorA'. stack pop. stack pop. @@ -15017,6 +15421,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorB'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decoratorB'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -15124,6 +15529,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15181,6 +15587,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15251,6 +15658,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15309,6 +15717,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -15318,6 +15727,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15377,6 +15787,7 @@ FASTPythonImporterTest >> testDefaultParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15434,11 +15845,13 @@ FASTPythonImporterTest >> testDefaultParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -15559,6 +15972,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -15567,6 +15981,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15643,6 +16058,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -15710,6 +16126,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -15718,6 +16135,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -15734,6 +16152,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -15742,6 +16161,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -15941,6 +16361,7 @@ FASTPythonImporterTest >> testDefaultParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. stack pop. @@ -16048,6 +16469,7 @@ FASTPythonImporterTest >> testDefaultParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -16186,6 +16608,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16195,6 +16618,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16211,6 +16635,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16238,6 +16663,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16347,6 +16773,7 @@ FASTPythonImporterTest >> testDefaultParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16475,6 +16902,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16484,6 +16912,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16500,6 +16929,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16527,6 +16957,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16647,6 +17078,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16754,11 +17186,13 @@ FASTPythonImporterTest >> testDefaultParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16817,6 +17251,7 @@ FASTPythonImporterTest >> testDefaultParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -16885,6 +17320,7 @@ FASTPythonImporterTest >> testDefaultTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -16943,6 +17379,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16960,6 +17397,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17017,6 +17455,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17034,6 +17473,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17104,6 +17544,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17121,6 +17562,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17179,6 +17621,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -17188,6 +17631,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17205,6 +17649,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17264,6 +17709,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17281,6 +17727,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17338,11 +17785,13 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -17361,6 +17810,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17429,6 +17879,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComplexe [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17498,6 +17949,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -17506,6 +17958,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17523,6 +17976,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17599,6 +18053,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -17617,6 +18072,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17683,6 +18139,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -17691,6 +18148,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -17707,6 +18165,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -17715,6 +18174,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -17733,6 +18193,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17800,6 +18261,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithEllipsis [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17868,6 +18330,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFalse [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17936,6 +18399,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFloat [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17985,6 +18449,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. @@ -18001,6 +18466,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18069,6 +18535,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithInteger [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18127,6 +18594,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -18154,6 +18622,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18231,6 +18700,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithList [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18300,6 +18770,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18309,6 +18780,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18325,6 +18797,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18352,6 +18825,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18371,6 +18845,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18438,6 +18913,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNone [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18496,6 +18972,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18513,6 +18990,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18590,6 +19068,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSet [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18659,6 +19138,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18668,6 +19148,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18684,6 +19165,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18711,6 +19193,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18730,6 +19213,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18798,6 +19282,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithString [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18866,6 +19351,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18883,6 +19369,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18951,6 +19438,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTrue [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19008,11 +19496,13 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -19030,6 +19520,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19088,6 +19579,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -19106,6 +19598,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19139,7 +19632,8 @@ FASTPythonImporterTest >> testDelStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - statements' } @@ -19172,7 +19666,8 @@ FASTPythonImporterTest >> testDelStatementAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19205,11 +19700,13 @@ FASTPythonImporterTest >> testDelStatementExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'rate'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'rate'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'add_baudrate_if_supported'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'add_baudrate_if_supported' ] { #category : 'tests - statements' } @@ -19243,11 +19740,13 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'obj1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj1'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'obj2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj2'. stack pop. stack push: (stack top initializers at: 3). @@ -19260,7 +19759,8 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19312,7 +19812,8 @@ FASTPythonImporterTest >> testDelStatementSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19468,6 +19969,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19476,6 +19978,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -19499,11 +20002,13 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -19529,7 +20034,8 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'class_indices' ] { #category : 'tests - comprehensions' } @@ -19568,6 +20074,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19576,6 +20083,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -19592,6 +20100,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack push: (stack top operands at: 2). @@ -19623,11 +20132,13 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -19653,7 +20164,8 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'class_indices' ] { #category : 'tests - splats' } @@ -19688,6 +20200,7 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -19696,7 +20209,8 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19732,6 +20246,7 @@ FASTPythonImporterTest >> testDictionarySplatInDictionary [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'd1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'd1'. stack pop. stack pop. @@ -19800,6 +20315,7 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -19809,7 +20325,8 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -19853,6 +20370,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'default_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'default_args'. stack pop. self assert: self topEntity operator equals: '|'. @@ -19862,6 +20380,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'subprocess_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'subprocess_args'. stack pop. stack pop. stack pop. @@ -19871,7 +20390,8 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19916,6 +20436,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'extra'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'extra'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -19934,7 +20455,8 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19978,6 +20500,7 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get_config'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get_config'. stack pop. stack pop. stack pop. @@ -19987,7 +20510,8 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -20042,6 +20566,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. "Testing value of monovalue relation value" @@ -20058,6 +20583,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. self assert: self topEntity operator equals: '*'. @@ -20093,11 +20619,13 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -20107,6 +20635,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'items'. stack pop. stack pop. stack pop. @@ -20117,7 +20646,8 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -20152,6 +20682,7 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -20160,7 +20691,8 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -20214,6 +20746,7 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'd'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'd'. stack pop. stack pop. stack pop. @@ -20223,7 +20756,8 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - function definitions' } @@ -20314,7 +20848,8 @@ FASTPythonImporterTest >> testDictionaryWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -20432,6 +20967,7 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -20440,7 +20976,8 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -20493,7 +21030,8 @@ FASTPythonImporterTest >> testDictionaryWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -20664,6 +21202,7 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -20671,7 +21210,8 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -20917,7 +21457,8 @@ FASTPythonImporterTest >> testDictionaryWithIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -21016,6 +21557,7 @@ FASTPythonImporterTest >> testDictionaryWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -21129,7 +21671,8 @@ FASTPythonImporterTest >> testDictionaryWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -21184,6 +21727,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21199,6 +21743,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21225,7 +21770,8 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -21321,7 +21867,8 @@ FASTPythonImporterTest >> testDictionaryWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -21429,6 +21976,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21444,6 +21992,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21470,7 +22019,8 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -21505,6 +22055,7 @@ FASTPythonImporterTest >> testDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'base'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'base'. stack pop. stack pop. @@ -21635,7 +22186,8 @@ FASTPythonImporterTest >> testDictionaryWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -21919,6 +22471,7 @@ except exceptions.Exception: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -21985,6 +22538,7 @@ except Exception(): pass' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22059,6 +22613,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -22076,6 +22631,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Error'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Error'. stack pop. "Testing value of monovalue relation thenExpression" @@ -22084,6 +22640,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22140,6 +22697,7 @@ except Exception: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22214,6 +22772,7 @@ except exceptions[2]: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -22271,6 +22830,7 @@ except Exception as e: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22311,7 +22871,8 @@ FASTPythonImporterTest >> testExecStatementOfIdentifier [ stack push: self topEntity code. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - statements' } @@ -22347,11 +22908,13 @@ FASTPythonImporterTest >> testExecStatementWithScopes [ stack push: (stack top scopes at: 1). self assert: self topEntity sourceCode equals: 'globals_dict'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'globals_dict'. stack pop. stack push: (stack top scopes at: 2). self assert: self topEntity sourceCode equals: 'locals_dict'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'locals_dict' ] { #category : 'tests - literals' } @@ -22414,6 +22977,7 @@ FASTPythonImporterTest >> testForStatement [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22464,6 +23028,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22513,6 +23078,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22521,6 +23087,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -22561,6 +23128,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22610,6 +23178,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22618,6 +23187,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -22686,6 +23256,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -22696,6 +23267,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22745,6 +23317,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22752,7 +23325,8 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun' ] { #category : 'tests - advanced statements' } @@ -22781,6 +23355,7 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22796,11 +23371,13 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -22847,6 +23424,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top initializers at: 2). @@ -22859,11 +23437,13 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'widths'. stack pop. stack pop. stack pop. @@ -22874,6 +23454,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'data'. stack pop. "Testing value of multivalued relation statements" @@ -22891,16 +23472,19 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top arguments at: 2). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top arguments at: 3). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'widths'. stack pop. "Testing value of monovalue relation callee" @@ -22908,7 +23492,8 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print' ] { #category : 'tests - imports' } @@ -23405,6 +23990,7 @@ FASTPythonImporterTest >> testFunctionDefinitionWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -23509,6 +24095,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -23518,6 +24105,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23534,6 +24122,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23560,7 +24149,8 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23597,6 +24187,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23613,6 +24204,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23639,7 +24231,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23675,6 +24268,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23691,6 +24285,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23717,7 +24312,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23754,6 +24350,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -23763,6 +24360,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23779,6 +24377,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23805,7 +24404,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23842,6 +24442,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -23851,6 +24452,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -23867,6 +24469,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23893,7 +24496,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23930,6 +24534,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -23946,6 +24551,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23972,7 +24578,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24008,11 +24615,13 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -24030,6 +24639,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24056,7 +24666,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24102,6 +24713,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24128,7 +24740,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24176,6 +24789,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -24184,6 +24798,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24200,6 +24815,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24226,7 +24842,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24280,6 +24897,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -24297,6 +24915,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24323,7 +24942,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24367,6 +24987,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -24375,6 +24996,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24391,6 +25013,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -24399,6 +25022,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -24416,6 +25040,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24442,7 +25067,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24487,6 +25113,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24513,7 +25140,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24559,6 +25187,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24585,7 +25214,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24631,6 +25261,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24657,7 +25288,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24685,6 +25317,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -24700,6 +25333,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24726,7 +25360,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24755,6 +25390,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -24770,6 +25406,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -24794,6 +25431,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24820,7 +25458,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24865,6 +25504,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24891,7 +25531,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24929,6 +25570,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -24955,6 +25597,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24981,7 +25624,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25025,6 +25669,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25051,7 +25696,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25096,6 +25742,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25105,6 +25752,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25121,6 +25769,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25148,6 +25797,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25166,6 +25816,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25192,7 +25843,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25218,6 +25870,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -25233,6 +25886,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -25241,6 +25895,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -25254,6 +25909,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25261,7 +25917,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -25291,6 +25948,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -25314,6 +25972,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -25355,6 +26014,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -25391,6 +26051,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25417,7 +26078,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25462,6 +26124,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25488,7 +26151,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25525,6 +26189,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -25541,6 +26206,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25567,7 +26233,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25621,6 +26288,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25647,7 +26315,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25692,6 +26361,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25701,6 +26371,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25717,6 +26388,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25744,6 +26416,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25762,6 +26435,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25788,7 +26462,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25834,6 +26509,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25860,7 +26536,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25906,6 +26583,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -25922,6 +26600,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25948,7 +26627,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25994,6 +26674,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26020,7 +26701,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -26056,6 +26738,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -26072,6 +26755,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26098,7 +26782,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -26135,6 +26820,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -26152,6 +26838,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26178,7 +26865,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - types' } @@ -26242,6 +26930,7 @@ FASTPythonImporterTest >> testGenericType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -26317,6 +27006,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. stack pop. @@ -26330,6 +27020,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -26399,7 +27090,8 @@ FASTPythonImporterTest >> testGlobalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'counter' ] { #category : 'tests - statements' } @@ -26480,16 +27172,19 @@ FASTPythonImporterTest >> testGlobalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'z' ] { #category : 'tests - advanced statements' } @@ -26529,6 +27224,7 @@ FASTPythonImporterTest >> testIf [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26601,6 +27297,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26692,6 +27389,7 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26727,6 +27425,7 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26814,6 +27513,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26849,6 +27549,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26892,6 +27593,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26984,6 +27686,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27019,6 +27722,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27062,6 +27766,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27157,6 +27862,7 @@ FASTPythonImporterTest >> testIfStatementWithABreak [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27220,6 +27926,7 @@ FASTPythonImporterTest >> testIfStatementWithAContinue [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27431,7 +28138,8 @@ FASTPythonImporterTest >> testImportInFunction [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'np'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'np' ] { #category : 'tests - imports' } @@ -27606,6 +28314,7 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'name'. stack pop. stack pop. @@ -27618,7 +28327,8 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - interpolations' } @@ -27661,7 +28371,8 @@ FASTPythonImporterTest >> testInterpolationWithAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CFG' ] { #category : 'tests - interpolations' } @@ -27706,6 +28417,7 @@ FASTPythonImporterTest >> testInterpolationWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. self assert: self topEntity operator equals: '+'. @@ -27760,6 +28472,7 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -27768,7 +28481,8 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - interpolations' } @@ -27823,7 +28537,8 @@ FASTPythonImporterTest >> testInterpolationWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'myMethod'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'myMethod' ] { #category : 'tests - interpolations' } @@ -27866,11 +28581,13 @@ FASTPythonImporterTest >> testInterpolationWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('==') ] @@ -27916,6 +28633,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -27931,6 +28649,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -27938,7 +28657,8 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'items' ] { #category : 'tests - interpolations' } @@ -27982,6 +28702,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -27990,6 +28711,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -27997,7 +28719,8 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: ''. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: '' ] { #category : 'tests - interpolations' } @@ -28090,6 +28813,7 @@ FASTPythonImporterTest >> testInterpolationWithLambda [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -28154,6 +28878,7 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -28161,7 +28886,8 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'label_order'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'label_order' ] { #category : 'tests - interpolations' } @@ -28196,6 +28922,7 @@ FASTPythonImporterTest >> testInterpolationWithTypeConversion [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'text'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'text'. stack pop. self assert: self topEntity typeConversion equals: 'r' ] @@ -28242,6 +28969,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28251,7 +28979,8 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28295,6 +29024,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28304,7 +29034,8 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28361,6 +29092,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28370,7 +29102,8 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28415,6 +29148,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -28424,6 +29158,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -28433,7 +29168,8 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28478,6 +29214,7 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -28487,7 +29224,8 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28531,11 +29269,13 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -28546,7 +29286,8 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28593,7 +29334,8 @@ FASTPythonImporterTest >> testKeywordArgumentToComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28649,6 +29391,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -28657,6 +29400,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28666,7 +29410,8 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28729,6 +29474,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28739,7 +29485,8 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28792,6 +29539,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -28800,6 +29548,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -28816,6 +29565,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -28824,6 +29574,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -28834,7 +29585,8 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28880,7 +29632,8 @@ FASTPythonImporterTest >> testKeywordArgumentToEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28927,7 +29680,8 @@ FASTPythonImporterTest >> testKeywordArgumentToFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28974,7 +29728,8 @@ FASTPythonImporterTest >> testKeywordArgumentToFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29010,6 +29765,7 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29018,7 +29774,8 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29065,7 +29822,8 @@ FASTPythonImporterTest >> testKeywordArgumentToInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29111,6 +29869,7 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -29130,7 +29889,8 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29186,7 +29946,8 @@ FASTPythonImporterTest >> testKeywordArgumentToList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29241,6 +30002,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -29250,6 +30012,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29266,6 +30029,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -29293,6 +30057,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -29304,7 +30069,8 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29348,6 +30114,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -29357,7 +30124,8 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29403,7 +30171,8 @@ FASTPythonImporterTest >> testKeywordArgumentToNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29448,6 +30217,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. stack pop. @@ -29457,7 +30227,8 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29513,7 +30284,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29568,6 +30340,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -29577,6 +30350,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29593,6 +30367,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -29620,6 +30395,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -29631,7 +30407,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29678,7 +30455,8 @@ FASTPythonImporterTest >> testKeywordArgumentToString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29733,6 +30511,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29742,7 +30521,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29789,7 +30569,8 @@ FASTPythonImporterTest >> testKeywordArgumentToTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29833,11 +30614,13 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -29847,7 +30630,8 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29892,6 +30676,7 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -29902,7 +30687,8 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - function definitions' } @@ -30010,6 +30796,7 @@ FASTPythonImporterTest >> testLambdaWithDefaultParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30057,6 +30844,7 @@ FASTPythonImporterTest >> testLambdaWithDictionarySplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30110,6 +30898,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30119,6 +30908,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30170,6 +30960,7 @@ FASTPythonImporterTest >> testLambdaWithListSplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30222,6 +31013,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -30231,6 +31023,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30277,6 +31070,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30286,6 +31080,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -30340,6 +31135,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30349,6 +31145,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30449,6 +31246,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -30458,6 +31256,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30474,6 +31273,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30500,7 +31300,8 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30537,6 +31338,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30553,6 +31355,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30579,7 +31382,8 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30615,6 +31419,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30631,6 +31436,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30657,7 +31463,8 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30694,6 +31501,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30703,6 +31511,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30719,6 +31528,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30745,7 +31555,8 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30782,6 +31593,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -30791,6 +31603,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -30807,6 +31620,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30833,7 +31647,8 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30870,6 +31685,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -30886,6 +31702,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30912,7 +31729,8 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30948,11 +31766,13 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -30970,6 +31790,7 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30996,7 +31817,8 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31042,6 +31864,7 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31068,7 +31891,8 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31116,6 +31940,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -31124,6 +31949,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31140,6 +31966,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31166,7 +31993,8 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31220,6 +32048,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -31237,6 +32066,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31263,7 +32093,8 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31307,6 +32138,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -31315,6 +32147,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31331,6 +32164,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -31339,6 +32173,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -31356,6 +32191,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31382,7 +32218,8 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31427,6 +32264,7 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31453,7 +32291,8 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31499,6 +32338,7 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31525,7 +32365,8 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31571,6 +32412,7 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31597,7 +32439,8 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31625,6 +32468,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -31640,6 +32484,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31666,7 +32511,8 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31695,6 +32541,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -31710,6 +32557,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -31734,6 +32582,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31760,7 +32609,8 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31805,6 +32655,7 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31831,7 +32682,8 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31869,6 +32721,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -31895,6 +32748,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31921,7 +32775,8 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31965,6 +32820,7 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31991,7 +32847,8 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32035,6 +32892,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32044,6 +32902,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32060,6 +32919,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32087,6 +32947,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32105,6 +32966,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32131,7 +32993,8 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32157,6 +33020,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -32172,6 +33036,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -32180,6 +33045,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -32193,6 +33059,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32200,7 +33067,8 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -32230,6 +33098,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -32253,6 +33122,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -32294,6 +33164,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -32330,6 +33201,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32356,7 +33228,8 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32401,6 +33274,7 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32427,7 +33301,8 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32464,6 +33339,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -32480,6 +33356,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32506,7 +33383,8 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32552,6 +33430,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -32560,6 +33439,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'abs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -32579,6 +33459,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation callee" @@ -32587,6 +33468,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'abs'. stack pop. stack pop. stack pop. @@ -32611,11 +33493,13 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -32624,7 +33508,8 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'points'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'points' ] { #category : 'tests - comprehensions' } @@ -32678,6 +33563,7 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32704,7 +33590,8 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32749,6 +33636,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32758,6 +33646,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32774,6 +33663,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32801,6 +33691,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32819,6 +33710,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32845,7 +33737,8 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32891,6 +33784,7 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32917,7 +33811,8 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32963,6 +33858,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -32979,6 +33875,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33005,7 +33902,8 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33051,6 +33949,7 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33077,7 +33976,8 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33113,6 +34013,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -33129,6 +34030,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33155,7 +34057,8 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33192,6 +34095,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -33209,6 +34113,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33235,7 +34140,8 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - splats' } @@ -33270,6 +34176,7 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33278,7 +34185,8 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33312,6 +34220,7 @@ FASTPythonImporterTest >> testListSplatInList [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33363,6 +34272,7 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -33372,7 +34282,8 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33416,6 +34327,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -33425,6 +34337,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack pop. @@ -33434,7 +34347,8 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33478,6 +34392,7 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'getList'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'getList'. stack pop. stack pop. stack pop. @@ -33487,7 +34402,8 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33549,7 +34465,8 @@ FASTPythonImporterTest >> testListSplatOnList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33602,6 +34519,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation callee" @@ -33610,6 +34528,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'format'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'format'. stack pop. stack pop. @@ -33626,6 +34545,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation right" @@ -33634,6 +34554,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'FILES'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'FILES'. stack pop. stack pop. stack pop. @@ -33644,7 +34565,8 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33679,6 +34601,7 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33687,7 +34610,8 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33733,7 +34657,8 @@ FASTPythonImporterTest >> testListSplatOnString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33787,6 +34712,7 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -33796,7 +34722,8 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33839,6 +34766,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'func'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func'. stack pop. stack push: (stack top initializers at: 2). @@ -33851,6 +34779,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -33861,7 +34790,8 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - function definitions' } @@ -33933,7 +34863,8 @@ FASTPythonImporterTest >> testListWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -34013,6 +34944,7 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -34021,7 +34953,8 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -34055,7 +34988,8 @@ FASTPythonImporterTest >> testListWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -34169,6 +35103,7 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -34176,7 +35111,8 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -34329,7 +35265,8 @@ FASTPythonImporterTest >> testListWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -34390,6 +35327,7 @@ FASTPythonImporterTest >> testListWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -34464,7 +35402,8 @@ FASTPythonImporterTest >> testListWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -34500,6 +35439,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -34515,6 +35455,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -34541,7 +35482,8 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -34599,7 +35541,8 @@ FASTPythonImporterTest >> testListWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -34669,6 +35612,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -34684,6 +35628,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -34710,7 +35655,8 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -34744,6 +35690,7 @@ FASTPythonImporterTest >> testListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -34820,7 +35767,8 @@ FASTPythonImporterTest >> testListWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -34972,7 +35920,8 @@ FASTPythonImporterTest >> testMatchAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - match' } @@ -35028,7 +35977,8 @@ FASTPythonImporterTest >> testMatchCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - match' } @@ -35195,7 +36145,8 @@ FASTPythonImporterTest >> testMatchIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - match' } @@ -35378,7 +36329,8 @@ FASTPythonImporterTest >> testMatchPatternComplexOperation [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -35435,7 +36387,8 @@ FASTPythonImporterTest >> testMatchPatternComplexe [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35545,7 +36498,8 @@ FASTPythonImporterTest >> testMatchPatternDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35591,6 +36545,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -35608,7 +36563,8 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35663,7 +36619,8 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35800,7 +36757,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35890,7 +36848,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithNoValues [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35971,6 +36930,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. stack pop. @@ -35989,7 +36949,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36098,7 +37059,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithVariables [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36154,7 +37116,8 @@ FASTPythonImporterTest >> testMatchPatternDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -36211,7 +37174,8 @@ FASTPythonImporterTest >> testMatchPatternFalse [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36268,7 +37232,8 @@ FASTPythonImporterTest >> testMatchPatternFloat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36325,7 +37290,8 @@ FASTPythonImporterTest >> testMatchPatternInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36392,7 +37358,8 @@ FASTPythonImporterTest >> testMatchPatternKeyword [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36467,7 +37434,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithClass [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36556,7 +37524,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithComplexPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36622,7 +37591,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36688,7 +37658,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36755,7 +37726,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36831,7 +37803,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36907,7 +37880,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36990,7 +37964,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37063,7 +38038,8 @@ FASTPythonImporterTest >> testMatchPatternList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -37144,7 +38120,8 @@ FASTPythonImporterTest >> testMatchPatternListInList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37190,6 +38167,7 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'list'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'list'. stack pop. stack pop. @@ -37207,7 +38185,8 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37262,7 +38241,8 @@ FASTPythonImporterTest >> testMatchPatternListSplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37324,6 +38304,7 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -37342,7 +38323,8 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37431,7 +38413,8 @@ FASTPythonImporterTest >> testMatchPatternListWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37487,7 +38470,8 @@ FASTPythonImporterTest >> testMatchPatternNone [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37544,7 +38528,8 @@ FASTPythonImporterTest >> testMatchPatternString [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37601,7 +38586,8 @@ FASTPythonImporterTest >> testMatchPatternTrue [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37674,7 +38660,8 @@ FASTPythonImporterTest >> testMatchPatternTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -37754,7 +38741,8 @@ FASTPythonImporterTest >> testMatchPatternUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37836,7 +38824,8 @@ FASTPythonImporterTest >> testMatchPatternUnionClassPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37937,7 +38926,8 @@ FASTPythonImporterTest >> testMatchPatternUnionDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38010,7 +39000,8 @@ FASTPythonImporterTest >> testMatchPatternUnionDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38092,7 +39083,8 @@ FASTPythonImporterTest >> testMatchPatternUnionList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38174,7 +39166,8 @@ FASTPythonImporterTest >> testMatchPatternUnionTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38231,7 +39224,8 @@ FASTPythonImporterTest >> testMatchPatternWithAlias [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -38279,6 +39273,7 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -38313,7 +39308,8 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38545,6 +39541,7 @@ FASTPythonImporterTest >> testMethodWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'CSVDataset'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CSVDataset'. stack pop. stack pop. @@ -38707,6 +39704,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -38774,6 +39772,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -38891,7 +39890,8 @@ FASTPythonImporterTest >> testNonlocalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'counter' ] { #category : 'tests - statements' } @@ -38972,16 +39972,19 @@ FASTPythonImporterTest >> testNonlocalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'z' ] { #category : 'tests - operators' } @@ -39031,7 +40034,8 @@ FASTPythonImporterTest >> testNotOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39066,6 +40070,7 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '&'. @@ -39074,7 +40079,8 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39109,6 +40115,7 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'or'. @@ -39118,7 +40125,8 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -39153,7 +40161,8 @@ FASTPythonImporterTest >> testNotOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -39262,6 +40271,7 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -39277,7 +40287,8 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39381,7 +40392,8 @@ FASTPythonImporterTest >> testNotOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -39466,7 +40478,8 @@ FASTPythonImporterTest >> testNotOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -39572,7 +40585,8 @@ FASTPythonImporterTest >> testNotOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -39805,7 +40819,8 @@ FASTPythonImporterTest >> testPrintStatmentWithChevron [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'file_object'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'file_object' ] { #category : 'tests - raise statement' } @@ -39854,7 +40869,8 @@ FASTPythonImporterTest >> testRaiseAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'module' ] { #category : 'tests - raise statement' } @@ -39888,6 +40904,7 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'ValueError'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'ValueError'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -39896,7 +40913,8 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'TypeError'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'TypeError' ] { #category : 'tests - raise statement' } @@ -39941,7 +40959,8 @@ FASTPythonImporterTest >> testRaiseCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception' ] { #category : 'tests - raise statement' } @@ -39965,7 +40984,8 @@ FASTPythonImporterTest >> testRaiseIdentifier [ stack push: self topEntity exception. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception' ] { #category : 'tests - raise statement' } @@ -39998,6 +41018,7 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation value" @@ -40005,7 +41026,8 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions' ] { #category : 'tests - literals' } @@ -40253,6 +41275,7 @@ FASTPythonImporterTest >> testReturnMultiple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'len'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'len'. stack pop. stack pop. @@ -40405,6 +41428,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation forClauses" @@ -40420,6 +41444,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -40444,7 +41469,8 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v' ] { #category : 'tests - comprehensions' } @@ -40481,6 +41507,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40497,6 +41524,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40523,7 +41551,8 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40559,6 +41588,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40575,6 +41605,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40601,7 +41632,8 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40638,6 +41670,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -40647,6 +41680,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40663,6 +41697,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40689,7 +41724,8 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40726,6 +41762,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -40735,6 +41772,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -40751,6 +41789,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40777,7 +41816,8 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40814,6 +41854,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -40830,6 +41871,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40856,7 +41898,8 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40892,11 +41935,13 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -40914,6 +41959,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40940,7 +41986,8 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40986,6 +42033,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41012,7 +42060,8 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41060,6 +42109,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -41068,6 +42118,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41084,6 +42135,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41110,7 +42162,8 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41164,6 +42217,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -41181,6 +42235,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41207,7 +42262,8 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41251,6 +42307,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -41259,6 +42316,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41275,6 +42333,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -41283,6 +42342,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -41300,6 +42360,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41326,7 +42387,8 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41371,6 +42433,7 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41397,7 +42460,8 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41443,6 +42507,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41469,7 +42534,8 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41515,6 +42581,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41541,7 +42608,8 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41569,6 +42637,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -41584,6 +42653,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41610,7 +42680,8 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41640,6 +42711,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation conditions" @@ -41655,6 +42727,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. stack push: (stack top operands at: 2). @@ -41679,6 +42752,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -41703,7 +42777,8 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v' ] { #category : 'tests - comprehensions' } @@ -41748,6 +42823,7 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41774,7 +42850,8 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41812,6 +42889,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -41838,6 +42916,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41864,7 +42943,8 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41908,6 +42988,7 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41934,7 +43015,8 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41979,6 +43061,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -41988,6 +43071,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42004,6 +43088,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -42031,6 +43116,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -42049,6 +43135,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42075,7 +43162,8 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42101,6 +43189,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -42116,6 +43205,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -42124,6 +43214,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -42137,6 +43228,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42144,7 +43236,8 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -42174,6 +43267,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -42197,6 +43291,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -42238,6 +43333,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -42274,6 +43370,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42300,7 +43397,8 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42345,6 +43443,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42371,7 +43470,8 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42408,6 +43508,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -42424,6 +43525,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42450,7 +43552,8 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42504,6 +43607,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42530,7 +43634,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42574,6 +43679,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -42583,6 +43689,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42599,6 +43706,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -42626,6 +43734,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -42644,6 +43753,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42670,7 +43780,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42716,6 +43827,7 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42742,7 +43854,8 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42788,6 +43901,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -42804,6 +43918,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42830,7 +43945,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42876,6 +43992,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42902,7 +44019,8 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42938,6 +44056,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42954,6 +44073,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42980,7 +44100,8 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -43017,6 +44138,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -43034,6 +44156,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43060,7 +44183,8 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43093,7 +44217,8 @@ FASTPythonImporterTest >> testSetWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -43173,6 +44298,7 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -43181,7 +44307,8 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -43215,7 +44342,8 @@ FASTPythonImporterTest >> testSetWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -43329,6 +44457,7 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -43336,7 +44465,8 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -43489,7 +44619,8 @@ FASTPythonImporterTest >> testSetWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -43550,6 +44681,7 @@ FASTPythonImporterTest >> testSetWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -43625,7 +44757,8 @@ FASTPythonImporterTest >> testSetWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -43661,6 +44794,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -43676,6 +44810,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43702,7 +44837,8 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43760,7 +44896,8 @@ FASTPythonImporterTest >> testSetWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -43829,6 +44966,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -43844,6 +44982,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43870,7 +45009,8 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43904,6 +45044,7 @@ FASTPythonImporterTest >> testSetWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -43980,7 +45121,8 @@ FASTPythonImporterTest >> testSetWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -44134,6 +45276,7 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -44143,7 +45286,8 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44186,6 +45330,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44195,6 +45340,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -44209,6 +45355,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44218,6 +45365,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -44234,7 +45382,8 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44285,7 +45434,8 @@ FASTPythonImporterTest >> testSliceBoolean [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44336,6 +45486,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -44344,6 +45495,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'indexOf'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'indexOf'. stack pop. stack pop. stack pop. @@ -44353,7 +45505,8 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44395,6 +45548,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -44403,6 +45557,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. "Testing value of monovalue relation thenExpression" @@ -44411,12 +45566,14 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -44425,7 +45582,8 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44458,7 +45616,8 @@ FASTPythonImporterTest >> testSliceEmpty [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44509,7 +45668,8 @@ FASTPythonImporterTest >> testSliceNone [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44543,6 +45703,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). @@ -44556,6 +45717,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44565,6 +45727,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'h'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'h'. stack pop. stack pop. stack pop. @@ -44574,7 +45737,8 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44629,7 +45793,8 @@ FASTPythonImporterTest >> testSliceReverse [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44680,6 +45845,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack pop. @@ -44703,6 +45869,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack pop. stack pop. @@ -44712,7 +45879,8 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44801,7 +45969,8 @@ FASTPythonImporterTest >> testSliceUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44834,11 +46003,13 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -44847,7 +46018,8 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44891,7 +46063,8 @@ FASTPythonImporterTest >> testSliceWithEnd [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44935,7 +46108,8 @@ FASTPythonImporterTest >> testSliceWithStart [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44993,7 +46167,8 @@ FASTPythonImporterTest >> testSliceWithStartStopStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -45037,7 +46212,8 @@ FASTPythonImporterTest >> testSliceWithStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - types' } @@ -45166,7 +46342,8 @@ FASTPythonImporterTest >> testSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - subscripts' } @@ -45210,7 +46387,8 @@ FASTPythonImporterTest >> testSubscriptOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45254,7 +46432,8 @@ FASTPythonImporterTest >> testSubscriptOnAttributeWithParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'os'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'os' ] { #category : 'tests - subscripts' } @@ -45297,7 +46476,8 @@ FASTPythonImporterTest >> testSubscriptOnAwait [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45342,6 +46522,7 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45350,7 +46531,8 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45395,7 +46577,8 @@ FASTPythonImporterTest >> testSubscriptOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - subscripts' } @@ -45451,6 +46634,7 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -45458,7 +46642,8 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45519,7 +46704,8 @@ FASTPythonImporterTest >> testSubscriptOnDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45572,6 +46758,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -45580,6 +46767,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45596,6 +46784,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -45603,7 +46792,8 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - subscripts' } @@ -45638,7 +46828,8 @@ FASTPythonImporterTest >> testSubscriptOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - subscripts' } @@ -45737,6 +46928,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45746,6 +46938,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45762,6 +46955,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45788,7 +46982,8 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - subscripts' } @@ -45831,7 +47026,8 @@ FASTPythonImporterTest >> testSubscriptOnListSplat [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - subscripts' } @@ -45930,6 +47126,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45939,6 +47136,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45955,6 +47153,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45981,7 +47180,8 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - subscripts' } @@ -46070,7 +47270,8 @@ FASTPythonImporterTest >> testSubscriptOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - subscripts' } @@ -46114,11 +47315,13 @@ FASTPythonImporterTest >> testSubscriptOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - subscripts' } @@ -46163,6 +47366,7 @@ FASTPythonImporterTest >> testSubscriptOnUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '-' @@ -46199,6 +47403,7 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -46207,7 +47412,8 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - subscripts' } @@ -46263,7 +47469,8 @@ FASTPythonImporterTest >> testSubscriptWithBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -46295,6 +47502,7 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: (stack top indices at: 2). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -46302,7 +47510,8 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'imgs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'imgs' ] { #category : 'tests - subscripts' } @@ -46344,7 +47553,8 @@ FASTPythonImporterTest >> testSubscriptWithTwoIndicies [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'loc'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'loc' ] { #category : 'tests - subscripts' } @@ -46417,7 +47627,8 @@ FASTPythonImporterTest >> testSubscriptWithTwoSlices [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'arr'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'arr' ] { #category : 'tests - literals' } @@ -46540,6 +47751,7 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -46558,6 +47770,7 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -46618,6 +47831,7 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -46662,6 +47876,7 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -46780,6 +47995,7 @@ FASTPythonImporterTest >> testTupleExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'toto'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'toto'. stack pop. stack pop. @@ -46948,6 +48164,7 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'bytearray'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'bytearray'. stack pop. stack pop. @@ -46987,7 +48204,8 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'self'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'self' ] { #category : 'tests - collections' } @@ -47020,7 +48238,8 @@ FASTPythonImporterTest >> testTupleWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47065,7 +48284,8 @@ FASTPythonImporterTest >> testTupleWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47099,6 +48319,7 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -47107,7 +48328,8 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -47141,7 +48363,8 @@ FASTPythonImporterTest >> testTupleWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - collections' } @@ -47174,11 +48397,13 @@ FASTPythonImporterTest >> testTupleWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -47251,6 +48476,7 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -47258,7 +48484,8 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47309,7 +48536,8 @@ FASTPythonImporterTest >> testTupleWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47351,6 +48579,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -47359,6 +48588,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47375,6 +48605,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -47382,7 +48613,8 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -47483,7 +48715,8 @@ FASTPythonImporterTest >> testTupleWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47544,6 +48777,7 @@ FASTPythonImporterTest >> testTupleWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -47632,6 +48866,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47641,6 +48876,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47657,6 +48893,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47683,7 +48920,8 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -47715,7 +48953,8 @@ FASTPythonImporterTest >> testTupleWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -47773,7 +49012,8 @@ FASTPythonImporterTest >> testTupleWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -47852,6 +49092,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47861,6 +49102,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47877,6 +49119,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47903,7 +49146,8 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -47972,7 +49216,8 @@ FASTPythonImporterTest >> testTupleWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -48030,11 +49275,13 @@ FASTPythonImporterTest >> testTupleWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -48068,6 +49315,7 @@ FASTPythonImporterTest >> testTupleWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -48198,6 +49446,7 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -48213,7 +49462,8 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int' ] { #category : 'tests - statements' } @@ -48258,6 +49508,7 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -48273,7 +49524,8 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int' ] { #category : 'tests - types' } @@ -48320,6 +49572,7 @@ FASTPythonImporterTest >> testTypeAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'subprocess'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'subprocess'. stack pop. stack pop. stack pop. @@ -48376,6 +49629,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. self assert: self topEntity operator equals: '|'. @@ -48385,6 +49639,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. stack pop. stack pop. @@ -48442,6 +49697,7 @@ FASTPythonImporterTest >> testTypeCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. stack pop. @@ -48784,6 +50040,7 @@ FASTPythonImporterTest >> testTypeIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Path'. stack pop. stack pop. @@ -48943,6 +50200,7 @@ FASTPythonImporterTest >> testTypeList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'object'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'object'. stack pop. stack pop. stack pop. @@ -49000,6 +50258,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. "Testing value of multivalued relation forClauses" @@ -49015,6 +50274,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. "Testing value of monovalue relation right" @@ -49031,6 +50291,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -49192,7 +50453,8 @@ FASTPythonImporterTest >> testTypeParametersInFunctionDefinition [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T' ] { #category : 'tests - types' } @@ -49238,6 +50500,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. @@ -49251,6 +50514,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -49263,7 +50527,8 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'L'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'L' ] { #category : 'tests - types' } @@ -49580,6 +50845,7 @@ FASTPythonImporterTest >> testTypedListSplatParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Any'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Any'. stack pop. stack pop. stack pop. @@ -49637,6 +50903,7 @@ FASTPythonImporterTest >> testTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Path'. stack pop. stack pop. stack pop. @@ -49698,6 +50965,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49734,6 +51002,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49791,6 +51060,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'e'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'e'. stack pop. stack pop. self assert: self topEntity operator equals: '-'. @@ -49830,6 +51100,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -49839,6 +51110,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -49877,6 +51149,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49913,11 +51186,13 @@ FASTPythonImporterTest >> testUnaryOperatorWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -49996,6 +51271,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -50004,6 +51280,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -50090,6 +51367,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '~' ] @@ -50155,6 +51433,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -50231,6 +51510,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -50296,6 +51576,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -50378,6 +51659,7 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'bytes'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'bytes'. stack pop. stack pop. stack pop. @@ -50393,6 +51675,7 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -50447,7 +51730,8 @@ FASTPythonImporterTest >> testVariableDeclaration [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'ModuleType'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'ModuleType' ] { #category : 'tests - assignments' } @@ -50508,7 +51792,8 @@ FASTPythonImporterTest >> testWalrusAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -50590,6 +51875,7 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -50598,7 +51884,8 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - assignments' } @@ -50633,7 +51920,8 @@ FASTPythonImporterTest >> testWalrusCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -50742,6 +52030,7 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -50757,7 +52046,8 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -50915,7 +52205,8 @@ FASTPythonImporterTest >> testWalrusIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -50978,6 +52269,7 @@ FASTPythonImporterTest >> testWalrusLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -51020,7 +52312,8 @@ FASTPythonImporterTest >> testWalrusList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - assignments' } @@ -51053,7 +52346,8 @@ FASTPythonImporterTest >> testWalrusListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - assignments' } @@ -51090,6 +52384,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -51105,6 +52400,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -51131,7 +52427,8 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -51191,7 +52488,8 @@ FASTPythonImporterTest >> testWalrusNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - assignments' } @@ -51225,12 +52523,14 @@ FASTPythonImporterTest >> testWalrusPatternList [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -51302,6 +52602,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -51317,6 +52618,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -51343,7 +52645,8 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -51414,7 +52717,8 @@ FASTPythonImporterTest >> testWalrusSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -51475,11 +52779,13 @@ FASTPythonImporterTest >> testWalrusTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -51632,6 +52938,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -51651,6 +52958,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -51658,7 +52966,8 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun' ] { #category : 'tests - with statements' } @@ -51695,6 +53004,7 @@ FASTPythonImporterTest >> testWithStatement [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -51748,6 +53058,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -51757,6 +53068,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -51800,6 +53112,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr1'. stack pop. "Testing value of monovalue relation target" @@ -51808,6 +53121,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target1'. stack pop. stack pop. @@ -51821,6 +53135,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr2'. stack pop. "Testing value of monovalue relation target" @@ -51829,6 +53144,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target2'. stack pop. stack pop. @@ -51842,6 +53158,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr3'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr3'. stack pop. "Testing value of monovalue relation target" @@ -51850,6 +53167,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target3'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target3'. stack pop. stack pop. @@ -51898,7 +53216,8 @@ FASTPythonImporterTest >> testYieldFrom [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests' } @@ -51922,7 +53241,8 @@ FASTPythonImporterTest >> testYieldWithIdentifier [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'running' } diff --git a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index d77ae30..cdea4a5 100644 --- a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -619,21 +619,26 @@ FASTPythonTreeSitterVisitor >> visitGlobalStatement: aTSNode [ { #category : 'visiting' } FASTPythonTreeSitterVisitor >> visitIdentifier: aNode [ - (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: (self sourceCodeOf: aNode) ]. + | name | + name := self sourceCodeOf: aNode. + + (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: name ]. "If we are in a field `name` then we are probably in a definition of an entity and we set my content as a name." - self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: (self sourceCodeOf: aNode) ]. + self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: name ]. self isIdentifierAVariableInTheCurrentContext ifTrue: [ | variable | variable := self handleNode: aNode kind: FASTPyVariable. - variable name: (self sourceCodeOf: aNode). + variable name: name. ^ variable ]. "In case we are in an alias, we edit the property alias of the last imported entity" - aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: (self sourceCodeOf: aNode) ]. + aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: name ]. - ^ self handleNode: aNode + ^ (self handleNode: aNode) + name: name; + yourself ] { #category : 'visiting - skip' } From 03a534aad7ac94a775fa6bf65afb48fdfd3d4270 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 17:41:08 +0200 Subject: [PATCH 063/151] Simplify code now that identifiers are named entities --- src/FAST-Python-Tools/FASTPyIdentifier.extension.st | 6 ------ .../FASTPythonLocalResolverVisitor.class.st | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st deleted file mode 100644 index 2c28167..0000000 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTPyIdentifier' } - -{ #category : '*FAST-Python-Tools' } -FASTPyIdentifier >> localDeclarationName [ - ^ self sourceCode -] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index a2b9b78..dc1901c 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -150,9 +150,9 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ anIdentifier isVariableWriteAccess ifTrue: [ - ^ self ensureDeclarationOf: anIdentifier named: anIdentifier sourceCode declaration: anIdentifier variableDeclarator ]. + ^ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier variableDeclarator ]. - self bind: anIdentifier toDeclarationNamed: anIdentifier sourceCode + self bind: anIdentifier toDeclarationNamed: anIdentifier name ] { #category : 'visiting' } From 44d3f26beef67ff2e57c810a6f9b6b484b659590 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 18:55:18 +0200 Subject: [PATCH 064/151] Update LocalResolver to make it easier to implement the SSA with Python This is the result of a discussion with Nicolas --- .../FASTPythonLocalResolverTest.class.st | 500 +++++++++--------- .../FASTPyIdentifier.extension.st | 9 + .../FASTPythonLocalResolverVisitor.class.st | 11 +- 3 files changed, 274 insertions(+), 246 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 37880f7..84ec2c6 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -17,29 +17,35 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] -{ #category : 'tests - tuples assignment' } +{ #category : 'tests - globals' } FASTPythonLocalResolverTest >> testAssignementToTuple [ - | assignment assignedVariableX assignedVariableY usedVariableX | + | assignedVariableX assignedVariableY usedVariableX | self parseAndResolve: 'x, y = 1, 2 print(x)'. - assignment := model module statements first. - assignedVariableX := assignment left initializers first. - self assert: assignedVariableX localDeclaration equals: assignment. - self assert: assignedVariableX localDeclaration left sourceCode equals: 'x, y'. + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. self deny: assignedVariableX localDeclaration isNonLocalDeclaration. - self assert: assignedVariableX localDeclaration localUses size equals: 3. + self assert: assignedVariableX localDeclaration localUses size equals: 2. self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. - - assignedVariableY := assignment left initializers second. - self assert: assignedVariableY localDeclaration equals: assignment. - self assert: assignedVariableY localDeclaration localUses second equals: assignedVariableY. usedVariableX := model module statements second arguments first. - self assert: usedVariableX localDeclaration equals: assignment. - self assert: usedVariableX equals: assignedVariableX localDeclaration localUses third + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY ] { #category : 'tests - non local declarations' } @@ -74,15 +80,16 @@ x.y'. { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ - | assignment assignedVariable | + | assignedVariable | self parseAndResolve: 'x = 3 # {x: 2}'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 1. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable @@ -91,21 +98,21 @@ FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 1 x'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self assert: assignedVariable localDeclaration left isVariableWriteAccess. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] @@ -156,7 +163,7 @@ print(v)'. { #category : 'tests - imports' } FASTPythonLocalResolverTest >> testFromImportedEntityWithAliasDoesNotShadowVariable [ - | import importedEntity call assignment assignedVariable usedVariable1 usedVariable2 | + | import importedEntity call assignedVariable usedVariable1 usedVariable2 | self parseAndResolve: 'x = 1 print(x) @@ -167,20 +174,21 @@ func() print(x)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 3. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable1 := model module statements second arguments first. - self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 localDeclaration equals: assignedVariable. self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. usedVariable2 := model module statements fifth arguments first. - self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 localDeclaration equals: assignedVariable. self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. import := model module statements third. @@ -261,7 +269,7 @@ FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ - | globalAssignment assignedGlobal usedGlobal temporaryAssignment assignedTemporary temporaryUsage1 temporaryUsage2 | + | assignedGlobal usedGlobal assignedTemporary temporaryUsage1 temporaryUsage2 | self parseAndResolve: 'glob = 1 def fun(): @@ -272,32 +280,32 @@ def fun(): fun() print(glob)'. - globalAssignment := model module statements first. - assignedGlobal := globalAssignment left. - self assert: assignedGlobal localDeclaration equals: globalAssignment. - self assert: assignedGlobal localDeclaration left name equals: 'glob'. + assignedGlobal := model module statements first left. + self assert: assignedGlobal localDeclaration equals: assignedGlobal. + self assert: assignedGlobal localDeclaration name equals: 'glob'. + self assert: assignedGlobal localDeclaration variableDeclarator equals: model module statements first. self deny: assignedGlobal localDeclaration isNonLocalDeclaration. self assert: assignedGlobal localDeclaration localUses size equals: 2. self assert: assignedGlobal localDeclaration localUses first equals: assignedGlobal. usedGlobal := model module statements fourth arguments first. - self assert: usedGlobal localDeclaration equals: globalAssignment. + self assert: usedGlobal localDeclaration equals: assignedGlobal. self assert: usedGlobal equals: assignedGlobal localDeclaration localUses second. - temporaryAssignment := model module statements second statements first. - assignedTemporary := temporaryAssignment left. - self assert: assignedTemporary localDeclaration equals: temporaryAssignment. - self assert: assignedTemporary localDeclaration left name equals: 'glob'. + assignedTemporary := model module statements second statements first left. + self assert: assignedTemporary localDeclaration equals: assignedTemporary. + self assert: assignedTemporary localDeclaration name equals: 'glob'. + self assert: assignedTemporary localDeclaration variableDeclarator equals: model module statements second statements first. self deny: assignedTemporary localDeclaration isNonLocalDeclaration. self assert: assignedTemporary localDeclaration localUses size equals: 3. self assert: assignedTemporary localDeclaration localUses first equals: assignedTemporary. temporaryUsage1 := model module statements second statements second arguments first. - self assert: temporaryUsage1 localDeclaration equals: temporaryAssignment. + self assert: temporaryUsage1 localDeclaration equals: assignedTemporary. self assert: temporaryUsage1 equals: assignedTemporary localDeclaration localUses second. temporaryUsage2 := model module statements second statements third expression. - self assert: temporaryUsage2 localDeclaration equals: temporaryAssignment. + self assert: temporaryUsage2 localDeclaration equals: assignedTemporary. self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third ] @@ -305,7 +313,7 @@ print(glob)'. FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ "Here we cannot know if the second printing is of a variable." - | assignment assignedVariable usedVariable import importedEntity usedImportedEntity | + | assignedVariable usedVariable import importedEntity usedImportedEntity | self parseAndResolve: 'x = 1 print(x) @@ -313,16 +321,17 @@ import x print(x)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second. import := model module statements third. @@ -343,7 +352,7 @@ print(x)'. FASTPythonLocalResolverTest >> testGlobalShadowedByImportAlias [ "Here we cannot know if the second printing is of a variable." - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 1 print(x) @@ -352,16 +361,17 @@ import a as x print(x)'. self skip. "We need to update the behavior" - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second. self deny: model module statements fourth arguments first hasLocalDeclaration @@ -370,7 +380,7 @@ print(x)'. { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testGlobalShadowedByImportInFunction [ - | assignment assignedVariable usedVariable1 usedVariable2 | + | assignedVariable usedVariable1 usedVariable2 | self parseAndResolve: 'matplotlib = 3 print(matplotlib) @@ -382,68 +392,69 @@ def f(): print(matplotlib)'. self skip. "To update and fix" - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'matplotlib'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'matplotlib'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 3. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable1 := model module statements second arguments first. - self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 localDeclaration equals: assignedVariable. self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. usedVariable2 := model module statements fourth arguments first. - self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 localDeclaration equals: assignedVariable. self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsageInCall [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 1 print(x)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 3 {x: 2}'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second initializers first key. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'glob = 1 def fun(): @@ -451,100 +462,100 @@ def fun(): print(fun())'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'glob'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second statements first expression. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInLambda [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 1 lambda: x'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second expression. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInList [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 3 [ x ]'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second initializers first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInSet [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 3 { x }'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second initializers first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 3 (x, 2)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second initializers first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] @@ -630,7 +641,7 @@ func()'. { #category : 'tests - imports' } FASTPythonLocalResolverTest >> testImportedEntityWithAliasDoesNotShadowVariable [ - | import importedEntity call assignment assignedVariable usedVariable1 usedVariable2 | + | import importedEntity call assignedVariable usedVariable1 usedVariable2 | self parseAndResolve: 'x = 1 print(x) @@ -641,20 +652,21 @@ func() print(x)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 3. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable1 := model module statements second arguments first. - self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 localDeclaration equals: assignedVariable. self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. usedVariable2 := model module statements fifth arguments first. - self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 localDeclaration equals: assignedVariable. self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. import := model module statements third. @@ -693,23 +705,24 @@ FASTPythonLocalResolverTest >> testLambdaParameter [ { #category : 'tests - local variables' } FASTPythonLocalResolverTest >> testLocalVariableInFunction [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'def f(): x = 1 return x print(f())'. - assignment := model module statements first statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements first statements second expression. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] @@ -800,7 +813,7 @@ FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ - | parameter usedParameter assignment assignedVariable usedVariable | + | parameter usedParameter assignedVariable usedVariable | self parseAndResolve: 'def func(param): print(param) param = 3 @@ -817,176 +830,182 @@ FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ self assert: usedParameter localDeclaration equals: parameter. self assert: usedParameter equals: parameter localDeclaration localUses second. - assignment := model module statements first statements second. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'param'. + assignedVariable := model module statements first statements second left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'param'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements second. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements first statements third arguments first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ - | assignment1 assignment2 assignedVariable usedVariable | + | assignedVariable1 assignedVariable2 usedVariable | self parseAndResolve: 'x = 1 x = 2 x'. - assignment1 := model module statements first. - assignedVariable := assignment1 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable localDeclaration left name equals: 'x'. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + assignedVariable1 := model module statements first left. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'x'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self assert: assignedVariable1 localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 3. + self assert: assignedVariable1 localDeclaration localUses first equals: assignedVariable1. - assignment2 := model module statements second. - assignedVariable := assignment2 left. - self assert: assignedVariable localDeclaration equals: assignment1. - self assert: assignedVariable equals: assignedVariable localDeclaration localUses second. + assignedVariable2 := model module statements second left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable1. + self assert: assignedVariable2 equals: assignedVariable1 localDeclaration localUses second. usedVariable := model module statements third. - self assert: usedVariable localDeclaration equals: assignment1. - self assert: usedVariable equals: assignedVariable localDeclaration localUses third + self assert: usedVariable localDeclaration equals: assignedVariable1. + self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third ] { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoResolutionsDoNotClash [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'x = 1 print(x)'. "Do a second resolution to ensure the first one is cleared" FASTPythonLocalResolverVisitor resolve: model module. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ - | assignment assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] for x in fruits: pass'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'fruits'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'fruits'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. usedVariable := model module statements second right. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableAccessedInIf [ - | assignment assignedVariable usedVariable1 usedVariable2 | + | assignedVariable usedVariable1 usedVariable2 | self parseAndResolve: 'glob = 1 if glob < 3: print(glob)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'glob'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 3. usedVariable1 := model module statements second condition operands first. - self assert: usedVariable1 localDeclaration equals: assignment. + self assert: usedVariable1 localDeclaration equals: assignedVariable. self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. usedVariable2 := model module statements second thenClause statements first arguments first. - self assert: usedVariable2 localDeclaration equals: assignment. + self assert: usedVariable2 localDeclaration equals: assignedVariable. self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableDeclaredInFor [ - | assignement declared usedVariable | + | declared usedVariable | self parseAndResolve: 'for x in "banana": i = 2 print(i)'. - assignement := model module statements first statements first. - declared := assignement left. - self assert: declared localDeclaration equals: assignement. - self assert: declared localDeclaration left sourceCode equals: 'i'. - self assert: declared localDeclaration left isVariableWriteAccess. + declared := model module statements first statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'i'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. + self assert: declared localDeclaration isVariableWriteAccess. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignement. + self assert: usedVariable localDeclaration equals: declared. self assert: usedVariable equals: declared localDeclaration localUses second ] { #category : 'tests - while' } FASTPythonLocalResolverTest >> testVariableDeclaredInWhile [ - | assignement declared usedVariable | + | declared usedVariable | self parseAndResolve: 'while False: i = 2 print(i)'. - assignement := model module statements first statements first. - declared := assignement left. - self assert: declared localDeclaration equals: assignement. - self assert: declared localDeclaration left sourceCode equals: 'i'. + declared := model module statements first statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'i'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignement. + self assert: usedVariable localDeclaration equals: declared. self assert: usedVariable equals: declared localDeclaration localUses second ] { #category : 'tests - comprehensions' } FASTPythonLocalResolverTest >> testVariableInListComprehensions [ - | forClause declared usedVariable | + | declared usedVariable | self parseAndResolve: 'fruits = ["apple", "banana", "cherry", "kiwi", "mango"] [x for x in fruits]'. - forClause := model module statements second forClauses first. - declared := forClause left. - self assert: declared localDeclaration equals: forClause. - self assert: declared localDeclaration left sourceCode equals: 'x'. + declared := model module statements second forClauses first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements second forClauses first. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. usedVariable := model module statements second body. - self assert: usedVariable localDeclaration equals: forClause. + self assert: usedVariable localDeclaration equals: declared. self assert: usedVariable equals: declared localDeclaration localUses second ] @@ -994,7 +1013,7 @@ FASTPythonLocalResolverTest >> testVariableInListComprehensions [ FASTPythonLocalResolverTest >> testVariableInListComprehensionsDoesNotLeak [ "Here the x of the comprehension should not leek outside of it if we consider we are in Python 3" - | import importedEntity forClause declared usedVariable usedImportedEntity | + | import importedEntity declared usedVariable usedImportedEntity | self parseAndResolve: 'import x fruits = ["apple", "banana", "cherry", "kiwi", "mango"] @@ -1016,142 +1035,150 @@ print(x)'. self assert: usedImportedEntity localDeclaration equals: import. self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. - forClause := model module statements third forClauses first. - declared := forClause left. - self assert: declared localDeclaration equals: forClause. - self assert: declared localDeclaration left sourceCode equals: 'x'. + declared := model module statements third forClauses first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements third forClauses first. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. usedVariable := model module statements third body. - self assert: usedVariable localDeclaration equals: forClause. + self assert: usedVariable localDeclaration equals: declared. self assert: usedVariable equals: declared localDeclaration localUses second ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfFor [ - | for declared usedVariable | + | declared usedVariable | self parseAndResolve: 'for x in "banana": print(x)'. - for := model module statements first. - declared := for left. - self assert: declared localDeclaration equals: for. - self assert: declared localDeclaration left sourceCode equals: 'x'. - self assert: declared localDeclaration left isVariableWriteAccess. + declared := model module statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first. + self assert: declared localDeclaration isVariableWriteAccess. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. - usedVariable := for statements first arguments first. - self assert: usedVariable localDeclaration equals: for. + usedVariable := model module statements first statements first arguments first. + self assert: usedVariable localDeclaration equals: declared. self assert: usedVariable equals: declared localDeclaration localUses second ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForClashingWithOtherVariables [ - | assignation assignedVariable assignedVariableInFor usedVariable | + | assignedVariable assignedVariableInFor usedVariable | self parseAndResolve: 'x = 3 for x in range(5): print(x)'. - assignation := model module statements first. - assignedVariable := assignation left. - self assert: assignedVariable localDeclaration equals: assignation. - self assert: assignedVariable localDeclaration left sourceCode equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 3. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. assignedVariableInFor := model module statements second left. - self assert: assignedVariableInFor localDeclaration equals: assignation. + self assert: assignedVariableInFor localDeclaration equals: assignedVariable. self assert: assignedVariableInFor equals: assignedVariableInFor localDeclaration localUses second. usedVariable := model module statements second statements first arguments first. - self assert: usedVariable localDeclaration equals: assignation. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: usedVariable localDeclaration localUses third ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForRedefinedInside [ - | for declared usedVariable | + | declared usedVariable | self parseAndResolve: 'for x in range(5): x += 1'. - for := model module statements first. - declared := for left. - self assert: declared localDeclaration equals: for. - self assert: declared localDeclaration left sourceCode equals: 'x'. + declared := model module statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first. + self assert: declared localDeclaration isVariableWriteAccess. self deny: declared localDeclaration isNonLocalDeclaration. self assert: declared localDeclaration localUses size equals: 2. self assert: declared localDeclaration localUses first equals: declared. - usedVariable := for statements first left. - self assert: usedVariable localDeclaration equals: for. + usedVariable := model module statements first statements first left. + self assert: usedVariable localDeclaration equals: declared. self assert: usedVariable equals: declared localDeclaration localUses second ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ - | for assignedVariable usedVariable | + | assignedVariable usedVariable | self parseAndResolve: 'for x in range(5): pass print(x)'. - for := model module statements first. - assignedVariable := for left. - self assert: assignedVariable localDeclaration equals: for. - self assert: assignedVariable localDeclaration left sourceCode equals: 'x'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 2. self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: for. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: usedVariable localDeclaration localUses second ] { #category : 'tests - for' } FASTPythonLocalResolverTest >> testVariableOfForWithTuple [ - | for declaredA usedVariableA declaredB usedVariableB | + | declaredA usedVariableA declaredB usedVariableB | self parseAndResolve: 'for a, b in arg: print(a, b)'. - for := model module statements first. - declaredA := for left initializers first. - self assert: declaredA localDeclaration equals: for. - self assert: declaredA localDeclaration left sourceCode equals: 'a, b'. - self assert: declaredA localDeclaration left initializers first isVariableWriteAccess. - self assert: declaredA localDeclaration left initializers second isVariableWriteAccess. + declaredA := model module statements first left initializers first. + self assert: declaredA localDeclaration equals: declaredA. + self assert: declaredA localDeclaration name equals: 'a'. + self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. + self assert: declaredA localDeclaration isVariableWriteAccess. self deny: declaredA localDeclaration isNonLocalDeclaration. - self assert: declaredA localDeclaration localUses size equals: 4. + self assert: declaredA localDeclaration localUses size equals: 2. self assert: declaredA localDeclaration localUses first equals: declaredA. - declaredB := for left initializers second. - self assert: declaredB localDeclaration equals: for. - self assert: declaredB localDeclaration localUses second equals: declaredB. - - usedVariableA := for statements first arguments first. - self assert: usedVariableA localDeclaration equals: for. - self assert: usedVariableA equals: declaredA localDeclaration localUses third. - - usedVariableB := for statements first arguments second. - self assert: usedVariableB localDeclaration equals: for. - self assert: usedVariableB equals: declaredB localDeclaration localUses fourth + usedVariableA := model module statements first statements first arguments first. + self assert: usedVariableA localDeclaration equals: declaredA. + self assert: usedVariableA equals: declaredA localDeclaration localUses second. + + declaredB := model module statements first left initializers second. + self assert: declaredB localDeclaration equals: declaredB. + self assert: declaredB localDeclaration name equals: 'b'. + self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. + self assert: declaredB localDeclaration isVariableWriteAccess. + self deny: declaredB localDeclaration isNonLocalDeclaration. + self assert: declaredB localDeclaration localUses size equals: 2. + self assert: declaredB localDeclaration localUses first equals: declaredB. + + usedVariableB := model module statements first statements first arguments second. + self assert: usedVariableB localDeclaration equals: declaredB. + self assert: usedVariableB equals: declaredB localDeclaration localUses second ] { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ - | assignment assignedVariable assignedVariable2 usedVariable | + | assignedVariable assignedVariable2 usedVariable | self parseAndResolve: 'glob = 1 if True: @@ -1159,18 +1186,19 @@ if True: print(glob)'. - assignment := model module statements first. - assignedVariable := assignment left. - self assert: assignedVariable localDeclaration equals: assignment. - self assert: assignedVariable localDeclaration left name equals: 'glob'. + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. self deny: assignedVariable localDeclaration isNonLocalDeclaration. self assert: assignedVariable localDeclaration localUses size equals: 3. assignedVariable2 := model module statements second thenClause statements first left. - self assert: assignedVariable2 localDeclaration equals: assignment. + self assert: assignedVariable2 localDeclaration equals: assignedVariable. self assert: assignedVariable2 equals: assignedVariable localDeclaration localUses second. usedVariable := model module statements third arguments first. - self assert: usedVariable localDeclaration equals: assignment. + self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses third ] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st new file mode 100644 index 0000000..ad0c50c --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -0,0 +1,9 @@ +Extension { #name : 'FASTPyIdentifier' } + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> localResolverKind [ + + self isVariableWriteAccess ifTrue: [ ^ #variable ]. + + self halt +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index dc1901c..8acae27 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -150,7 +150,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ anIdentifier isVariableWriteAccess ifTrue: [ - ^ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier variableDeclarator ]. + ^ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier "We cannot put the right node because of the tuples" ]. self bind: anIdentifier toDeclarationNamed: anIdentifier name ] @@ -182,12 +182,3 @@ FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ self ensureDeclarationOf: aParameter named: aParameter name declaration: aParameter. super visitFASTPyParameter: aParameter ] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyVariable: aVariable [ - "We are declaring a variable in an assignation" - - aVariable parentAssignmentLeft ifNotNil: [ :assignment | ^ self ensureDeclarationOf: aVariable named: aVariable name declaration: assignment ]. - - super visitFASTPyVariable: aVariable -] From 228eb50a931dfe91ac4e43b3b4acf3716a981cf6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 18:56:01 +0200 Subject: [PATCH 065/151] Clean dead code --- src/FAST-Python-Tools/FASTPyAssignment.extension.st | 6 ------ src/FAST-Python-Tools/FASTPyForStatement.extension.st | 6 ------ 2 files changed, 12 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st index de4a9f3..1c0eee3 100644 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -5,9 +5,3 @@ FASTPyAssignment >> localDeclarationName [ ^ left localDeclarationName ] - -{ #category : '*FAST-Python-Tools' } -FASTPyAssignment >> localResolverKind [ - - ^ #variable -] diff --git a/src/FAST-Python-Tools/FASTPyForStatement.extension.st b/src/FAST-Python-Tools/FASTPyForStatement.extension.st index 46cf5fd..873d754 100644 --- a/src/FAST-Python-Tools/FASTPyForStatement.extension.st +++ b/src/FAST-Python-Tools/FASTPyForStatement.extension.st @@ -5,9 +5,3 @@ FASTPyForStatement >> localDeclarationName [ ^ left localDeclarationName ] - -{ #category : '*FAST-Python-Tools' } -FASTPyForStatement >> localResolverKind [ - - ^ #variable -] From aa675c3af66465a134b33828617f6d32adcefbd4 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 30 Jul 2026 18:56:29 +0200 Subject: [PATCH 066/151] SSA: Begin to handle Tuples in for declaration --- .../FASTPythonSSATest.class.st | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 46e451e..1da0955 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -32,6 +32,28 @@ FASTPythonSSATest >> testForVariableUsed [ self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariablesInTupleUsed [ + + | assignedVarA assignedVarB usedVarA usedVarB | + self parseAndResolve: 'for a, b in data: + print(a, b)'. + + assignedVarA := model module statements first left initializers first. + self assert: assignedVarA ssaVersion version equals: 1. + self assert: assignedVarA ssaName equals: 'a_1'. + + usedVarA := model module statements first statements first arguments first. + self assert: assignedVarA ssaVersion identicalTo: assignedVarA ssaVersion. + + assignedVarB := model module statements first left initializers second. + self assert: assignedVarB ssaVersion version equals: 1. + self assert: assignedVarB ssaName equals: 'b_1'. + + usedVarB := model module statements first statements first arguments first. + self assert: assignedVarB ssaVersion identicalTo: assignedVarB ssaVersion +] + { #category : 'tests - parameters' } FASTPythonSSATest >> testParameterUsed [ From 333f666e5abdf3ab3763367f5f8ec3bc9430266a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 31 Jul 2026 10:10:19 +0200 Subject: [PATCH 067/151] Test local variables with tuples --- .../FASTPythonLocalResolverTest.class.st | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 84ec2c6..cc6824e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -726,6 +726,40 @@ print(f())'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - local variables' } +FASTPythonLocalResolverTest >> testLocalVariableInFunctionWithTuples [ + + | assignedVariableX assignedVariableY usedVariable | + self parseAndResolve: 'def f(): + x, y = 1, 2 + return x + +print(f())'. + + assignedVariableX := model module statements first statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariableX. + self assert: usedVariable equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + +] + { #category : 'tests - methods' } FASTPythonLocalResolverTest >> testMethodRedefined [ From f8c15a1e2c4a2634a3c25dc840b0de1508683e8d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 31 Jul 2026 15:27:35 +0200 Subject: [PATCH 068/151] =?UTF-8?q?LR:=E2=80=AFManage=20assignment=20of=20?= =?UTF-8?q?tuples=20in=20tuples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPyIdentifier.class.st | 18 ------- .../FASTPythonLocalResolverTest.class.st | 50 +++++++++++++++++++ .../FASTPyAssignment.extension.st | 2 +- .../FASTPyForStatement.extension.st | 2 +- .../FASTPyIdentifier.extension.st | 20 +++++++- 5 files changed, 71 insertions(+), 21 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index fc3dcf0..17ff4de 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -47,21 +47,3 @@ FASTPyIdentifier class >> annotation [ ] - -{ #category : 'testing' } -FASTPyIdentifier >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment." - - | node | - "In case I'm in a tuple, I should do the checks for the tuple instead of me." - node := self. - self collectionInitializer ifNotNil: [ :collection | collection isTuple ifTrue: [ node := collection ] ]. - - node parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. - - node parentForStatementLeft ifNotNil: [ :for | ^ for ]. - - node parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. - - ^ super variableDeclarator -] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index cc6824e..6509491 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -48,6 +48,56 @@ print(x)'. self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToTupleInTuples [ + + | assignedVariableX assignedVariableY assignedVariableZ usedVariableX usedVariableY usedVariableZ | + self parseAndResolve: 'x, (y, z) = 1, (2, 4) + +print(x) +print(y) +print(z)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second initializers first. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 2. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + + usedVariableY := model module statements third arguments first. + self assert: usedVariableY localDeclaration equals: assignedVariableY. + self assert: usedVariableY equals: assignedVariableY localDeclaration localUses second. + + assignedVariableZ := model module statements first left initializers second initializers second. + self assert: assignedVariableZ localDeclaration equals: assignedVariableZ. + self assert: assignedVariableZ localDeclaration name equals: 'z'. + self assert: assignedVariableZ localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableZ localDeclaration isVariableWriteAccess. + self deny: assignedVariableZ localDeclaration isNonLocalDeclaration. + self assert: assignedVariableZ localDeclaration localUses size equals: 2. + self assert: assignedVariableZ localDeclaration localUses first equals: assignedVariableZ. + + usedVariableZ := model module statements fourth arguments first. + self assert: usedVariableZ localDeclaration equals: assignedVariableZ. + self assert: usedVariableZ equals: assignedVariableZ localDeclaration localUses second +] + { #category : 'tests - non local declarations' } FASTPythonLocalResolverTest >> testAttributeAccessHalfResolved [ "Here x is resolved but y is not resolved locally." diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st index 1c0eee3..dba7ef8 100644 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ b/src/FAST-Python-Tools/FASTPyAssignment.extension.st @@ -2,6 +2,6 @@ Extension { #name : 'FASTPyAssignment' } { #category : '*FAST-Python-Tools' } FASTPyAssignment >> localDeclarationName [ - +self halt. ^ left localDeclarationName ] diff --git a/src/FAST-Python-Tools/FASTPyForStatement.extension.st b/src/FAST-Python-Tools/FASTPyForStatement.extension.st index 873d754..326c519 100644 --- a/src/FAST-Python-Tools/FASTPyForStatement.extension.st +++ b/src/FAST-Python-Tools/FASTPyForStatement.extension.st @@ -2,6 +2,6 @@ Extension { #name : 'FASTPyForStatement' } { #category : '*FAST-Python-Tools' } FASTPyForStatement >> localDeclarationName [ - +self halt. ^ left localDeclarationName ] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st index ad0c50c..e73ab50 100644 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -5,5 +5,23 @@ FASTPyIdentifier >> localResolverKind [ self isVariableWriteAccess ifTrue: [ ^ #variable ]. - self halt + self halt "I don't know if it can be something else." +] + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + | assignedNode | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + assignedNode := self. + [ assignedNode collectionInitializer isNotNil and: [ assignedNode collectionInitializer isTuple ] ] whileTrue: [ assignedNode := assignedNode collectionInitializer ]. + + assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. + + assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. + + ^ super variableDeclarator ] From f6797207613c6c0082db38691fe3d1ac3032d993 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 31 Jul 2026 15:28:04 +0200 Subject: [PATCH 069/151] Add tests on SSA of tuples assignments and tuples in tuples assignments --- .../FASTPythonSSATest.class.st | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 1da0955..469819c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -98,6 +98,40 @@ print(x)'. self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testTupleAssignement [ + + | assignedVarX assignedVarY | + self parseAndResolve: 'x, y = 5, 6'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1' +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testTupleInTupleAssignement [ + + | assignedVarX assignedVarY assignedVarZ | + self parseAndResolve: 'x, (y, z) = 5, (6, 7)'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second initializers first. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1'. + + assignedVarZ := model module statements first left initializers second initializers second. + self assert: assignedVarZ ssaVersion version equals: 1. + self assert: assignedVarZ ssaName equals: 'z_1' +] + { #category : 'tests - non local declarations' } FASTPythonSSATest >> testUndeclaredVariable [ From 396a200a24ceb489d44b4da2dcff2508ccef90e2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 31 Jul 2026 15:28:48 +0200 Subject: [PATCH 070/151] Remove dead code --- src/FAST-Python-Tools/FASTPyAssignment.extension.st | 7 ------- src/FAST-Python-Tools/FASTPyForStatement.extension.st | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTPyAssignment.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPyForStatement.extension.st diff --git a/src/FAST-Python-Tools/FASTPyAssignment.extension.st b/src/FAST-Python-Tools/FASTPyAssignment.extension.st deleted file mode 100644 index dba7ef8..0000000 --- a/src/FAST-Python-Tools/FASTPyAssignment.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTPyAssignment' } - -{ #category : '*FAST-Python-Tools' } -FASTPyAssignment >> localDeclarationName [ -self halt. - ^ left localDeclarationName -] diff --git a/src/FAST-Python-Tools/FASTPyForStatement.extension.st b/src/FAST-Python-Tools/FASTPyForStatement.extension.st deleted file mode 100644 index 326c519..0000000 --- a/src/FAST-Python-Tools/FASTPyForStatement.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTPyForStatement' } - -{ #category : '*FAST-Python-Tools' } -FASTPyForStatement >> localDeclarationName [ -self halt. - ^ left localDeclarationName -] From f33275cabc644c1ad8865e8959a2e2be02e373ea Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 31 Jul 2026 17:07:29 +0200 Subject: [PATCH 071/151] Start to manage read accesses in SSA --- .../FASTPythonSSATest.class.st | 22 +++++++++++++------ .../FASTPythonSSAVisitor.class.st | 17 ++++++++++++-- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 469819c..ac5a957 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -27,9 +27,10 @@ FASTPythonSSATest >> testForVariableUsed [ assignedVar := model module statements first left. self assert: assignedVar ssaVersion version equals: 1. self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. usedVar := model module statements first statements first arguments first. - self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] { #category : 'tests - for' } @@ -42,16 +43,18 @@ FASTPythonSSATest >> testForVariablesInTupleUsed [ assignedVarA := model module statements first left initializers first. self assert: assignedVarA ssaVersion version equals: 1. self assert: assignedVarA ssaName equals: 'a_1'. + self assert: assignedVarA ssaVersion localUses size equals: 2. usedVarA := model module statements first statements first arguments first. - self assert: assignedVarA ssaVersion identicalTo: assignedVarA ssaVersion. + self assert: usedVarA ssaVersion identicalTo: assignedVarA ssaVersion. assignedVarB := model module statements first left initializers second. self assert: assignedVarB ssaVersion version equals: 1. self assert: assignedVarB ssaName equals: 'b_1'. + self assert: assignedVarB ssaVersion localUses size equals: 2. - usedVarB := model module statements first statements first arguments first. - self assert: assignedVarB ssaVersion identicalTo: assignedVarB ssaVersion + usedVarB := model module statements first statements first arguments second. + self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion ] { #category : 'tests - parameters' } @@ -64,9 +67,10 @@ FASTPythonSSATest >> testParameterUsed [ parameterDeclaration := model module statements first parameters first. self assert: parameterDeclaration ssaVersion version equals: 1. self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. parameterUsage := model module statements first statements first arguments first. - self assert: parameterDeclaration ssaVersion identicalTo: parameterDeclaration ssaVersion + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] { #category : 'tests - assignments' } @@ -79,7 +83,9 @@ FASTPythonSSATest >> testSingleAssignement [ self assert: assignedVar ssaVersion version equals: 1. self assert: assignedVar ssaName equals: 'x_1'. - self assert: assignedVar localDeclaration newVersionNumber equals: 2 + self assert: assignedVar localDeclaration newVersionNumber equals: 2. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 ] { #category : 'tests - assignments' } @@ -93,9 +99,11 @@ print(x)'. assignedVar := model module statements first left. self assert: assignedVar ssaVersion version equals: 1. self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. usedVar := model module statements second arguments first. - self assert: assignedVar ssaVersion identicalTo: assignedVar ssaVersion + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] { #category : 'tests - assignments' } diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 496fd13..aee5663 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -67,10 +67,23 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ ^ aCFGBlockOrFASTEntity ifNotNil: [ aCFGBlockOrFASTEntity accept: self ] ] +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + "Reordering for parameters to be visited before the statements in order to have all declarations" + + self visitFASTTWithParameters: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition +] + { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - anIdentifier isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: anIdentifier ]. + anIdentifier isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anIdentifier ]. + + anIdentifier localDeclaration isNonLocalDeclaration ifFalse: [ anIdentifier ssaVersion: anIdentifier localDeclaration activeVersion ]. super visitFASTPyIdentifier: anIdentifier ] @@ -79,7 +92,7 @@ FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" - aParameter localDeclaration isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: aParameter ]. + aParameter isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: aParameter ]. super visitFASTPyParameter: aParameter ] From 73b1b63b6605d91df7b8ff726209a4363dde12af Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 3 Aug 2026 14:50:50 +0200 Subject: [PATCH 072/151] Test reassignment of variables --- .../FASTPythonSSATest.class.st | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index ac5a957..3e78b4f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -73,6 +73,62 @@ FASTPythonSSATest >> testParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignement [ + + | assignedVar1 assignedVar2 | + self parseAndResolve: 'x = 3 + +x = 4'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementAndUsage [ + + | assignedVar1 assignedVar2 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +print(x) + + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements second arguments first. + self deny: usedVar1 ssaVersion isPhi. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + assignedVar2 := model module statements third left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fourth arguments first. + self deny: usedVar2 ssaVersion isPhi. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ From 61eb236df660b95bcb5a4d677480009d807011b8 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 3 Aug 2026 16:19:27 +0200 Subject: [PATCH 073/151] Begin to manage phi versions (WIP) --- .../FASTPythonSSATest.class.st | 23 ++++++++ .../FASTPythonSSAVisitor.class.st | 58 +++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 3e78b4f..bd51594 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -129,6 +129,29 @@ print(x)'. self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInIf [ + + | assignedVar1 assignedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1 +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index aee5663..888e57e 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -17,6 +17,16 @@ FASTPythonSSAVisitor class >> resolve: aPythonEntity [ ^ self new resolve: aPythonEntity ] +{ #category : 'visiting' } +FASTPythonSSAVisitor >> createPhiVersionFor: localDeclaration versions: allVersions [ + "No need to add it to the versions since it was already added by the previous versions." + + | phiVersion | + phiVersion := FASTVariablePhiVersionSSA for: allVersions. + localDeclaration activeVersion: phiVersion. + ^ phiVersion +] + { #category : 'actions' } FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ @@ -31,6 +41,12 @@ FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ ^ newSSA ] +{ #category : 'accessing' } +FASTPythonSSAVisitor >> currentActiveVersions [ + + ^ variableVersions collect: #activeVersion +] + { #category : 'actions' } FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ @@ -46,6 +62,30 @@ FASTPythonSSAVisitor >> initialize [ variableVersions := IdentitySet new ] +{ #category : 'visiting' } +FASTPythonSSAVisitor >> producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap [ + + | declarationsToMerge | + declarationsToMerge := newVariablesMap values flatten collectAsSet: #localDeclaration. + + declarationsToMerge do: [ :localDeclaration | + | allVersions | + "First we collect all the versions to use to produce a new Phi version for the current local declaration. " + allVersions := Set new. + newVariablesMap valuesDo: [ :variables | + variables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. + + "If not all branches are creating a new version, we need to add the previous version also to the list of variables for the Phi variable. Note that it is possible it did not exist before." + allVersions size = newVariablesMap size ifFalse: [ + previousVariables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. + + self createPhiVersionFor: localDeclaration versions: allVersions ] +] + { #category : 'actions' } FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ @@ -67,6 +107,24 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ ^ aCFGBlockOrFASTEntity ifNotNil: [ aCFGBlockOrFASTEntity accept: self ] ] +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitCFGAbstractConditionalBlock: aBlock [ + + | previousVariables newVariablesMap | + self visitedBlocks add: aBlock. + + aBlock statements do: [ :statement | statement accept: self ]. + + previousVariables := self currentActiveVersions. "We need to do this after visiting the statements that could produce new variables." + newVariablesMap := IdentityDictionary new. + + aBlock nextBlocks do: [ :block | + (self visitedBlocks includes: block) ifFalse: [ block accept: self ]. + newVariablesMap at: block put: (self currentActiveVersions difference: previousVariables) ]. + + self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap +] + { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ "Reordering for parameters to be visited before the statements in order to have all declarations" From f8a247917c06330e3ece0d3f1198e34b045309c0 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 4 Aug 2026 10:05:15 +0200 Subject: [PATCH 074/151] Add broken code to save it while I work on another branch --- .../FASTPythonSSATest.class.st | 31 +++++++++++++++++++ .../FASTPythonSSAVisitor.class.st | 10 +++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index bd51594..f55ecbf 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -152,6 +152,37 @@ if y < 2: self assert: assignedVar2 ssaVersion localUses size equals: 1 ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInIfAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 888e57e..daaa090 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -110,16 +110,18 @@ FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ { #category : 'visiting' } FASTPythonSSAVisitor >> visitCFGAbstractConditionalBlock: aBlock [ - | previousVariables newVariablesMap | - self visitedBlocks add: aBlock. + | previousVariables newVariablesMap firstCommonChild reacheableBlocksByBranch | + self visitCFGAbstractBlock: aBlock. - aBlock statements do: [ :statement | statement accept: self ]. + reacheableBlocksByBranch := aBlock nextBlocks collect: [ :block | block withAllFollowingBlocks ]. + + firstCommonChild := self findClosestMergePointIn: reacheableBlocksByBranch for: aBlock. previousVariables := self currentActiveVersions. "We need to do this after visiting the statements that could produce new variables." newVariablesMap := IdentityDictionary new. aBlock nextBlocks do: [ :block | - (self visitedBlocks includes: block) ifFalse: [ block accept: self ]. + self visit: block. newVariablesMap at: block put: (self currentActiveVersions difference: previousVariables) ]. self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap From 2dd40e522c75c938558894ae103d5da0e2eb80d9 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 4 Aug 2026 10:36:31 +0200 Subject: [PATCH 075/151] Support merge block in CFG --- README.md | 88 - .../FASTPythonMetamodelGenerator.class.st | 2 - src/FAST-Python-Model/FASTPyEntity.class.st | 7 - .../FASTPyIdentifier.class.st | 13 +- .../FASTPyImportedEntity.class.st | 6 - src/FAST-Python-Model/FASTPyTVisitor.trait.st | 5 +- src/FAST-Python-Model/FASTPyTuple.class.st | 7 - .../FASTPythonAbstractTestCase.class.st | 5 +- .../FASTPythonCFGTest.class.st | 305 ++- .../FASTPythonImporterTest.class.st | 2237 ++++------------- .../FASTPythonLocalResolverTest.class.st | 1288 ---------- .../FASTPythonSSATest.class.st | 261 -- .../FASTPyEntity.extension.st | 26 - .../FASTPyIdentifier.extension.st | 27 - .../FASTPyImport.extension.st | 7 - .../FASTPyMethodDefinition.extension.st | 7 - .../FASTPyParameter.extension.st | 14 - .../FASTPythonCFGVisitor.class.st | 4 +- .../FASTPythonLRScope.class.st | 57 - .../FASTPythonLocalResolverVisitor.class.st | 184 -- .../FASTPythonSSAVisitor.class.st | 158 -- .../FASTPythonTreeSitterVisitor.class.st | 15 +- .../FASTTEntity.extension.st | 14 - .../ManifestFASTPythonTools.class.st | 17 - 24 files changed, 659 insertions(+), 4095 deletions(-) delete mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st delete mode 100644 src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st delete mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPyImport.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPyParameter.extension.st delete mode 100644 src/FAST-Python-Tools/FASTPythonLRScope.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st delete mode 100644 src/FAST-Python-Tools/FASTTEntity.extension.st delete mode 100644 src/FAST-Python-Tools/ManifestFASTPythonTools.class.st diff --git a/README.md b/README.md index 7864658..0a8a9f1 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,6 @@ Famix AST representation for Python based on TreeSitter - - -- [FAST-Python](#fast-python) - - [Installation](#installation) - - [Quick start](#quick-start) - - [Documentation](#documentation) - - [Control flow graph](#control-flow-graph) - - [Local resolutions](#local-resolutions) - - [Shadowing](#shadowing) - - [Limitations](#limitations) - - [Separated dotted names](#separated-dotted-names) - - [Access to non local entities](#access-to-non-local-entities) - - [Python 2 management](#python-2-management) - - [Moose versions compatibility](#moose-versions-compatibility) - - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) - - [Python version compatibility](#python-version-compatibility) - - [Contact](#contact) - - - ## Installation To install this project on your Pharo image, execute the following script: @@ -84,74 +64,6 @@ A CFG can be done on a function, method, class, module or lambda. You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` -## Local resolutions - -It is possible to apply a local name resolution on a FAST-Python model by executing this piece of code: - -```smalltalk -FASTPythonLocalResolverVisitor resolve: model module "Can be any behavioral entity" -``` - -Once this is executed, all nodes resolved will be able to provide a `#localDeclaration` pointing to the declaration/first use of the entity. This local declaration also knows all the `#localUses` of the entity. - -The local declaration can be multiple things such as: -- An assignement -- A function/class/method declaration -- An import -- A parameter declaration -- A for loop to declare a variable -- ... - -### Shadowing - -In Python anything named can shadow anything named. For example we can declare a global variable then shadow it with an import, then shadow it with a function... - -In the case of a shadowing, we manage it in two distinct ways: -- If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration -- If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration - -### Limitations - -This project has a few limitations. - -#### Separated dotted names - -In case we have a dotted name but we do not use the same way to declare it, we are currently not keeping track of the declaration. For example, ßhis kind of uses are not supported: - -```python -a.b.c = 3 -d = a.b -print(d.c) -``` - -Here `a.b.c` will have a local declaration, but it will not know that`d.c` is a local use of this declared variable. - -#### Access to non local entities - -If the code has access to entities that we do not know, then we create a `FASTNonLocalDeclaration`. For example: - -```python -import x - -x.y -``` - -Here, in the expression `x.y` we will be able to link `x` to its declaration in the import, but we have no declaration for y since this is done in another project. -In that case, we associate it to a non local declaration. - -But, this has the current limit that if you access multiple times this `y` field of `x`, then each of them ill have their own non local declaration. -This is not the way I would like the project to work and this could be improved by having all references point to the same non local declaration object, but we need time for this :) - -See (https://github.com/moosetechnology/FAST-Python/issues/26)[https://github.com/moosetechnology/FAST-Python/issues/26] - -#### Python 2 management - -Currently, the Local resolver is based on Python 3. In the future we should add the support for Python 2 and let the user configure his version of Python. - -This has an influence for example on the scope of comprehensions. In Python 2 comprehensions do not have any scope and the variable declared in it leak while in Python 3 there is a scope and the variable does not leak. - -See (https://github.com/moosetechnology/FAST-Python/issues/27)[https://github.com/moosetechnology/FAST-Python/issues/27] - ## Moose versions compatibility | Version | Compatible Moose versions | diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index c8de6d7..5a4ca7d 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -333,7 +333,6 @@ FASTPythonMetamodelGenerator >> defineClasses [ thenClause := builder newClassNamed: #ThenClause. tryStatement := builder newClassNamed: #TryStatement. tuple := builder newClassNamed: #Tuple. - tuple withTesting. type := builder newClassNamed: #Type. typeAliasStatement := builder newClassNamed: #TypeAliasStatement. typeConversion := builder newClassNamed: #TypeConversion. @@ -488,7 +487,6 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ identifier --|> tReturnReferenceable. identifier --|> tAsPatternTarget. identifier --|> tSplatParameterTarget. - identifier --|> tNamedEntity. ifClause --|> expression. "This is wrong! I am just here temporarily until we rework the relation to the for in clause (I need to be able to be a clause of a list comprehension)" diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 9c851de..97ffa8b 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -148,13 +148,6 @@ FASTPyEntity >> isStringLiteral [ ^ false ] -{ #category : 'testing' } -FASTPyEntity >> isTuple [ - - - ^ false -] - { #category : 'testing' } FASTPyEntity >> isVariableEntity [ diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 17ff4de..949880f 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -6,7 +6,6 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `caller` | `FASTPyTCallable` | `callee` | `FASTPyCall` | The call entity calling me (if it's the case)| -| `invokedIn` | `FASTTNamedEntity` | `invoked` | `FASTTInvocation` | Optional invocation where this name is used| | `parentAsPatternSource` | `FASTPyTAsPatternSource` | `source` | `FASTPyAsPattern` | | | `parentAsPatternTarget` | `FASTPyTAsPatternTarget` | `target` | `FASTPyAsPattern` | | | `parentAssignmentLeft` | `FASTPyTAssignable` | `left` | `FASTPyAssignment` | | @@ -20,21 +19,13 @@ | `parentSplatParameter` | `FASTPyTSplatParameterTarget` | `target` | `FASTPySplatParameter` | | -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `name` | `String` | nil | | -| `startPos` | `Number` | nil | | " Class { #name : 'FASTPyIdentifier', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' diff --git a/src/FAST-Python-Model/FASTPyImportedEntity.class.st b/src/FAST-Python-Model/FASTPyImportedEntity.class.st index f5c8600..be0334c 100644 --- a/src/FAST-Python-Model/FASTPyImportedEntity.class.st +++ b/src/FAST-Python-Model/FASTPyImportedEntity.class.st @@ -53,12 +53,6 @@ FASTPyImportedEntity >> alias: anObject [ alias := anObject ] -{ #category : 'testing' } -FASTPyImportedEntity >> hasAlias [ - - ^ self alias isNotNil -] - { #category : 'accessing' } FASTPyImportedEntity >> import [ "Relation named: #import type: #FASTPyImport opposite: #importedEntities" diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 12d25dc..6eece1e 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -491,7 +491,6 @@ FASTPyTVisitor >> visitFASTPyIdentifier: anIdentifier [ self visitFASTPyTAsPatternTarget: anIdentifier. self visitFASTPyTReturnReferenceable: anIdentifier. self visitFASTPyTSplatParameterTarget: anIdentifier. - self visitFASTTNamedEntity: anIdentifier. self visitFASTPyExpression: anIdentifier ] @@ -1296,9 +1295,7 @@ FASTPyTVisitor >> visitFASTTStringLiteral: aTStringLiteral [ FASTPyTVisitor >> visitFASTTVariableEntity: aTVariableEntity [ - "We do not visit all behaviorals because some classes already visit it in their superclasses in this language implementation. Visiting them here also would cause a double visit of this trait." - ({ FASTPyVariable } includes: aTVariableEntity class) - ifFalse: [ self visitFASTTNamedEntity: aTVariableEntity ]. + self visitFASTTNamedEntity: aTVariableEntity. ] diff --git a/src/FAST-Python-Model/FASTPyTuple.class.st b/src/FAST-Python-Model/FASTPyTuple.class.st index 4a059d7..6f59475 100644 --- a/src/FAST-Python-Model/FASTPyTuple.class.st +++ b/src/FAST-Python-Model/FASTPyTuple.class.st @@ -30,10 +30,3 @@ FASTPyTuple class >> annotation [ ] - -{ #category : 'testing' } -FASTPyTuple >> isTuple [ - - - ^ true -] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st index 07b2367..72f2c13 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st @@ -1,9 +1,8 @@ Class { #name : 'FASTPythonAbstractTestCase', #superclass : 'TestCase', - #category : 'FAST-Python-Tools-Tests-Core', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Core' + #category : 'FAST-Python-Tools-Tests', + #package : 'FAST-Python-Tools-Tests' } { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 47b8e99..535c4d7 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -4,9 +4,8 @@ Class { #instVars : [ 'startBlock' ], - #category : 'FAST-Python-Tools-Tests-Algos', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Algos' + #category : 'FAST-Python-Tools-Tests', + #package : 'FAST-Python-Tools-Tests' } { #category : 'running' } @@ -175,10 +174,11 @@ FASTPythonCFGTest >> testFunctionWithFor [ self assert: forBlock statements size equals: 1. self assert: (forBlock statements first isOfType: FASTPyCall). self assert: forBlock nextBlock equals: startBlock. - + nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -195,7 +195,7 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock statements first class isOfType: FASTPyCall). - + forCondition := startBlock nextBlock. self assert: forCondition isConditional. self deny: forCondition isFinal. @@ -214,7 +214,8 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement nullBlock := forCondition nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: forCondition mergeBlock ] { #category : 'tests - for' } @@ -245,7 +246,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreak [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: forBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -285,7 +287,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -332,7 +335,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -381,7 +385,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -433,7 +438,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. self assert: elseBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -506,7 +512,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -573,7 +580,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ self assert: lastBlock equals: elifBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -629,7 +637,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -660,7 +669,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinue [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -700,7 +710,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -747,7 +758,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -796,7 +808,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -848,7 +861,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseCon nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -921,7 +935,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContin self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -988,7 +1003,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndEls self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -1044,7 +1060,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -1082,7 +1099,8 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ nullBlock := elseBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock isFinal. - self assert: nullBlock equals: forBlock nextBlock + self assert: nullBlock equals: forBlock nextBlock. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - for' } @@ -1128,7 +1146,8 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ nullBlock := elseBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock isFinal. - self assert: nullBlock equals: thenBlock nextBlock + self assert: nullBlock equals: startBlock mergeBlock. + self assert: nullBlock equals: forBlock mergeBlock ] { #category : 'tests - for' } @@ -1160,7 +1179,7 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ self deny: elseBlock isNullBlock. self assert: elseBlock isFinal. self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + self assert: (elseBlock statements first isOfType: FASTPyPassStatement) ] { #category : 'tests - for' } @@ -1241,7 +1260,8 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ self assert: lastBlock equals: thenBlock2 nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1296,6 +1316,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self assert: endOfElifBlock equals: thenBlock2 nextBlock. self assert: endOfElifBlock statements size equals: 1. self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + self assert: endOfElifBlock equals: ifConditionalBlock2 mergeBlock. lastBlock := thenBlock nextBlock. self deny: lastBlock isNullBlock. @@ -1303,7 +1324,8 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self assert: lastBlock equals: elifConditionalBlock nextFalseBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1360,6 +1382,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ self assert: endOfElifBlock equals: thenBlock2 nextBlock. self assert: endOfElifBlock statements size equals: 1. self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + self assert: endOfElifBlock equals: ifConditionalBlock2 mergeBlock. elseBlock := elifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. @@ -1373,7 +1396,8 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1403,7 +1427,8 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ nextBlock := startBlock nextFalseBlock. self deny: nextBlock isNullBlock. self assert: nextBlock identicalTo: thenBlock nextBlock. - self assert: nextBlock isFinal + self assert: nextBlock isFinal. + self assert: nextBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1432,7 +1457,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1462,7 +1488,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: returnBlock identicalTo: thenBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. - self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement). + self assert: returnBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1505,7 +1532,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ self assert: nullBlock identicalTo: thenBlock nextBlock. self assert: nullBlock identicalTo: elifConditionBlock nextFalseBlock. self assert: nullBlock identicalTo: elifBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1544,7 +1572,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ self deny: elifBlock isFinal. self assert: elifBlock statements size equals: 1. self assert: (elifBlock statements first isOfType: FASTPyPassStatement). - + elifConditionBlock2 := elifConditionBlock nextFalseBlock. self assert: elifConditionBlock2 isConditional. self deny: elifConditionBlock2 isFinal. @@ -1556,13 +1584,14 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ self deny: elifBlock2 isFinal. self assert: elifBlock2 statements size equals: 1. self assert: (elifBlock2 statements first isOfType: FASTPyCall). - + nullBlock := thenBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: elifBlock nextBlock. self assert: nullBlock identicalTo: elifConditionBlock2 nextFalseBlock. self assert: nullBlock identicalTo: elifBlock2 nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1603,7 +1632,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ self deny: elifBlock isFinal. self assert: elifBlock statements size equals: 1. self assert: (elifBlock statements first isOfType: FASTPyPassStatement). - + elifConditionBlock2 := elifConditionBlock nextFalseBlock. self assert: elifConditionBlock2 isConditional. self deny: elifConditionBlock2 isFinal. @@ -1621,13 +1650,14 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. self assert: (elseBlock statements first isOfType: FASTPyCall). - + nullBlock := thenBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: elifBlock nextBlock. self assert: nullBlock identicalTo: elifBlock2 nextBlock. self assert: nullBlock identicalTo: elseBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1677,7 +1707,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextBlock. self assert: nullBlock identicalTo: elifBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1717,7 +1748,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: returnBlock identicalTo: elseBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. - self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement). + self assert: returnBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1754,7 +1786,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ nullBlock := thenBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: elseBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1792,7 +1825,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: returnBlock identicalTo: elseBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. - self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement). + self assert: returnBlock equals: startBlock mergeBlock ] { #category : 'tests - if' } @@ -1825,7 +1859,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self deny: thenBlock2 isFinal. self assert: thenBlock2 statements size equals: 1. self assert: (thenBlock2 statements first isOfType: FASTPyCall). - + elseBlock := thenBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. @@ -1836,7 +1870,9 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock2 nextBlock. self assert: nullBlock identicalTo: elseBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock. + self assert: nullBlock equals: thenBlock mergeBlock ] { #category : 'tests - if' } @@ -1872,7 +1908,9 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextFalseBlock. self assert: nullBlock identicalTo: thenBlock2 nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock. + self assert: nullBlock equals: thenBlock mergeBlock ] { #category : 'tests - if' } @@ -1916,7 +1954,9 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: elseBlock nextBlock. self assert: nullBlock identicalTo: thenBlock2 nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock. + self assert: nullBlock equals: thenBlock mergeBlock ] { #category : 'tests - match' } @@ -1971,7 +2011,8 @@ FASTPythonCFGTest >> testFunctionWithMatch [ self assert: lastBlock equals: defaultCase nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - match' } @@ -2018,7 +2059,8 @@ FASTPythonCFGTest >> testFunctionWithMatchWith2IdenticalCase [ self assert: lastBlock equals: defaultCase nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - match' } @@ -2076,7 +2118,8 @@ FASTPythonCFGTest >> testFunctionWithMatchWithCondition [ self assert: lastBlock equals: defaultCase nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests' } @@ -2163,7 +2206,8 @@ FASTPythonCFGTest >> testFunctionWithTry [ self assert: lastBlock equals: exceptBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: tryBlock mergeBlock ] { #category : 'tests - try' } @@ -2229,7 +2273,8 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ self assert: lastBlock equals: exceptBlock3 nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: tryBlock mergeBlock ] { #category : 'tests - try' } @@ -2290,13 +2335,13 @@ FASTPythonCFGTest >> testFunctionWithTryWithElse [ self assert: (exceptBlock3 statements first isOfType: FASTPyCall). - self assert: ((tryBlock patterns at: 4) isNil). + self assert: (tryBlock patterns at: 4) isNil. elseBlock := tryBlock nextBlocks at: 4. self deny: elseBlock isConditional. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. self assert: (elseBlock statements first isOfType: FASTPyCall). - + lastBlock := elseBlock nextBlock. self deny: lastBlock isNullBlock. self assert: lastBlock equals: exceptBlock nextBlock. @@ -2304,7 +2349,8 @@ FASTPythonCFGTest >> testFunctionWithTryWithElse [ self assert: lastBlock equals: exceptBlock3 nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: tryBlock mergeBlock ] { #category : 'tests - try' } @@ -2381,7 +2427,8 @@ FASTPythonCFGTest >> testFunctionWithTryWithElseAndFinally [ self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 2. self assert: (lastBlock statements first isOfType: FASTPyCall). - self assert: (lastBlock statements second isOfType: FASTPyCall) + self assert: (lastBlock statements second isOfType: FASTPyCall). + self assert: lastBlock equals: tryBlock mergeBlock ] { #category : 'tests - try' } @@ -2441,7 +2488,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithFinally [ self assert: exceptBlock3 statements size equals: 1. self assert: (exceptBlock3 statements first isOfType: FASTPyCall). - self assert: ((tryBlock patterns at: 4) isNil). + self assert: (tryBlock patterns at: 4) isNil. lastBlock := tryBlock nextBlocks at: 4. self deny: lastBlock isNullBlock. self assert: lastBlock equals: exceptBlock nextBlock. @@ -2450,7 +2497,8 @@ FASTPythonCFGTest >> testFunctionWithTryWithFinally [ self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 2. self assert: (lastBlock statements first isOfType: FASTPyCall). - self assert: (lastBlock statements second isOfType: FASTPyCall) + self assert: (lastBlock statements second isOfType: FASTPyCall). + self assert: lastBlock equals: tryBlock mergeBlock ] { #category : 'tests - while' } @@ -2479,7 +2527,8 @@ FASTPythonCFGTest >> testFunctionWithWhile [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2502,13 +2551,13 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - + trueWhile := startBlock nextTrueBlock. self deny: trueWhile isConditional. self deny: trueWhile isFinal. self assert: trueWhile statements size equals: 1. self assert: (trueWhile statements first isOfType: FASTPyCall). - + whileConditionalBlock2 := trueWhile nextBlock. self assert: whileConditionalBlock2 isConditional. self deny: whileConditionalBlock2 isFinal. @@ -2529,18 +2578,20 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ self assert: (elseBlock statements first isOfType: FASTPyCall). self assert: elseBlock equals: thenBlock nextBlock. self assert: elseBlock nextBlock equals: startBlock. + self assert: elseBlock equals: whileConditionalBlock2 mergeBlock. lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile2 [ - | whileCondition ifCondition then else null | + | whileConditionBlock ifConditionBlock thenBlock elseBlock nullBlock | self buildCFGForFunction: 'def f(i): while i < 4: while i < 2: @@ -2556,36 +2607,38 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile2 [ self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. - whileCondition := startBlock nextTrueBlock. - self assert: whileCondition isConditional. - self deny: whileCondition isFinal. - self assert: whileCondition statements size equals: 1. - self assert: (whileCondition statements first isOfType: FASTPyComparisonOperator). - self assert: whileCondition nextFalseBlock equals: startBlock. - - ifCondition := whileCondition nextTrueBlock. - self assert: ifCondition isConditional. - self deny: ifCondition isFinal. - self assert: ifCondition statements size equals: 1. - self assert: (ifCondition statements first isOfType: FASTPyComparisonOperator). - - then := ifCondition nextTrueBlock. - self deny: then isConditional. - self deny: then isFinal. - self assert: then statements size equals: 1. - self assert: (then statements first isOfType: FASTPyBreakStatement). - self assert: then nextBlock equals: startBlock. - - else := ifCondition nextFalseBlock. - self deny: else isConditional. - self deny: else isFinal. - self assert: else statements size equals: 1. - self assert: (else statements first isOfType: FASTPyCall). - self assert: else nextBlock equals: whileCondition. - - null := startBlock nextFalseBlock. - self assert: null isNullBlock. - self assert: null isFinal + whileConditionBlock := startBlock nextTrueBlock. + self assert: whileConditionBlock isConditional. + self deny: whileConditionBlock isFinal. + self assert: whileConditionBlock statements size equals: 1. + self assert: (whileConditionBlock statements first isOfType: FASTPyComparisonOperator). + self assert: whileConditionBlock nextFalseBlock equals: startBlock. + + ifConditionBlock := whileConditionBlock nextTrueBlock. + self assert: ifConditionBlock isConditional. + self deny: ifConditionBlock isFinal. + self assert: ifConditionBlock statements size equals: 1. + self assert: (ifConditionBlock statements first isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyBreakStatement). + self assert: thenBlock nextBlock equals: startBlock. + + elseBlock := ifConditionBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: whileConditionBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock. + self assert: nullBlock equals: whileConditionBlock mergeBlock ] { #category : 'tests - while' } @@ -2603,7 +2656,7 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock statements first class isOfType: FASTPyCall). - + whileCondition := startBlock nextBlock. self assert: whileCondition isConditional. self deny: whileCondition isFinal. @@ -2618,11 +2671,12 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ self assert: whileBlock statements size equals: 2. self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). self assert: (whileBlock statements second isOfType: FASTPyCall). - self assert: whileBlock nextBlock equals: whileCondition . + self assert: whileBlock nextBlock equals: whileCondition. nullBlock := whileCondition nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: whileCondition mergeBlock ] { #category : 'tests - while' } @@ -2652,7 +2706,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: whileBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2691,7 +2746,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2737,7 +2793,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2785,7 +2842,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2836,7 +2894,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaki self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. self assert: elseblock nextBlock equals: nullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2908,7 +2967,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -2974,7 +3034,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ self assert: lastBlock equals: elifBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3029,7 +3090,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3059,7 +3121,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3098,7 +3161,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3144,7 +3208,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen2 [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3192,7 +3257,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElse nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3243,7 +3309,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElseC nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + self assert: nullBlock isFinal. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3315,7 +3382,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifAndElseAllCont self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3381,7 +3449,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifContinuingAndE self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3436,7 +3505,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ self deny: lastBlock isNullBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3473,7 +3543,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInAllBranches [ nullBlock := elseBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock isFinal. - self assert: nullBlock equals: whileBlock nextBlock + self assert: nullBlock equals: whileBlock nextBlock. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3518,7 +3589,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInIf [ nullBlock := elseBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock isFinal. - self assert: nullBlock equals: thenBlock nextBlock + self assert: nullBlock equals: thenBlock nextBlock. + self assert: nullBlock equals: startBlock mergeBlock ] { #category : 'tests - while' } @@ -3549,7 +3621,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithoutBreak [ self deny: elseBlock isNullBlock. self assert: elseBlock isFinal. self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + self assert: (elseBlock statements first isOfType: FASTPyPassStatement) ] { #category : 'tests - while' } @@ -3629,5 +3701,6 @@ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ self assert: lastBlock equals: thenBlock2 nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: lastBlock equals: startBlock mergeBlock ] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index 4be1b1e..fcebba6 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -37,9 +37,8 @@ Dictionary new Class { #name : 'FASTPythonImporterTest', #superclass : 'TSFASTAbstractImporterTest', - #category : 'FAST-Python-Tools-Tests-Importer', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Importer' + #category : 'FAST-Python-Tools-Tests', + #package : 'FAST-Python-Tools-Tests' } { #category : 'class initialization' } @@ -125,7 +124,6 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -143,7 +141,6 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'container'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'container'. stack pop. stack pop. stack pop. @@ -199,7 +196,6 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -216,13 +212,11 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'reader'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'reader'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'writer'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'writer'. stack pop. stack pop. stack pop. @@ -276,7 +270,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -286,7 +279,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -340,7 +332,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -350,7 +341,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -394,7 +384,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation target" @@ -403,7 +392,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -455,7 +443,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation value" @@ -464,7 +451,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -474,7 +460,6 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -530,7 +515,6 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -574,7 +558,6 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'targets'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'targets'. stack pop. stack pop. stack pop. @@ -631,7 +614,6 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -648,13 +630,11 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'g'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'g'. stack pop. stack pop. stack pop. @@ -730,7 +710,6 @@ FASTPythonImporterTest >> testAssertStatement [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack push: (stack top operands at: 2). @@ -863,7 +842,6 @@ FASTPythonImporterTest >> testAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -908,7 +886,6 @@ FASTPythonImporterTest >> testAssignmentInList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'remote'. stack pop. stack pop. @@ -953,13 +930,11 @@ FASTPythonImporterTest >> testAssignmentInPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1025,13 +1000,11 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'j'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'j'. stack pop. stack pop. @@ -1041,7 +1014,6 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'lst'. stack pop. stack pop. @@ -1050,8 +1022,7 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'seq'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'seq' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1095,7 +1066,6 @@ FASTPythonImporterTest >> testAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'variables'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'variables'. stack pop. stack pop. @@ -1139,13 +1109,11 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1154,8 +1122,7 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1199,8 +1166,7 @@ FASTPythonImporterTest >> testAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1302,7 +1268,6 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -1311,8 +1276,7 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1357,8 +1321,7 @@ FASTPythonImporterTest >> testAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1505,7 +1468,6 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -1513,8 +1475,7 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1722,8 +1683,7 @@ FASTPythonImporterTest >> testAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'element' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1806,7 +1766,6 @@ FASTPythonImporterTest >> testAssignmentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -1859,8 +1818,7 @@ FASTPythonImporterTest >> testAssignmentToList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'remote' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -1907,7 +1865,6 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -1923,7 +1880,6 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -1950,8 +1906,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -2031,8 +1986,7 @@ FASTPythonImporterTest >> testAssignmentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -2076,13 +2030,11 @@ FASTPythonImporterTest >> testAssignmentToPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -2174,7 +2126,6 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -2190,7 +2141,6 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -2217,8 +2167,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -2309,8 +2258,7 @@ FASTPythonImporterTest >> testAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -2494,8 +2442,7 @@ FASTPythonImporterTest >> testAssignmentType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - accesses' } @@ -2520,8 +2467,7 @@ FASTPythonImporterTest >> testAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - accesses' } @@ -2554,8 +2500,7 @@ FASTPythonImporterTest >> testAttributeAccessNested [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -2588,8 +2533,7 @@ FASTPythonImporterTest >> testAttributeAccessOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -2671,7 +2615,6 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -2680,8 +2623,7 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -2716,8 +2658,7 @@ FASTPythonImporterTest >> testAttributeAccessOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -2834,7 +2775,6 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -2842,8 +2782,7 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -2939,7 +2878,6 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -2948,7 +2886,6 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -2965,7 +2902,6 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -2973,8 +2909,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3053,8 +2988,7 @@ FASTPythonImporterTest >> testAttributeAccessOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3087,8 +3021,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'remote' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3125,7 +3058,6 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3141,7 +3073,6 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3168,8 +3099,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3229,8 +3159,7 @@ FASTPythonImporterTest >> testAttributeAccessOnNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3302,7 +3231,6 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3318,7 +3246,6 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3345,8 +3272,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3417,8 +3343,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3479,13 +3404,11 @@ FASTPythonImporterTest >> testAttributeAccessOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - attributes' } @@ -3548,8 +3471,7 @@ FASTPythonImporterTest >> testAttributeAccessWithReceiverParenthesised [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -3584,7 +3506,6 @@ FASTPythonImporterTest >> testAugmentedAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3678,7 +3599,6 @@ FASTPythonImporterTest >> testAugmentedAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3724,13 +3644,11 @@ FASTPythonImporterTest >> testAugmentedAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3787,8 +3705,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -3892,8 +3809,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -3988,7 +3904,6 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -3996,8 +3911,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -4071,8 +3985,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'element' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -4165,8 +4078,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -4239,8 +4151,7 @@ FASTPythonImporterTest >> testAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'future'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'future' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - await' } @@ -4276,7 +4187,6 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4285,8 +4195,7 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - await' } @@ -4321,7 +4230,6 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4330,8 +4238,7 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - await' } @@ -4367,7 +4274,6 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -4376,8 +4282,7 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - await' } @@ -4424,7 +4329,6 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4433,7 +4337,6 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4442,8 +4345,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - await' } @@ -4470,7 +4372,6 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -4478,8 +4379,7 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - await' } @@ -4525,7 +4425,6 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4534,8 +4433,7 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -4615,7 +4513,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4633,8 +4530,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -4746,7 +4642,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -4764,7 +4659,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4774,7 +4668,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4785,8 +4678,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -4822,7 +4714,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4841,8 +4732,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -4999,7 +4889,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -5016,7 +4905,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -5026,7 +4914,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -5036,8 +4923,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5170,7 +5056,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5179,7 +5064,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5196,7 +5080,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5205,7 +5088,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -5231,7 +5113,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5240,7 +5121,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5257,7 +5137,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5265,8 +5144,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5368,7 +5246,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: '+'. @@ -5377,8 +5254,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5450,7 +5326,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'remote'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5467,8 +5342,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'remote' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5505,7 +5379,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5521,7 +5394,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5549,7 +5421,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5569,7 +5440,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5585,7 +5455,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5612,8 +5481,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5648,7 +5516,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: ') + ('. @@ -5666,8 +5533,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5758,7 +5624,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5774,7 +5639,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5802,7 +5666,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5822,7 +5685,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5838,7 +5700,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5865,8 +5726,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -5949,7 +5809,6 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5976,8 +5835,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6049,13 +5907,11 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -6073,13 +5929,11 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6256,7 +6110,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6274,8 +6127,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6310,7 +6162,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6320,7 +6171,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6339,7 +6189,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6348,8 +6197,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6391,7 +6239,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6401,7 +6248,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6412,7 +6258,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6422,8 +6267,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6459,7 +6303,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6478,8 +6321,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6644,7 +6486,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -6661,7 +6502,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6671,7 +6511,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -6681,8 +6520,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6874,7 +6712,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6883,8 +6720,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -6991,7 +6827,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7009,8 +6844,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -7147,7 +6981,6 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7174,8 +7007,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -7247,13 +7079,11 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7271,13 +7101,11 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -7413,7 +7241,6 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7422,8 +7249,7 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7458,7 +7284,6 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7467,8 +7292,7 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7516,7 +7340,6 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7525,8 +7348,7 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7562,7 +7384,6 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -7572,7 +7393,6 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -7581,8 +7401,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7618,7 +7437,6 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -7627,8 +7445,7 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7663,13 +7480,11 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -7679,8 +7494,7 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7717,8 +7531,7 @@ FASTPythonImporterTest >> testCalWithArgumentComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7765,7 +7578,6 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -7774,7 +7586,6 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7783,8 +7594,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7838,7 +7648,6 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -7848,8 +7657,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7893,7 +7701,6 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -7902,7 +7709,6 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7919,7 +7725,6 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -7928,7 +7733,6 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -7938,8 +7742,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -7974,7 +7777,6 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -7983,8 +7785,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8020,8 +7821,7 @@ FASTPythonImporterTest >> testCalWithArgumentEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8058,8 +7858,7 @@ FASTPythonImporterTest >> testCalWithArgumentFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8096,8 +7895,7 @@ FASTPythonImporterTest >> testCalWithArgumentFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8124,7 +7922,6 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -8132,8 +7929,7 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8170,8 +7966,7 @@ FASTPythonImporterTest >> testCalWithArgumentInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8208,7 +8003,6 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -8227,8 +8021,7 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8274,8 +8067,7 @@ FASTPythonImporterTest >> testCalWithArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8321,7 +8113,6 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8331,7 +8122,6 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8348,7 +8138,6 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8376,7 +8165,6 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8387,8 +8175,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8423,7 +8210,6 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -8432,8 +8218,7 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8469,8 +8254,7 @@ FASTPythonImporterTest >> testCalWithArgumentNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8506,7 +8290,6 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -8515,8 +8298,7 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8562,8 +8344,7 @@ FASTPythonImporterTest >> testCalWithArgumentSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8609,7 +8390,6 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8619,7 +8399,6 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8636,7 +8415,6 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8664,7 +8442,6 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8675,8 +8452,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8713,8 +8489,7 @@ FASTPythonImporterTest >> testCalWithArgumentString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8760,7 +8535,6 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8769,8 +8543,7 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8807,8 +8580,7 @@ FASTPythonImporterTest >> testCalWithArgumentTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8843,13 +8615,11 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -8858,8 +8628,7 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8895,7 +8664,6 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -8905,8 +8673,7 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8943,8 +8710,7 @@ FASTPythonImporterTest >> testCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'print' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -8980,7 +8746,6 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'CFG'. stack pop. stack pop. @@ -8989,8 +8754,7 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9046,7 +8810,6 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'train_bs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'train_bs'. stack pop. stack pop. self assert: self topEntity operator equals: '*'. @@ -9057,7 +8820,6 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'epochs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'epochs'. stack pop. stack pop. @@ -9066,8 +8828,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9149,7 +8910,6 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'data'. stack pop. stack pop. stack pop. @@ -9160,8 +8920,7 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9196,13 +8955,11 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'shape0'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'shape0'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'resize'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'resize'. stack pop. self assert: self topEntity operators equals: #('!='). stack pop. @@ -9212,8 +8969,7 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9276,7 +9032,6 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_ids'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'pred_ids'. stack pop. stack pop. @@ -9300,7 +9055,6 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_classes'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'pred_classes'. stack pop. stack pop. stack pop. @@ -9310,8 +9064,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9355,8 +9108,7 @@ FASTPythonImporterTest >> testCallArgumentWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9411,8 +9163,7 @@ FASTPythonImporterTest >> testCallArgumentWithKeywordArgument [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9440,7 +9191,6 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'img'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'img'. stack pop. stack push: (stack top arguments at: 2). @@ -9453,13 +9203,11 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'pady'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'padx'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'padx'. stack pop. stack pop. @@ -9468,8 +9216,7 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9515,8 +9262,7 @@ FASTPythonImporterTest >> testCallChained [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'function' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9572,7 +9318,6 @@ FASTPythonImporterTest >> testCallLambda [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -9626,8 +9371,7 @@ FASTPythonImporterTest >> testCallOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9662,8 +9406,7 @@ FASTPythonImporterTest >> testCallOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9710,7 +9453,6 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -9718,8 +9460,7 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9745,8 +9486,7 @@ FASTPythonImporterTest >> testCallOnIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9783,7 +9523,6 @@ FASTPythonImporterTest >> testCallOnLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -9838,8 +9577,7 @@ FASTPythonImporterTest >> testCallOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'functions' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9895,8 +9633,7 @@ FASTPythonImporterTest >> testCallSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'coll' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9931,8 +9668,7 @@ FASTPythonImporterTest >> testCallWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'tqdm'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'tqdm' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -9978,7 +9714,6 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -9988,7 +9723,6 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10005,7 +9739,6 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -10033,7 +9766,6 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -10044,8 +9776,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'sum'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'sum' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -10135,7 +9866,6 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclass [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. self assert: self topEntity name equals: 'aClass'. @@ -10183,7 +9913,6 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclassCustomizations [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. @@ -10246,19 +9975,16 @@ FASTPythonImporterTest >> testClassDefinitionWithMultipleSuperclasses [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'Super1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Super1'. stack pop. stack push: (stack top superclasses at: 2). self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Super2'. stack pop. stack push: (stack top superclasses at: 3). self assert: self topEntity sourceCode equals: 'Super3'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Super3' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10303,8 +10029,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'module' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10350,8 +10075,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10408,7 +10132,6 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Super2'. stack pop. "Testing value of monovalue relation thenExpression" @@ -10416,8 +10139,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Super1'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Super1' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10453,8 +10175,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassIdentifier [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'SuperClass'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'SuperClass' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10498,8 +10219,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10554,8 +10274,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'classes'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'classes' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - classes' } @@ -10600,7 +10319,6 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -10613,8 +10331,7 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'V'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'V' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comments' } @@ -10674,7 +10391,6 @@ FASTPythonImporterTest >> testCommentInArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'funct'. stack pop. "Testing value of multivalued relation comments" @@ -10739,7 +10455,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10795,7 +10510,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10832,7 +10546,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -10849,7 +10562,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10893,7 +10605,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -10983,7 +10694,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10999,8 +10709,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -11089,7 +10798,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithEllipsis [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -11193,7 +10901,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithIdentifier [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -11338,7 +11045,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithNotOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack push: (stack top operands at: 2). @@ -11470,7 +11176,6 @@ FASTPythonImporterTest >> testComparisonOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -11548,13 +11253,11 @@ FASTPythonImporterTest >> testComparisonOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -11670,7 +11373,6 @@ FASTPythonImporterTest >> testConcatenatedString [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'name'. stack pop. stack pop. stack pop. @@ -11724,7 +11426,6 @@ FASTPythonImporterTest >> testConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -11811,7 +11512,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11828,8 +11528,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -11875,7 +11574,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11885,7 +11583,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11903,7 +11600,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11912,8 +11608,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -11959,7 +11654,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11969,7 +11663,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -11987,7 +11680,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11996,8 +11688,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -12044,7 +11735,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -12062,8 +11752,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -12108,13 +11797,11 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -12132,13 +11819,11 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -12224,7 +11909,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12234,7 +11918,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12280,7 +11963,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -12290,7 +11972,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12300,7 +11981,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12346,7 +12026,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -12356,7 +12035,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -12366,7 +12044,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12413,7 +12090,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -12423,7 +12099,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12468,13 +12143,11 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -12485,7 +12158,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12533,7 +12205,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComplexe [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12589,7 +12260,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12598,7 +12268,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12608,7 +12277,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12656,7 +12324,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFalse [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12704,7 +12371,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFloat [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12741,7 +12407,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation elseExpression" @@ -12750,7 +12415,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12797,7 +12461,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionInteger [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12843,7 +12506,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -12853,7 +12515,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12908,7 +12569,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -12918,7 +12578,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12966,7 +12625,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionTrue [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13012,7 +12670,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -13023,7 +12680,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13088,7 +12744,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13097,7 +12752,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13125,7 +12779,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13133,8 +12786,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -13198,7 +12850,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -13232,8 +12883,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -13287,7 +12937,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -13296,7 +12945,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13313,7 +12961,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -13322,7 +12969,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -13347,7 +12993,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -13356,7 +13001,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13373,7 +13017,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -13381,8 +13024,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -13560,7 +13202,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13568,8 +13209,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -13664,7 +13304,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13692,7 +13331,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13823,7 +13461,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13833,7 +13470,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13850,7 +13486,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13878,7 +13513,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -13905,7 +13539,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13915,7 +13548,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13932,7 +13564,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13959,8 +13590,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14005,7 +13635,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -14021,8 +13650,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14114,7 +13742,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -14131,8 +13758,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14159,7 +13785,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). @@ -14183,7 +13808,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. "Testing value of monovalue relation thenExpression" @@ -14192,14 +13816,12 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14320,7 +13942,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -14330,7 +13951,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -14347,7 +13967,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -14375,7 +13994,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -14402,7 +14020,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -14412,7 +14029,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -14429,7 +14045,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -14456,8 +14071,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14561,7 +14175,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -14587,8 +14200,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'functions' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14680,13 +14292,11 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -14703,13 +14313,11 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - conditional expressions' } @@ -14755,7 +14363,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -14774,7 +14381,6 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -14837,7 +14443,6 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -14853,8 +14458,7 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -14935,7 +14539,6 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decorator'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'decorator'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -14982,7 +14585,6 @@ class MyComponent: pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'register_component'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'register_component'. stack pop. stack pop. self assert: self topEntity name equals: 'MyComponent'. @@ -15030,7 +14632,6 @@ def func(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'func'. @@ -15092,7 +14693,6 @@ FASTPythonImporterTest >> testDecoratorOnMethodDefinition [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'meth'. @@ -15149,7 +14749,6 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functools'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'functools'. stack pop. stack pop. stack pop. @@ -15217,7 +14816,6 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -15277,7 +14875,6 @@ def funct(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. "Testing value of multivalued relation parameters" @@ -15355,7 +14952,6 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'decorators'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'decorators'. stack pop. stack pop. stack pop. @@ -15407,7 +15003,6 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorA'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'decoratorA'. stack pop. stack pop. @@ -15421,7 +15016,6 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorB'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'decoratorB'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -15529,7 +15123,6 @@ FASTPythonImporterTest >> testDefaultParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15587,7 +15180,6 @@ FASTPythonImporterTest >> testDefaultParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15658,7 +15250,6 @@ FASTPythonImporterTest >> testDefaultParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15717,7 +15308,6 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -15727,7 +15317,6 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15787,7 +15376,6 @@ FASTPythonImporterTest >> testDefaultParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15845,13 +15433,11 @@ FASTPythonImporterTest >> testDefaultParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -15972,7 +15558,6 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -15981,7 +15566,6 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16058,7 +15642,6 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -16126,7 +15709,6 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -16135,7 +15717,6 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16152,7 +15733,6 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -16161,7 +15741,6 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -16361,7 +15940,6 @@ FASTPythonImporterTest >> testDefaultParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. stack pop. @@ -16469,7 +16047,6 @@ FASTPythonImporterTest >> testDefaultParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -16608,7 +16185,6 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16618,7 +16194,6 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16635,7 +16210,6 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16663,7 +16237,6 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16773,7 +16346,6 @@ FASTPythonImporterTest >> testDefaultParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16902,7 +16474,6 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16912,7 +16483,6 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16929,7 +16499,6 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16957,7 +16526,6 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -17078,7 +16646,6 @@ FASTPythonImporterTest >> testDefaultParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17186,13 +16753,11 @@ FASTPythonImporterTest >> testDefaultParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17251,7 +16816,6 @@ FASTPythonImporterTest >> testDefaultParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -17320,7 +16884,6 @@ FASTPythonImporterTest >> testDefaultTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17379,7 +16942,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17397,7 +16959,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17455,7 +17016,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17473,7 +17033,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17544,7 +17103,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17562,7 +17120,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17621,7 +17178,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -17631,7 +17187,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17649,7 +17204,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17709,7 +17263,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17727,7 +17280,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17785,13 +17337,11 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -17810,7 +17360,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17879,7 +17428,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComplexe [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17949,7 +17497,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -17958,7 +17505,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17976,7 +17522,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18053,7 +17598,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -18072,7 +17616,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18139,7 +17682,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -18148,7 +17690,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18165,7 +17706,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -18174,7 +17714,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -18193,7 +17732,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18261,7 +17799,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithEllipsis [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18330,7 +17867,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFalse [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18399,7 +17935,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFloat [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18449,7 +17984,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. @@ -18466,7 +18000,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18535,7 +18068,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithInteger [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18594,7 +18126,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -18622,7 +18153,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18700,7 +18230,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithList [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18770,7 +18299,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18780,7 +18308,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18797,7 +18324,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18825,7 +18351,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18845,7 +18370,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18913,7 +18437,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNone [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18972,7 +18495,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18990,7 +18512,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19068,7 +18589,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSet [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19138,7 +18658,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -19148,7 +18667,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -19165,7 +18683,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -19193,7 +18710,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -19213,7 +18729,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19282,7 +18797,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithString [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19351,7 +18865,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -19369,7 +18882,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19438,7 +18950,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTrue [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19496,13 +19007,11 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -19520,7 +19029,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19579,7 +19087,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -19598,7 +19105,6 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19632,8 +19138,7 @@ FASTPythonImporterTest >> testDelStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'coll' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -19666,8 +19171,7 @@ FASTPythonImporterTest >> testDelStatementAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -19700,13 +19204,11 @@ FASTPythonImporterTest >> testDelStatementExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'rate'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'rate'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'add_baudrate_if_supported'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'add_baudrate_if_supported' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -19740,13 +19242,11 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'obj1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj1'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'obj2'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj2'. stack pop. stack push: (stack top initializers at: 3). @@ -19759,8 +19259,7 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -19812,8 +19311,7 @@ FASTPythonImporterTest >> testDelStatementSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -19969,7 +19467,6 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19978,7 +19475,6 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -20002,13 +19498,11 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -20034,8 +19528,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'class_indices' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -20074,7 +19567,6 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -20083,7 +19575,6 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -20100,7 +19591,6 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack push: (stack top operands at: 2). @@ -20132,13 +19622,11 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -20164,8 +19652,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'class_indices' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20200,7 +19687,6 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -20209,8 +19695,7 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20246,7 +19731,6 @@ FASTPythonImporterTest >> testDictionarySplatInDictionary [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'd1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'd1'. stack pop. stack pop. @@ -20315,7 +19799,6 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -20325,8 +19808,7 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'funct' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20370,7 +19852,6 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'default_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'default_args'. stack pop. self assert: self topEntity operator equals: '|'. @@ -20380,7 +19861,6 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'subprocess_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'subprocess_args'. stack pop. stack pop. stack pop. @@ -20390,8 +19870,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20436,7 +19915,6 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'extra'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'extra'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -20455,8 +19933,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20500,7 +19977,6 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get_config'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'get_config'. stack pop. stack pop. stack pop. @@ -20510,8 +19986,7 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'funct' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20566,7 +20041,6 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. "Testing value of monovalue relation value" @@ -20583,7 +20057,6 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. self assert: self topEntity operator equals: '*'. @@ -20619,13 +20092,11 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -20635,7 +20106,6 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'items'. stack pop. stack pop. stack pop. @@ -20646,8 +20116,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'funct' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20682,7 +20151,6 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -20691,8 +20159,7 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -20746,7 +20213,6 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'd'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'd'. stack pop. stack pop. stack pop. @@ -20756,8 +20222,7 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'funct' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - function definitions' } @@ -20848,8 +20313,7 @@ FASTPythonImporterTest >> testDictionaryWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -20967,7 +20431,6 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -20976,8 +20439,7 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21030,8 +20492,7 @@ FASTPythonImporterTest >> testDictionaryWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21202,7 +20663,6 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -21210,8 +20670,7 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21457,8 +20916,7 @@ FASTPythonImporterTest >> testDictionaryWithIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'element' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21557,7 +21015,6 @@ FASTPythonImporterTest >> testDictionaryWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -21671,8 +21128,7 @@ FASTPythonImporterTest >> testDictionaryWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21727,7 +21183,6 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21743,7 +21198,6 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21770,8 +21224,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21867,8 +21320,7 @@ FASTPythonImporterTest >> testDictionaryWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -21976,7 +21428,6 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21992,7 +21443,6 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22019,8 +21469,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -22055,7 +21504,6 @@ FASTPythonImporterTest >> testDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'base'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'base'. stack pop. stack pop. @@ -22186,8 +21634,7 @@ FASTPythonImporterTest >> testDictionaryWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -22471,7 +21918,6 @@ except exceptions.Exception: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -22538,7 +21984,6 @@ except Exception(): pass' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22613,7 +22058,6 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -22631,7 +22075,6 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Error'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Error'. stack pop. "Testing value of monovalue relation thenExpression" @@ -22640,7 +22083,6 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22697,7 +22139,6 @@ except Exception: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22772,7 +22213,6 @@ except exceptions[2]: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -22830,7 +22270,6 @@ except Exception as e: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22871,8 +22310,7 @@ FASTPythonImporterTest >> testExecStatementOfIdentifier [ stack push: self topEntity code. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -22908,13 +22346,11 @@ FASTPythonImporterTest >> testExecStatementWithScopes [ stack push: (stack top scopes at: 1). self assert: self topEntity sourceCode equals: 'globals_dict'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'globals_dict'. stack pop. stack push: (stack top scopes at: 2). self assert: self topEntity sourceCode equals: 'locals_dict'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'locals_dict' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - literals' } @@ -22977,7 +22413,6 @@ FASTPythonImporterTest >> testForStatement [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -23028,7 +22463,6 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -23078,7 +22512,6 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -23087,7 +22520,6 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -23128,7 +22560,6 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -23178,7 +22609,6 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -23187,7 +22617,6 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -23256,7 +22685,6 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -23267,7 +22695,6 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -23317,7 +22744,6 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -23325,8 +22751,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'fun' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - advanced statements' } @@ -23355,7 +22780,6 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -23371,13 +22795,11 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -23424,7 +22846,6 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top initializers at: 2). @@ -23437,13 +22858,11 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'widths'. stack pop. stack pop. stack pop. @@ -23454,7 +22873,6 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'data'. stack pop. "Testing value of multivalued relation statements" @@ -23472,19 +22890,16 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top arguments at: 2). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top arguments at: 3). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'widths'. stack pop. "Testing value of monovalue relation callee" @@ -23492,8 +22907,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'print' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - imports' } @@ -23990,7 +23404,6 @@ FASTPythonImporterTest >> testFunctionDefinitionWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -24095,7 +23508,6 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -24105,7 +23517,6 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24122,7 +23533,6 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24149,8 +23559,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24187,7 +23596,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24204,7 +23612,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24231,8 +23638,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24268,7 +23674,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24285,7 +23690,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24312,8 +23716,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24350,7 +23753,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -24360,7 +23762,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24377,7 +23778,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24404,8 +23804,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24442,7 +23841,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -24452,7 +23850,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -24469,7 +23866,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24496,8 +23892,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24534,7 +23929,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -24551,7 +23945,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24578,8 +23971,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24615,13 +24007,11 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -24639,7 +24029,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24666,8 +24055,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24713,7 +24101,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24740,8 +24127,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24789,7 +24175,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -24798,7 +24183,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24815,7 +24199,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24842,8 +24225,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24897,7 +24279,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -24915,7 +24296,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24942,8 +24322,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -24987,7 +24366,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -24996,7 +24374,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25013,7 +24390,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -25022,7 +24398,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -25040,7 +24415,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25067,8 +24441,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25113,7 +24486,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25140,8 +24512,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25187,7 +24558,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25214,8 +24584,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25261,7 +24630,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25288,8 +24656,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25317,7 +24684,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -25333,7 +24699,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25360,8 +24725,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25390,7 +24754,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -25406,7 +24769,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -25431,7 +24793,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25458,8 +24819,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25504,7 +24864,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25531,8 +24890,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25570,7 +24928,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -25597,7 +24954,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25624,8 +24980,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25669,7 +25024,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25696,8 +25050,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25742,7 +25095,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25752,7 +25104,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25769,7 +25120,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25797,7 +25147,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25816,7 +25165,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25843,8 +25191,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25870,7 +25217,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -25886,7 +25232,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -25895,7 +25240,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -25909,7 +25253,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25917,8 +25260,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -25948,7 +25290,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -25972,7 +25313,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -26014,7 +25354,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -26051,7 +25390,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26078,8 +25416,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26124,7 +25461,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26151,8 +25487,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26189,7 +25524,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -26206,7 +25540,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26233,8 +25566,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26288,7 +25620,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26315,8 +25646,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26361,7 +25691,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -26371,7 +25700,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -26388,7 +25716,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -26416,7 +25743,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -26435,7 +25761,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26462,8 +25787,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26509,7 +25833,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26536,8 +25859,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26583,7 +25905,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -26600,7 +25921,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26627,8 +25947,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26674,7 +25993,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26701,8 +26019,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26738,7 +26055,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -26755,7 +26071,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26782,8 +26097,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -26820,7 +26134,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -26838,7 +26151,6 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26865,8 +26177,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - types' } @@ -26930,7 +26241,6 @@ FASTPythonImporterTest >> testGenericType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -27006,7 +26316,6 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'str'. stack pop. stack pop. @@ -27020,7 +26329,6 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -27090,8 +26398,7 @@ FASTPythonImporterTest >> testGlobalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'counter' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -27172,19 +26479,16 @@ FASTPythonImporterTest >> testGlobalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'z' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - advanced statements' } @@ -27224,7 +26528,6 @@ FASTPythonImporterTest >> testIf [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27297,7 +26600,6 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27389,7 +26691,6 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27425,7 +26726,6 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27513,7 +26813,6 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27549,7 +26848,6 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27593,7 +26891,6 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27686,7 +26983,6 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27722,7 +27018,6 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27766,7 +27061,6 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27862,7 +27156,6 @@ FASTPythonImporterTest >> testIfStatementWithABreak [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27926,7 +27219,6 @@ FASTPythonImporterTest >> testIfStatementWithAContinue [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -28138,8 +27430,7 @@ FASTPythonImporterTest >> testImportInFunction [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'np'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'np' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - imports' } @@ -28314,7 +27605,6 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'name'. stack pop. stack pop. @@ -28327,8 +27617,7 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'value' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28371,8 +27660,7 @@ FASTPythonImporterTest >> testInterpolationWithAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'CFG' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28417,7 +27705,6 @@ FASTPythonImporterTest >> testInterpolationWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k'. stack pop. self assert: self topEntity operator equals: '+'. @@ -28472,7 +27759,6 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -28481,8 +27767,7 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28537,8 +27822,7 @@ FASTPythonImporterTest >> testInterpolationWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'myMethod'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'myMethod' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28581,13 +27865,11 @@ FASTPythonImporterTest >> testInterpolationWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('==') ] @@ -28633,7 +27915,6 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -28649,7 +27930,6 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -28657,8 +27937,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'items' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28702,7 +27981,6 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -28711,7 +27989,6 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -28719,8 +27996,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: ''. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: '' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28813,7 +28089,6 @@ FASTPythonImporterTest >> testInterpolationWithLambda [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -28878,7 +28153,6 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -28886,8 +28160,7 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'label_order'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'label_order' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - interpolations' } @@ -28922,7 +28195,6 @@ FASTPythonImporterTest >> testInterpolationWithTypeConversion [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'text'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'text'. stack pop. self assert: self topEntity typeConversion equals: 'r' ] @@ -28969,7 +28241,6 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28979,8 +28250,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29024,7 +28294,6 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29034,8 +28303,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29092,7 +28360,6 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29102,8 +28369,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29148,7 +28414,6 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -29158,7 +28423,6 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -29168,8 +28432,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29214,7 +28477,6 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -29224,8 +28486,7 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29269,13 +28530,11 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -29286,8 +28545,7 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29334,8 +28592,7 @@ FASTPythonImporterTest >> testKeywordArgumentToComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29391,7 +28648,6 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -29400,7 +28656,6 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29410,8 +28665,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29474,7 +28728,6 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29485,8 +28738,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29539,7 +28791,6 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -29548,7 +28799,6 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29565,7 +28815,6 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -29574,7 +28823,6 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -29585,8 +28833,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29632,8 +28879,7 @@ FASTPythonImporterTest >> testKeywordArgumentToEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29680,8 +28926,7 @@ FASTPythonImporterTest >> testKeywordArgumentToFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29728,8 +28973,7 @@ FASTPythonImporterTest >> testKeywordArgumentToFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29765,7 +29009,6 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29774,8 +29017,7 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29822,8 +29064,7 @@ FASTPythonImporterTest >> testKeywordArgumentToInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29869,7 +29110,6 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -29889,8 +29129,7 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -29946,8 +29185,7 @@ FASTPythonImporterTest >> testKeywordArgumentToList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30002,7 +29240,6 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30012,7 +29249,6 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30029,7 +29265,6 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -30057,7 +29292,6 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -30069,8 +29303,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30114,7 +29347,6 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -30124,8 +29356,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30171,8 +29402,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30217,7 +29447,6 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. stack pop. @@ -30227,8 +29456,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30284,8 +29512,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30340,7 +29567,6 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30350,7 +29576,6 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30367,7 +29592,6 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -30395,7 +29619,6 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -30407,8 +29630,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30455,8 +29677,7 @@ FASTPythonImporterTest >> testKeywordArgumentToString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30511,7 +29732,6 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -30521,8 +29741,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30569,8 +29788,7 @@ FASTPythonImporterTest >> testKeywordArgumentToTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30614,13 +29832,11 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -30630,8 +29846,7 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - calls' } @@ -30676,7 +29891,6 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -30687,8 +29901,7 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - function definitions' } @@ -30796,7 +30009,6 @@ FASTPythonImporterTest >> testLambdaWithDefaultParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30844,7 +30056,6 @@ FASTPythonImporterTest >> testLambdaWithDictionarySplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30898,7 +30109,6 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30908,7 +30118,6 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30960,7 +30169,6 @@ FASTPythonImporterTest >> testLambdaWithListSplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -31013,7 +30221,6 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -31023,7 +30230,6 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31070,7 +30276,6 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -31080,7 +30285,6 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -31135,7 +30339,6 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -31145,7 +30348,6 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31246,7 +30448,6 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -31256,7 +30457,6 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31273,7 +30473,6 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31300,8 +30499,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31338,7 +30536,6 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31355,7 +30552,6 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31382,8 +30578,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31419,7 +30614,6 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31436,7 +30630,6 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31463,8 +30656,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31501,7 +30693,6 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -31511,7 +30702,6 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31528,7 +30718,6 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31555,8 +30744,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31593,7 +30781,6 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -31603,7 +30790,6 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -31620,7 +30806,6 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31647,8 +30832,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31685,7 +30869,6 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -31702,7 +30885,6 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31729,8 +30911,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31766,13 +30947,11 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -31790,7 +30969,6 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31817,8 +30995,7 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31864,7 +31041,6 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31891,8 +31067,7 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -31940,7 +31115,6 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -31949,7 +31123,6 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31966,7 +31139,6 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31993,8 +31165,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32048,7 +31219,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -32066,7 +31236,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32093,8 +31262,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32138,7 +31306,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -32147,7 +31314,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32164,7 +31330,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -32173,7 +31338,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -32191,7 +31355,6 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32218,8 +31381,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32264,7 +31426,6 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32291,8 +31452,7 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32338,7 +31498,6 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32365,8 +31524,7 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32412,7 +31570,6 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32439,8 +31596,7 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32468,7 +31624,6 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -32484,7 +31639,6 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32511,8 +31665,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32541,7 +31694,6 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -32557,7 +31709,6 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -32582,7 +31733,6 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32609,8 +31759,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32655,7 +31804,6 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32682,8 +31830,7 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32721,7 +31868,6 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -32748,7 +31894,6 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32775,8 +31920,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32820,7 +31964,6 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32847,8 +31990,7 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -32892,7 +32034,6 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32902,7 +32043,6 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32919,7 +32059,6 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32947,7 +32086,6 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32966,7 +32104,6 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32993,8 +32130,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33020,7 +32156,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -33036,7 +32171,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -33045,7 +32179,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -33059,7 +32192,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33067,8 +32199,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33098,7 +32229,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -33122,7 +32252,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -33164,7 +32293,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -33201,7 +32329,6 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33228,8 +32355,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33274,7 +32400,6 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33301,8 +32426,7 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33339,7 +32463,6 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -33356,7 +32479,6 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33383,8 +32505,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33430,7 +32551,6 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -33439,7 +32559,6 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'abs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -33459,7 +32578,6 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation callee" @@ -33468,7 +32586,6 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'abs'. stack pop. stack pop. stack pop. @@ -33493,13 +32610,11 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -33508,8 +32623,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'points'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'points' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33563,7 +32677,6 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33590,8 +32703,7 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33636,7 +32748,6 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -33646,7 +32757,6 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -33663,7 +32773,6 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -33691,7 +32800,6 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -33710,7 +32818,6 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33737,8 +32844,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33784,7 +32890,6 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33811,8 +32916,7 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33858,7 +32962,6 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -33875,7 +32978,6 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33902,8 +33004,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -33949,7 +33050,6 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33976,8 +33076,7 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -34013,7 +33112,6 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -34030,7 +33128,6 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -34057,8 +33154,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -34095,7 +33191,6 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -34113,7 +33208,6 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -34140,8 +33234,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34176,7 +33269,6 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -34185,8 +33277,7 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34220,7 +33311,6 @@ FASTPythonImporterTest >> testListSplatInList [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -34272,7 +33362,6 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -34282,8 +33371,7 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34327,7 +33415,6 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -34337,7 +33424,6 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack pop. @@ -34347,8 +33433,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34392,7 +33477,6 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'getList'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'getList'. stack pop. stack pop. stack pop. @@ -34402,8 +33486,7 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34465,8 +33548,7 @@ FASTPythonImporterTest >> testListSplatOnList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34519,7 +33601,6 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation callee" @@ -34528,7 +33609,6 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'format'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'format'. stack pop. stack pop. @@ -34545,7 +33625,6 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation right" @@ -34554,7 +33633,6 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'FILES'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'FILES'. stack pop. stack pop. stack pop. @@ -34565,8 +33643,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34601,7 +33678,6 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -34610,8 +33686,7 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34657,8 +33732,7 @@ FASTPythonImporterTest >> testListSplatOnString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34712,7 +33786,6 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -34722,8 +33795,7 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - splats' } @@ -34766,7 +33838,6 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'func'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func'. stack pop. stack push: (stack top initializers at: 2). @@ -34779,7 +33850,6 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -34790,8 +33860,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'funct' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - function definitions' } @@ -34863,8 +33932,7 @@ FASTPythonImporterTest >> testListWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -34944,7 +34012,6 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -34953,8 +34020,7 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -34988,8 +34054,7 @@ FASTPythonImporterTest >> testListWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35103,7 +34168,6 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -35111,8 +34175,7 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35265,8 +34328,7 @@ FASTPythonImporterTest >> testListWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'element' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35327,7 +34389,6 @@ FASTPythonImporterTest >> testListWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -35402,8 +34463,7 @@ FASTPythonImporterTest >> testListWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35439,7 +34499,6 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -35455,7 +34514,6 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -35482,8 +34540,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35541,8 +34598,7 @@ FASTPythonImporterTest >> testListWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35612,7 +34668,6 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -35628,7 +34683,6 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -35655,8 +34709,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35690,7 +34743,6 @@ FASTPythonImporterTest >> testListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -35767,8 +34819,7 @@ FASTPythonImporterTest >> testListWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -35920,8 +34971,7 @@ FASTPythonImporterTest >> testMatchAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -35977,8 +35027,7 @@ FASTPythonImporterTest >> testMatchCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'func' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36145,8 +35194,7 @@ FASTPythonImporterTest >> testMatchIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36329,8 +35377,7 @@ FASTPythonImporterTest >> testMatchPatternComplexOperation [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'value' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36387,8 +35434,7 @@ FASTPythonImporterTest >> testMatchPatternComplexe [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36498,8 +35544,7 @@ FASTPythonImporterTest >> testMatchPatternDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36545,7 +35590,6 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -36563,8 +35607,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36619,8 +35662,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36757,8 +35799,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36848,8 +35889,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithNoValues [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -36930,7 +35970,6 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. stack pop. @@ -36949,8 +35988,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37059,8 +36097,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithVariables [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37116,8 +36153,7 @@ FASTPythonImporterTest >> testMatchPatternDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'value' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37174,8 +36210,7 @@ FASTPythonImporterTest >> testMatchPatternFalse [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37232,8 +36267,7 @@ FASTPythonImporterTest >> testMatchPatternFloat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37290,8 +36324,7 @@ FASTPythonImporterTest >> testMatchPatternInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37358,8 +36391,7 @@ FASTPythonImporterTest >> testMatchPatternKeyword [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37434,8 +36466,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithClass [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37524,8 +36555,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithComplexPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37591,8 +36621,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37658,8 +36687,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37726,8 +36754,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37803,8 +36830,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37880,8 +36906,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -37964,8 +36989,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38038,8 +37062,7 @@ FASTPythonImporterTest >> testMatchPatternList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'value' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38120,8 +37143,7 @@ FASTPythonImporterTest >> testMatchPatternListInList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38167,7 +37189,6 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'list'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'list'. stack pop. stack pop. @@ -38185,8 +37206,7 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38241,8 +37261,7 @@ FASTPythonImporterTest >> testMatchPatternListSplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38304,7 +37323,6 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -38323,8 +37341,7 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38413,8 +37430,7 @@ FASTPythonImporterTest >> testMatchPatternListWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38470,8 +37486,7 @@ FASTPythonImporterTest >> testMatchPatternNone [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38528,8 +37543,7 @@ FASTPythonImporterTest >> testMatchPatternString [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38586,8 +37600,7 @@ FASTPythonImporterTest >> testMatchPatternTrue [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38660,8 +37673,7 @@ FASTPythonImporterTest >> testMatchPatternTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'value' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38741,8 +37753,7 @@ FASTPythonImporterTest >> testMatchPatternUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38824,8 +37835,7 @@ FASTPythonImporterTest >> testMatchPatternUnionClassPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -38926,8 +37936,7 @@ FASTPythonImporterTest >> testMatchPatternUnionDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -39000,8 +38009,7 @@ FASTPythonImporterTest >> testMatchPatternUnionDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -39083,8 +38091,7 @@ FASTPythonImporterTest >> testMatchPatternUnionList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -39166,8 +38173,7 @@ FASTPythonImporterTest >> testMatchPatternUnionTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -39224,8 +38230,7 @@ FASTPythonImporterTest >> testMatchPatternWithAlias [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'value' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -39273,7 +38278,6 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -39308,8 +38312,7 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'status' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - match' } @@ -39541,7 +38544,6 @@ FASTPythonImporterTest >> testMethodWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'CSVDataset'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'CSVDataset'. stack pop. stack pop. @@ -39704,7 +38706,6 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -39772,7 +38773,6 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -39890,8 +38890,7 @@ FASTPythonImporterTest >> testNonlocalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'counter' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -39972,19 +38971,16 @@ FASTPythonImporterTest >> testNonlocalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'z' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40034,8 +39030,7 @@ FASTPythonImporterTest >> testNotOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40070,7 +39065,6 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '&'. @@ -40079,8 +39073,7 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40115,7 +39108,6 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'or'. @@ -40125,8 +39117,7 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40161,8 +39152,7 @@ FASTPythonImporterTest >> testNotOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40271,7 +39261,6 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -40287,8 +39276,7 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40392,8 +39380,7 @@ FASTPythonImporterTest >> testNotOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40478,8 +39465,7 @@ FASTPythonImporterTest >> testNotOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40585,8 +39571,7 @@ FASTPythonImporterTest >> testNotOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - operators' } @@ -40819,8 +39804,7 @@ FASTPythonImporterTest >> testPrintStatmentWithChevron [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'file_object'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'file_object' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - raise statement' } @@ -40869,8 +39853,7 @@ FASTPythonImporterTest >> testRaiseAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'module' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - raise statement' } @@ -40904,7 +39887,6 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'ValueError'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'ValueError'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -40913,8 +39895,7 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'TypeError'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'TypeError' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - raise statement' } @@ -40959,8 +39940,7 @@ FASTPythonImporterTest >> testRaiseCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - raise statement' } @@ -40984,8 +39964,7 @@ FASTPythonImporterTest >> testRaiseIdentifier [ stack push: self topEntity exception. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - raise statement' } @@ -41018,7 +39997,6 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation value" @@ -41026,8 +40004,7 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'exceptions' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - literals' } @@ -41275,7 +40252,6 @@ FASTPythonImporterTest >> testReturnMultiple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'len'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'len'. stack pop. stack pop. @@ -41428,7 +40404,6 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation forClauses" @@ -41444,7 +40419,6 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -41469,8 +40443,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -41507,7 +40480,6 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41524,7 +40496,6 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41551,8 +40522,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -41588,7 +40558,6 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41605,7 +40574,6 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41632,8 +40600,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -41670,7 +40637,6 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -41680,7 +40646,6 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41697,7 +40662,6 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41724,8 +40688,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -41762,7 +40725,6 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -41772,7 +40734,6 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -41789,7 +40750,6 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41816,8 +40776,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -41854,7 +40813,6 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -41871,7 +40829,6 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41898,8 +40855,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -41935,13 +40891,11 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -41959,7 +40913,6 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41986,8 +40939,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42033,7 +40985,6 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42060,8 +41011,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42109,7 +41059,6 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -42118,7 +41067,6 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42135,7 +41083,6 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42162,8 +41109,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42217,7 +41163,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -42235,7 +41180,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42262,8 +41206,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42307,7 +41250,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -42316,7 +41258,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42333,7 +41274,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -42342,7 +41282,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -42360,7 +41299,6 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42387,8 +41325,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42433,7 +41370,6 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42460,8 +41396,7 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42507,7 +41442,6 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42534,8 +41468,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42581,7 +41514,6 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42608,8 +41540,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42637,7 +41568,6 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -42653,7 +41583,6 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42680,8 +41609,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42711,7 +41639,6 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation conditions" @@ -42727,7 +41654,6 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k1'. stack pop. stack push: (stack top operands at: 2). @@ -42752,7 +41678,6 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -42777,8 +41702,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42823,7 +41747,6 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42850,8 +41773,7 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42889,7 +41811,6 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -42916,7 +41837,6 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42943,8 +41863,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -42988,7 +41907,6 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43015,8 +41933,7 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43061,7 +41978,6 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -43071,7 +41987,6 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -43088,7 +42003,6 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43116,7 +42030,6 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -43135,7 +42048,6 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43162,8 +42074,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43189,7 +42100,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -43205,7 +42115,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -43214,7 +42123,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -43228,7 +42136,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43236,8 +42143,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43267,7 +42173,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -43291,7 +42196,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -43333,7 +42237,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -43370,7 +42273,6 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43397,8 +42299,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43443,7 +42344,6 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43470,8 +42370,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43508,7 +42407,6 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -43525,7 +42423,6 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43552,8 +42449,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43607,7 +42503,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43634,8 +42529,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43679,7 +42573,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -43689,7 +42582,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -43706,7 +42598,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43734,7 +42625,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -43753,7 +42643,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43780,8 +42669,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43827,7 +42715,6 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43854,8 +42741,7 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43901,7 +42787,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -43918,7 +42803,6 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43945,8 +42829,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -43992,7 +42875,6 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -44019,8 +42901,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -44056,7 +42937,6 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -44073,7 +42953,6 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -44100,8 +42979,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - comprehensions' } @@ -44138,7 +43016,6 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -44156,7 +43033,6 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -44183,8 +43059,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44217,8 +43092,7 @@ FASTPythonImporterTest >> testSetWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44298,7 +43172,6 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -44307,8 +43180,7 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44342,8 +43214,7 @@ FASTPythonImporterTest >> testSetWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44457,7 +43328,6 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -44465,8 +43335,7 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44619,8 +43488,7 @@ FASTPythonImporterTest >> testSetWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'element' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44681,7 +43549,6 @@ FASTPythonImporterTest >> testSetWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -44757,8 +43624,7 @@ FASTPythonImporterTest >> testSetWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44794,7 +43660,6 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -44810,7 +43675,6 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -44837,8 +43701,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44896,8 +43759,7 @@ FASTPythonImporterTest >> testSetWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -44966,7 +43828,6 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -44982,7 +43843,6 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45009,8 +43869,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -45044,7 +43903,6 @@ FASTPythonImporterTest >> testSetWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -45121,8 +43979,7 @@ FASTPythonImporterTest >> testSetWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -45276,7 +44133,6 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -45286,8 +44142,7 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45330,7 +44185,6 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45340,7 +44194,6 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -45355,7 +44208,6 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45365,7 +44217,6 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -45382,8 +44233,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'lst' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45434,8 +44284,7 @@ FASTPythonImporterTest >> testSliceBoolean [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'lst' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45486,7 +44335,6 @@ FASTPythonImporterTest >> testSliceCall [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -45495,7 +44343,6 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'indexOf'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'indexOf'. stack pop. stack pop. stack pop. @@ -45505,8 +44352,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45548,7 +44394,6 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -45557,7 +44402,6 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b'. stack pop. "Testing value of monovalue relation thenExpression" @@ -45566,14 +44410,12 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -45582,8 +44424,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'lst' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45616,8 +44457,7 @@ FASTPythonImporterTest >> testSliceEmpty [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45668,8 +44508,7 @@ FASTPythonImporterTest >> testSliceNone [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45703,7 +44542,6 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). @@ -45717,7 +44555,6 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45727,7 +44564,6 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'h'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'h'. stack pop. stack pop. stack pop. @@ -45737,8 +44573,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45793,8 +44628,7 @@ FASTPythonImporterTest >> testSliceReverse [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45845,7 +44679,6 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'pady'. stack pop. stack pop. @@ -45869,7 +44702,6 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'pady'. stack pop. stack pop. stack pop. @@ -45879,8 +44711,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -45969,8 +44800,7 @@ FASTPythonImporterTest >> testSliceUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46003,13 +44833,11 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -46018,8 +44846,7 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46063,8 +44890,7 @@ FASTPythonImporterTest >> testSliceWithEnd [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46108,8 +44934,7 @@ FASTPythonImporterTest >> testSliceWithStart [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46167,8 +44992,7 @@ FASTPythonImporterTest >> testSliceWithStartStopStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46212,8 +45036,7 @@ FASTPythonImporterTest >> testSliceWithStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - types' } @@ -46342,8 +45165,7 @@ FASTPythonImporterTest >> testSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'row' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46387,8 +45209,7 @@ FASTPythonImporterTest >> testSubscriptOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46432,8 +45253,7 @@ FASTPythonImporterTest >> testSubscriptOnAttributeWithParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'os'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'os' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46476,8 +45296,7 @@ FASTPythonImporterTest >> testSubscriptOnAwait [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46522,7 +45341,6 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -46531,8 +45349,7 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46577,8 +45394,7 @@ FASTPythonImporterTest >> testSubscriptOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46634,7 +45450,6 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -46642,8 +45457,7 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46704,8 +45518,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46758,7 +45571,6 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -46767,7 +45579,6 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -46784,7 +45595,6 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -46792,8 +45602,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46828,8 +45637,7 @@ FASTPythonImporterTest >> testSubscriptOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -46928,7 +45736,6 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -46938,7 +45745,6 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -46955,7 +45761,6 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -46982,8 +45787,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47026,8 +45830,7 @@ FASTPythonImporterTest >> testSubscriptOnListSplat [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47126,7 +45929,6 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47136,7 +45938,6 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47153,7 +45954,6 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47180,8 +45980,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47270,8 +46069,7 @@ FASTPythonImporterTest >> testSubscriptOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47315,13 +46113,11 @@ FASTPythonImporterTest >> testSubscriptOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47366,7 +46162,6 @@ FASTPythonImporterTest >> testSubscriptOnUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '-' @@ -47403,7 +46198,6 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -47412,8 +46206,7 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'coll' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47469,8 +46262,7 @@ FASTPythonImporterTest >> testSubscriptWithBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'values' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47502,7 +46294,6 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: (stack top indices at: 2). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -47510,8 +46301,7 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'imgs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'imgs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47553,8 +46343,7 @@ FASTPythonImporterTest >> testSubscriptWithTwoIndicies [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'loc'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'loc' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - subscripts' } @@ -47627,8 +46416,7 @@ FASTPythonImporterTest >> testSubscriptWithTwoSlices [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'arr'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'arr' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - literals' } @@ -47751,7 +46539,6 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -47770,7 +46557,6 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -47831,7 +46617,6 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -47876,7 +46661,6 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -47995,7 +46779,6 @@ FASTPythonImporterTest >> testTupleExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'toto'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'toto'. stack pop. stack pop. @@ -48164,7 +46947,6 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'bytearray'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'bytearray'. stack pop. stack pop. @@ -48204,8 +46986,7 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'self'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'self' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48238,8 +47019,7 @@ FASTPythonImporterTest >> testTupleWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48284,8 +47064,7 @@ FASTPythonImporterTest >> testTupleWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48319,7 +47098,6 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -48328,8 +47106,7 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48363,8 +47140,7 @@ FASTPythonImporterTest >> testTupleWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48397,13 +47173,11 @@ FASTPythonImporterTest >> testTupleWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -48476,7 +47250,6 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -48484,8 +47257,7 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48536,8 +47308,7 @@ FASTPythonImporterTest >> testTupleWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48579,7 +47350,6 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -48588,7 +47358,6 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -48605,7 +47374,6 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -48613,8 +47381,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48715,8 +47482,7 @@ FASTPythonImporterTest >> testTupleWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48777,7 +47543,6 @@ FASTPythonImporterTest >> testTupleWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -48866,7 +47631,6 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -48876,7 +47640,6 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -48893,7 +47656,6 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -48920,8 +47682,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -48953,8 +47714,7 @@ FASTPythonImporterTest >> testTupleWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -49012,8 +47772,7 @@ FASTPythonImporterTest >> testTupleWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -49092,7 +47851,6 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -49102,7 +47860,6 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -49119,7 +47876,6 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -49146,8 +47902,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -49216,8 +47971,7 @@ FASTPythonImporterTest >> testTupleWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -49275,13 +48029,11 @@ FASTPythonImporterTest >> testTupleWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - collections' } @@ -49315,7 +48067,6 @@ FASTPythonImporterTest >> testTupleWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -49446,7 +48197,6 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -49462,8 +48212,7 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - statements' } @@ -49508,7 +48257,6 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -49524,8 +48272,7 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - types' } @@ -49572,7 +48319,6 @@ FASTPythonImporterTest >> testTypeAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'subprocess'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'subprocess'. stack pop. stack pop. stack pop. @@ -49629,7 +48375,6 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. self assert: self topEntity operator equals: '|'. @@ -49639,7 +48384,6 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'str'. stack pop. stack pop. stack pop. @@ -49697,7 +48441,6 @@ FASTPythonImporterTest >> testTypeCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack pop. stack pop. @@ -50040,7 +48783,6 @@ FASTPythonImporterTest >> testTypeIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Path'. stack pop. stack pop. @@ -50200,7 +48942,6 @@ FASTPythonImporterTest >> testTypeList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'object'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'object'. stack pop. stack pop. stack pop. @@ -50258,7 +48999,6 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T'. stack pop. "Testing value of multivalued relation forClauses" @@ -50274,7 +49014,6 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T'. stack pop. "Testing value of monovalue relation right" @@ -50291,7 +49030,6 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -50453,8 +49191,7 @@ FASTPythonImporterTest >> testTypeParametersInFunctionDefinition [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - types' } @@ -50500,7 +49237,6 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'T'. stack pop. stack pop. @@ -50514,7 +49250,6 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -50527,8 +49262,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'L'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'L' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - types' } @@ -50845,7 +49579,6 @@ FASTPythonImporterTest >> testTypedListSplatParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Any'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Any'. stack pop. stack pop. stack pop. @@ -50903,7 +49636,6 @@ FASTPythonImporterTest >> testTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'Path'. stack pop. stack pop. stack pop. @@ -50965,7 +49697,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -51002,7 +49733,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -51060,7 +49790,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'e'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'e'. stack pop. stack pop. self assert: self topEntity operator equals: '-'. @@ -51100,7 +49829,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -51110,7 +49838,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -51149,7 +49876,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -51186,13 +49912,11 @@ FASTPythonImporterTest >> testUnaryOperatorWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -51271,7 +49995,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -51280,7 +50003,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -51367,7 +50089,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '~' ] @@ -51433,7 +50154,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -51510,7 +50230,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -51576,7 +50295,6 @@ FASTPythonImporterTest >> testUnaryOperatorWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -51659,7 +50377,6 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'bytes'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'bytes'. stack pop. stack pop. stack pop. @@ -51675,7 +50392,6 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -51730,8 +50446,7 @@ FASTPythonImporterTest >> testVariableDeclaration [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'ModuleType'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'ModuleType' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -51792,8 +50507,7 @@ FASTPythonImporterTest >> testWalrusAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -51875,7 +50589,6 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -51884,8 +50597,7 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -51920,8 +50632,7 @@ FASTPythonImporterTest >> testWalrusCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'obj' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52030,7 +50741,6 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -52046,8 +50756,7 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52205,8 +50914,7 @@ FASTPythonImporterTest >> testWalrusIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'element' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52269,7 +50977,6 @@ FASTPythonImporterTest >> testWalrusLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -52312,8 +51019,7 @@ FASTPythonImporterTest >> testWalrusList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'remote' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52346,8 +51052,7 @@ FASTPythonImporterTest >> testWalrusListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'args' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52384,7 +51089,6 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -52400,7 +51104,6 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -52427,8 +51130,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52488,8 +51190,7 @@ FASTPythonImporterTest >> testWalrusNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'old' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52523,14 +51224,12 @@ FASTPythonImporterTest >> testWalrusPatternList [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52602,7 +51301,6 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -52618,7 +51316,6 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -52645,8 +51342,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'range' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52717,8 +51413,7 @@ FASTPythonImporterTest >> testWalrusSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'attrs' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52779,13 +51474,11 @@ FASTPythonImporterTest >> testWalrusTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'b' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - assignments' } @@ -52938,7 +51631,6 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -52958,7 +51650,6 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -52966,8 +51657,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'fun' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests - with statements' } @@ -53004,7 +51694,6 @@ FASTPythonImporterTest >> testWithStatement [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -53058,7 +51747,6 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -53068,7 +51756,6 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -53112,7 +51799,6 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'expr1'. stack pop. "Testing value of monovalue relation target" @@ -53121,7 +51807,6 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target1'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'target1'. stack pop. stack pop. @@ -53135,7 +51820,6 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr2'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'expr2'. stack pop. "Testing value of monovalue relation target" @@ -53144,7 +51828,6 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target2'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'target2'. stack pop. stack pop. @@ -53158,7 +51841,6 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr3'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'expr3'. stack pop. "Testing value of monovalue relation target" @@ -53167,7 +51849,6 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target3'. self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'target3'. stack pop. stack pop. @@ -53216,8 +51897,7 @@ FASTPythonImporterTest >> testYieldFrom [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'tests' } @@ -53241,8 +51921,7 @@ FASTPythonImporterTest >> testYieldWithIdentifier [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier). - self assert: self topEntity name equals: 'x' + self assert: (self topEntity isOfType: FASTPyIdentifier) ] { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st deleted file mode 100644 index 6509491..0000000 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ /dev/null @@ -1,1288 +0,0 @@ -Class { - #name : 'FASTPythonLocalResolverTest', - #superclass : 'FASTPythonAbstractTestCase', - #instVars : [ - 'model' - ], - #category : 'FAST-Python-Tools-Tests-Algos', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Algos' -} - -{ #category : 'resolving' } -FASTPythonLocalResolverTest >> parseAndResolve: aString [ - - model := self parse: aString. - - FASTPythonLocalResolverVisitor resolve: model module -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testAssignementToTuple [ - - | assignedVariableX assignedVariableY usedVariableX | - self parseAndResolve: 'x, y = 1, 2 - -print(x)'. - - assignedVariableX := model module statements first left initializers first. - self assert: assignedVariableX localDeclaration equals: assignedVariableX. - self assert: assignedVariableX localDeclaration name equals: 'x'. - self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariableX localDeclaration isVariableWriteAccess. - self deny: assignedVariableX localDeclaration isNonLocalDeclaration. - self assert: assignedVariableX localDeclaration localUses size equals: 2. - self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. - - usedVariableX := model module statements second arguments first. - self assert: usedVariableX localDeclaration equals: assignedVariableX. - self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. - - assignedVariableY := model module statements first left initializers second. - self assert: assignedVariableY localDeclaration equals: assignedVariableY. - self assert: assignedVariableY localDeclaration name equals: 'y'. - self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariableY localDeclaration isVariableWriteAccess. - self deny: assignedVariableY localDeclaration isNonLocalDeclaration. - self assert: assignedVariableY localDeclaration localUses size equals: 1. - self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testAssignementToTupleInTuples [ - - | assignedVariableX assignedVariableY assignedVariableZ usedVariableX usedVariableY usedVariableZ | - self parseAndResolve: 'x, (y, z) = 1, (2, 4) - -print(x) -print(y) -print(z)'. - - assignedVariableX := model module statements first left initializers first. - self assert: assignedVariableX localDeclaration equals: assignedVariableX. - self assert: assignedVariableX localDeclaration name equals: 'x'. - self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariableX localDeclaration isVariableWriteAccess. - self deny: assignedVariableX localDeclaration isNonLocalDeclaration. - self assert: assignedVariableX localDeclaration localUses size equals: 2. - self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. - - usedVariableX := model module statements second arguments first. - self assert: usedVariableX localDeclaration equals: assignedVariableX. - self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. - - assignedVariableY := model module statements first left initializers second initializers first. - self assert: assignedVariableY localDeclaration equals: assignedVariableY. - self assert: assignedVariableY localDeclaration name equals: 'y'. - self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariableY localDeclaration isVariableWriteAccess. - self deny: assignedVariableY localDeclaration isNonLocalDeclaration. - self assert: assignedVariableY localDeclaration localUses size equals: 2. - self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. - - usedVariableY := model module statements third arguments first. - self assert: usedVariableY localDeclaration equals: assignedVariableY. - self assert: usedVariableY equals: assignedVariableY localDeclaration localUses second. - - assignedVariableZ := model module statements first left initializers second initializers second. - self assert: assignedVariableZ localDeclaration equals: assignedVariableZ. - self assert: assignedVariableZ localDeclaration name equals: 'z'. - self assert: assignedVariableZ localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariableZ localDeclaration isVariableWriteAccess. - self deny: assignedVariableZ localDeclaration isNonLocalDeclaration. - self assert: assignedVariableZ localDeclaration localUses size equals: 2. - self assert: assignedVariableZ localDeclaration localUses first equals: assignedVariableZ. - - usedVariableZ := model module statements fourth arguments first. - self assert: usedVariableZ localDeclaration equals: assignedVariableZ. - self assert: usedVariableZ equals: assignedVariableZ localDeclaration localUses second -] - -{ #category : 'tests - non local declarations' } -FASTPythonLocalResolverTest >> testAttributeAccessHalfResolved [ - "Here x is resolved but y is not resolved locally." - - | import importedEntity receiver value | - self parseAndResolve: 'import x - -x.y'. - - import := model module statements first. - importedEntity := import importedEntities first. - self assert: importedEntity localDeclaration equals: import. - self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - receiver := model module statements second value. - self assert: receiver localDeclaration equals: import. - self deny: receiver localDeclaration isNonLocalDeclaration. - self assert: receiver localDeclaration localUses second equals: receiver. - - value := model module statements second. - self assert: value localDeclaration name equals: 'y'. - self assert: value localDeclaration isNonLocalDeclaration. - self assert: value localDeclaration localUses size equals: 1. - self assert: value localDeclaration localUses first equals: value -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ - - | assignedVariable | - self parseAndResolve: 'x = 3 - -# {x: 2}'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 1. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -x'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - imports' } -FASTPythonLocalResolverTest >> testFromImportedEntity [ - - | import importedEntity call | - self parseAndResolve: 'from matplotlib import __version__ - -print(__version__)'. - - import := model module statements first. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self deny: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first segments last equals: '__version__'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - call := model module statements second arguments first. - self assert: call localDeclaration equals: import. - self assert: call equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - imports' } -FASTPythonLocalResolverTest >> testFromImportedEntityWithAlias [ - - | import importedEntity call | - self parseAndResolve: 'from matplotlib import __version__ as v - -print(v)'. - - import := model module statements first. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self assert: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first alias equals: 'v'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - call := model module statements second arguments first. - self assert: call localDeclaration equals: import. - self assert: call equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - imports' } -FASTPythonLocalResolverTest >> testFromImportedEntityWithAliasDoesNotShadowVariable [ - - | import importedEntity call assignedVariable usedVariable1 usedVariable2 | - self parseAndResolve: 'x = 1 - -print(x) - -from y import x as func - -func() - -print(x)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable1 := model module statements second arguments first. - self assert: usedVariable1 localDeclaration equals: assignedVariable. - self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. - - usedVariable2 := model module statements fifth arguments first. - self assert: usedVariable2 localDeclaration equals: assignedVariable. - self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. - - import := model module statements third. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self assert: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - call := model module statements fourth callee. - self assert: call localDeclaration equals: import. - self assert: call equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - functions' } -FASTPythonLocalResolverTest >> testFunctionDeclaredAndCalled [ - - | functionDefinition call | - self parseAndResolve: 'def func(): - pass - -func()'. - - functionDefinition := model module statements first. - self assert: functionDefinition localDeclaration equals: functionDefinition. - self assert: functionDefinition localDeclaration name equals: 'func'. - self deny: functionDefinition localDeclaration isNonLocalDeclaration. - self assert: functionDefinition localDeclaration localUses size equals: 2. - self assert: functionDefinition localDeclaration localUses first equals: functionDefinition. - - call := model module statements second callee. - self assert: call localDeclaration equals: functionDefinition. - self assert: call equals: functionDefinition localDeclaration localUses second -] - -{ #category : 'tests - parameters' } -FASTPythonLocalResolverTest >> testFunctionParameter [ - - | declaration usedVariable | - self parseAndResolve: 'def funct(y): - return y'. - - declaration := model module statements first parameters first. - self assert: declaration localDeclaration equals: declaration. - self assert: declaration localDeclaration name equals: 'y'. - self assert: declaration localDeclaration isVariableWriteAccess. - self deny: declaration localDeclaration isNonLocalDeclaration. - self assert: declaration localDeclaration localUses size equals: 2. - self assert: declaration localDeclaration localUses first equals: declaration. - - usedVariable := model module statements first statements first expression. - self assert: usedVariable localDeclaration equals: declaration. - self assert: usedVariable equals: declaration localDeclaration localUses second -] - -{ #category : 'tests - parameters' } -FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ - - | declaration usedVariable | - self parseAndResolve: 'def funct(y=3): - return y'. - - declaration := model module statements first parameters first. - self assert: declaration localDeclaration equals: declaration. - self assert: declaration localDeclaration name equals: 'y'. - self assert: declaration localDeclaration isVariableWriteAccess. - self deny: declaration localDeclaration isNonLocalDeclaration. - self assert: declaration localDeclaration localUses size equals: 2. - self assert: declaration localDeclaration localUses first equals: declaration. - - usedVariable := model module statements first statements first expression. - self assert: usedVariable localDeclaration equals: declaration. - self assert: usedVariable equals: declaration localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ - - | assignedGlobal usedGlobal assignedTemporary temporaryUsage1 temporaryUsage2 | - self parseAndResolve: 'glob = 1 - -def fun(): - glob = 3 - print(glob) - return glob - -fun() -print(glob)'. - - assignedGlobal := model module statements first left. - self assert: assignedGlobal localDeclaration equals: assignedGlobal. - self assert: assignedGlobal localDeclaration name equals: 'glob'. - self assert: assignedGlobal localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedGlobal localDeclaration isNonLocalDeclaration. - self assert: assignedGlobal localDeclaration localUses size equals: 2. - self assert: assignedGlobal localDeclaration localUses first equals: assignedGlobal. - - usedGlobal := model module statements fourth arguments first. - self assert: usedGlobal localDeclaration equals: assignedGlobal. - self assert: usedGlobal equals: assignedGlobal localDeclaration localUses second. - - assignedTemporary := model module statements second statements first left. - self assert: assignedTemporary localDeclaration equals: assignedTemporary. - self assert: assignedTemporary localDeclaration name equals: 'glob'. - self assert: assignedTemporary localDeclaration variableDeclarator equals: model module statements second statements first. - self deny: assignedTemporary localDeclaration isNonLocalDeclaration. - self assert: assignedTemporary localDeclaration localUses size equals: 3. - self assert: assignedTemporary localDeclaration localUses first equals: assignedTemporary. - - temporaryUsage1 := model module statements second statements second arguments first. - self assert: temporaryUsage1 localDeclaration equals: assignedTemporary. - self assert: temporaryUsage1 equals: assignedTemporary localDeclaration localUses second. - - temporaryUsage2 := model module statements second statements third expression. - self assert: temporaryUsage2 localDeclaration equals: assignedTemporary. - self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third -] - -{ #category : 'tests - shadowing' } -FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ - "Here we cannot know if the second printing is of a variable." - - | assignedVariable usedVariable import importedEntity usedImportedEntity | - self parseAndResolve: 'x = 1 -print(x) - -import x - -print(x)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second. - - import := model module statements third. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self deny: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - usedImportedEntity := model module statements fourth arguments first. - self assert: usedImportedEntity localDeclaration equals: import. - self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - shadowing' } -FASTPythonLocalResolverTest >> testGlobalShadowedByImportAlias [ - "Here we cannot know if the second printing is of a variable." - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -print(x) - -import a as x - -print(x)'. - - self skip. "We need to update the behavior" - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second. - - self deny: model module statements fourth arguments first hasLocalDeclaration -] - -{ #category : 'tests - shadowing' } -FASTPythonLocalResolverTest >> testGlobalShadowedByImportInFunction [ - - | assignedVariable usedVariable1 usedVariable2 | - self parseAndResolve: 'matplotlib = 3 - -print(matplotlib) - -def f(): - import matplotlib - return matplotlib - -print(matplotlib)'. - - self skip. "To update and fix" - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'matplotlib'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable1 := model module statements second arguments first. - self assert: usedVariable1 localDeclaration equals: assignedVariable. - self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. - - usedVariable2 := model module statements fourth arguments first. - self assert: usedVariable2 localDeclaration equals: assignedVariable. - self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsageInCall [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -print(x)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 3 - -{x: 2}'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second initializers first key. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ - - | assignedVariable usedVariable | - self parseAndResolve: 'glob = 1 - -def fun(): - return glob - -print(fun())'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'glob'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second statements first expression. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsedInLambda [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 1 - -lambda: x'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second expression. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsedInList [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 3 - -[ x ]'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second initializers first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsedInSet [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 3 - -{ x }'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second initializers first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - globals' } -FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 3 - -(x, 2)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second initializers first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - shadowing' } -FASTPythonLocalResolverTest >> testImportShadowedByImport [ - "Here we cannot know if the second printing is of a variable." - - | import importedEntity1 usedImportedEntity1 importedEntity2 usedImportedEntity2 | - self parseAndResolve: 'import time - -print(time) - -from time import time - -print(time)'. - - import := model module statements first. - importedEntity1 := import importedEntities anyOne. - self assert: importedEntity1 localDeclaration equals: import. - self deny: importedEntity1 localDeclaration importedEntities first hasAlias. - self assert: importedEntity1 localDeclaration importedEntities first segments last equals: 'time'. - self deny: importedEntity1 localDeclaration isNonLocalDeclaration. - self assert: importedEntity1 localDeclaration localUses size equals: 4. - self assert: importedEntity1 localDeclaration localUses first equals: importedEntity1. - - usedImportedEntity1 := model module statements second arguments first. - self assert: usedImportedEntity1 localDeclaration equals: import. - self assert: usedImportedEntity1 equals: importedEntity1 localDeclaration localUses second. - - importedEntity2 := model module statements third importedEntities anyOne. - self assert: importedEntity2 localDeclaration equals: import. - self assert: importedEntity2 localDeclaration localUses third equals: importedEntity2. - - usedImportedEntity2 := model module statements fourth arguments first. - self assert: usedImportedEntity2 localDeclaration equals: import. - self assert: usedImportedEntity2 equals: importedEntity2 localDeclaration localUses fourth -] - -{ #category : 'tests - imports' } -FASTPythonLocalResolverTest >> testImportedEntity [ - - | import importedEntity call | - self parseAndResolve: 'import func - -func()'. - - import := model module statements first. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self deny: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first segments last equals: 'func'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - call := model module statements second callee. - self assert: call localDeclaration equals: import. - self assert: call equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - imports' } -FASTPythonLocalResolverTest >> testImportedEntityWithAlias [ - - | import importedEntity call | - self parseAndResolve: 'import functi as func - -func()'. - - import := model module statements first. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self assert: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - call := model module statements second callee. - self assert: call localDeclaration equals: import. - self assert: call equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - imports' } -FASTPythonLocalResolverTest >> testImportedEntityWithAliasDoesNotShadowVariable [ - - | import importedEntity call assignedVariable usedVariable1 usedVariable2 | - self parseAndResolve: 'x = 1 - -print(x) - -import x as func - -func() - -print(x)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable1 := model module statements second arguments first. - self assert: usedVariable1 localDeclaration equals: assignedVariable. - self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. - - usedVariable2 := model module statements fifth arguments first. - self assert: usedVariable2 localDeclaration equals: assignedVariable. - self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. - - import := model module statements third. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self assert: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - call := model module statements fourth callee. - self assert: call localDeclaration equals: import. - self assert: call equals: importedEntity localDeclaration localUses second -] - -{ #category : 'tests - parameters' } -FASTPythonLocalResolverTest >> testLambdaParameter [ - - | declaration usedVariable | - self parseAndResolve: 'lambda y: y'. - - declaration := model module statements first parameters first. - self assert: declaration localDeclaration equals: declaration. - self assert: declaration localDeclaration name equals: 'y'. - self assert: declaration localDeclaration isVariableWriteAccess. - self deny: declaration localDeclaration isNonLocalDeclaration. - self assert: declaration localDeclaration localUses size equals: 2. - self assert: declaration localDeclaration localUses first equals: declaration. - - usedVariable := model module statements first expression. - self assert: usedVariable localDeclaration equals: declaration. - self assert: usedVariable equals: declaration localDeclaration localUses second -] - -{ #category : 'tests - local variables' } -FASTPythonLocalResolverTest >> testLocalVariableInFunction [ - - | assignedVariable usedVariable | - self parseAndResolve: 'def f(): - x = 1 - return x - -print(f())'. - - assignedVariable := model module statements first statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements first statements second expression. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - local variables' } -FASTPythonLocalResolverTest >> testLocalVariableInFunctionWithTuples [ - - | assignedVariableX assignedVariableY usedVariable | - self parseAndResolve: 'def f(): - x, y = 1, 2 - return x - -print(f())'. - - assignedVariableX := model module statements first statements first left initializers first. - self assert: assignedVariableX localDeclaration equals: assignedVariableX. - self assert: assignedVariableX localDeclaration name equals: 'x'. - self assert: assignedVariableX localDeclaration isVariableWriteAccess. - self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first statements first. - self deny: assignedVariableX localDeclaration isNonLocalDeclaration. - self assert: assignedVariableX localDeclaration localUses size equals: 2. - self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. - - usedVariable := model module statements first statements second expression. - self assert: usedVariable localDeclaration equals: assignedVariableX. - self assert: usedVariable equals: assignedVariableX localDeclaration localUses second. - - assignedVariableY := model module statements first statements first left initializers second. - self assert: assignedVariableY localDeclaration equals: assignedVariableY. - self assert: assignedVariableY localDeclaration name equals: 'y'. - self assert: assignedVariableY localDeclaration isVariableWriteAccess. - self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first statements first. - self deny: assignedVariableY localDeclaration isNonLocalDeclaration. - self assert: assignedVariableY localDeclaration localUses size equals: 1. - self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. - -] - -{ #category : 'tests - methods' } -FASTPythonLocalResolverTest >> testMethodRedefined [ - - | declaration1 declaration2 | - self parseAndResolve: 'class C: - def meth(self): - return self - - def meth(self): - return self'. - - declaration1 := model module statements first statements first. - self assert: declaration1 localDeclaration equals: declaration1. - self assert: declaration1 localDeclaration name equals: 'meth'. - self deny: declaration1 localDeclaration isNonLocalDeclaration. - self assert: declaration1 localDeclaration localUses size equals: 2. - self assert: declaration1 localDeclaration localUses first equals: declaration1. - - declaration2 := model module statements first statements second. - self assert: declaration2 localDeclaration equals: declaration1. - self assert: declaration1 localDeclaration localUses second equals: declaration2 -] - -{ #category : 'tests - parameters' } -FASTPythonLocalResolverTest >> testMethodSelfParameter [ - - | declaration usedVariable | - self parseAndResolve: 'class C: - def meth(self): - return self'. - - declaration := model module statements first statements first parameters first. - self assert: declaration localDeclaration equals: declaration. - self assert: declaration localDeclaration name equals: 'self'. - self assert: declaration localDeclaration isVariableWriteAccess. - self deny: declaration localDeclaration isNonLocalDeclaration. - self assert: declaration localDeclaration localUses size equals: 2. - self assert: declaration localDeclaration localUses first equals: declaration. - - usedVariable := model module statements first statements first statements first expression. - self assert: usedVariable localDeclaration equals: declaration. - self assert: usedVariable equals: declaration localDeclaration localUses second -] - -{ #category : 'tests - parameters' } -FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ - - | declaration usedVariable | - self parseAndResolve: 'class C: - def meth(this): - return this'. - - declaration := model module statements first statements first parameters first. - self assert: declaration localDeclaration equals: declaration. - self assert: declaration localDeclaration name equals: 'this'. - self assert: declaration localDeclaration isVariableWriteAccess. - self deny: declaration localDeclaration isNonLocalDeclaration. - self assert: declaration localDeclaration localUses size equals: 2. - self assert: declaration localDeclaration localUses first equals: declaration. - - usedVariable := model module statements first statements first statements first expression. - self assert: usedVariable localDeclaration equals: declaration. - self assert: usedVariable equals: declaration localDeclaration localUses second -] - -{ #category : 'tests - non local declarations' } -FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ - - | nonLocalCall nonLocalAccess | - self parseAndResolve: 'print(x)'. - - nonLocalCall := model module statements first callee. - self assert: nonLocalCall localDeclaration name equals: 'print'. - self assert: nonLocalCall localDeclaration isNonLocalDeclaration. - self assert: nonLocalCall localDeclaration localUses size equals: 1. - self assert: nonLocalCall localDeclaration localUses first equals: nonLocalCall. - - nonLocalAccess := model module statements first arguments first. - self assert: nonLocalAccess localDeclaration name equals: 'x'. - self assert: nonLocalAccess localDeclaration isNonLocalDeclaration. - self assert: nonLocalAccess localDeclaration localUses size equals: 1. - self assert: nonLocalAccess localDeclaration localUses first equals: nonLocalAccess -] - -{ #category : 'tests - shadowing' } -FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ - - | parameter usedParameter assignedVariable usedVariable | - self parseAndResolve: 'def func(param): - print(param) - param = 3 - print(param)'. - - parameter := model module statements first parameters first. - self assert: parameter localDeclaration equals: parameter. - self assert: parameter localDeclaration name equals: 'param'. - self deny: parameter localDeclaration isNonLocalDeclaration. - self assert: parameter localDeclaration localUses size equals: 2. - self assert: parameter localDeclaration localUses first equals: parameter. - - usedParameter := model module statements first statements first arguments first. - self assert: usedParameter localDeclaration equals: parameter. - self assert: usedParameter equals: parameter localDeclaration localUses second. - - assignedVariable := model module statements first statements second left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'param'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements second. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements first statements third arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ - - | assignedVariable1 assignedVariable2 usedVariable | - self parseAndResolve: 'x = 1 -x = 2 -x'. - - assignedVariable1 := model module statements first left. - self assert: assignedVariable1 localDeclaration equals: assignedVariable1. - self assert: assignedVariable1 localDeclaration name equals: 'x'. - self assert: assignedVariable1 localDeclaration isVariableWriteAccess. - self assert: assignedVariable1 localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. - self assert: assignedVariable1 localDeclaration localUses size equals: 3. - self assert: assignedVariable1 localDeclaration localUses first equals: assignedVariable1. - - assignedVariable2 := model module statements second left. - self assert: assignedVariable2 localDeclaration equals: assignedVariable1. - self assert: assignedVariable2 equals: assignedVariable1 localDeclaration localUses second. - - usedVariable := model module statements third. - self assert: usedVariable localDeclaration equals: assignedVariable1. - self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testTwoResolutionsDoNotClash [ - - | assignedVariable usedVariable | - self parseAndResolve: 'x = 1 -print(x)'. - - "Do a second resolution to ensure the first one is cleared" - FASTPythonLocalResolverVisitor resolve: model module. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ - - | assignedVariable usedVariable | - self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] -for x in fruits: - pass'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'fruits'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - - usedVariable := model module statements second right. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testVariableAccessedInIf [ - - | assignedVariable usedVariable1 usedVariable2 | - self parseAndResolve: 'glob = 1 - -if glob < 3: - print(glob)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'glob'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - - usedVariable1 := model module statements second condition operands first. - self assert: usedVariable1 localDeclaration equals: assignedVariable. - self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. - - usedVariable2 := model module statements second thenClause statements first arguments first. - self assert: usedVariable2 localDeclaration equals: assignedVariable. - self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableDeclaredInFor [ - - | declared usedVariable | - self parseAndResolve: 'for x in "banana": - i = 2 - -print(i)'. - - declared := model module statements first statements first left. - self assert: declared localDeclaration equals: declared. - self assert: declared localDeclaration name equals: 'i'. - self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. - self assert: declared localDeclaration isVariableWriteAccess. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 2. - self assert: declared localDeclaration localUses first equals: declared. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: declared. - self assert: usedVariable equals: declared localDeclaration localUses second -] - -{ #category : 'tests - while' } -FASTPythonLocalResolverTest >> testVariableDeclaredInWhile [ - - | declared usedVariable | - self parseAndResolve: 'while False: - i = 2 - -print(i)'. - - declared := model module statements first statements first left. - self assert: declared localDeclaration equals: declared. - self assert: declared localDeclaration name equals: 'i'. - self assert: declared localDeclaration isVariableWriteAccess. - self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 2. - self assert: declared localDeclaration localUses first equals: declared. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: declared. - self assert: usedVariable equals: declared localDeclaration localUses second -] - -{ #category : 'tests - comprehensions' } -FASTPythonLocalResolverTest >> testVariableInListComprehensions [ - - | declared usedVariable | - self parseAndResolve: 'fruits = ["apple", "banana", "cherry", "kiwi", "mango"] - -[x for x in fruits]'. - - declared := model module statements second forClauses first left. - self assert: declared localDeclaration equals: declared. - self assert: declared localDeclaration name equals: 'x'. - self assert: declared localDeclaration isVariableWriteAccess. - self assert: declared localDeclaration variableDeclarator equals: model module statements second forClauses first. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 2. - self assert: declared localDeclaration localUses first equals: declared. - - usedVariable := model module statements second body. - self assert: usedVariable localDeclaration equals: declared. - self assert: usedVariable equals: declared localDeclaration localUses second -] - -{ #category : 'tests - comprehensions' } -FASTPythonLocalResolverTest >> testVariableInListComprehensionsDoesNotLeak [ - "Here the x of the comprehension should not leek outside of it if we consider we are in Python 3" - - | import importedEntity declared usedVariable usedImportedEntity | - self parseAndResolve: 'import x - -fruits = ["apple", "banana", "cherry", "kiwi", "mango"] - -[x for x in fruits] - -print(x)'. - - import := model module statements first. - importedEntity := import importedEntities anyOne. - self assert: importedEntity localDeclaration equals: import. - self deny: importedEntity localDeclaration importedEntities first hasAlias. - self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. - self deny: importedEntity localDeclaration isNonLocalDeclaration. - self assert: importedEntity localDeclaration localUses size equals: 2. - self assert: importedEntity localDeclaration localUses first equals: importedEntity. - - usedImportedEntity := model module statements fourth arguments first. - self assert: usedImportedEntity localDeclaration equals: import. - self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. - - declared := model module statements third forClauses first left. - self assert: declared localDeclaration equals: declared. - self assert: declared localDeclaration name equals: 'x'. - self assert: declared localDeclaration isVariableWriteAccess. - self assert: declared localDeclaration variableDeclarator equals: model module statements third forClauses first. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 2. - self assert: declared localDeclaration localUses first equals: declared. - - usedVariable := model module statements third body. - self assert: usedVariable localDeclaration equals: declared. - self assert: usedVariable equals: declared localDeclaration localUses second -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableOfFor [ - - | declared usedVariable | - self parseAndResolve: 'for x in "banana": - print(x)'. - - declared := model module statements first left. - self assert: declared localDeclaration equals: declared. - self assert: declared localDeclaration name equals: 'x'. - self assert: declared localDeclaration variableDeclarator equals: model module statements first. - self assert: declared localDeclaration isVariableWriteAccess. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 2. - self assert: declared localDeclaration localUses first equals: declared. - - usedVariable := model module statements first statements first arguments first. - self assert: usedVariable localDeclaration equals: declared. - self assert: usedVariable equals: declared localDeclaration localUses second -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableOfForClashingWithOtherVariables [ - - | assignedVariable assignedVariableInFor usedVariable | - self parseAndResolve: 'x = 3 - -for x in range(5): - print(x)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - assignedVariableInFor := model module statements second left. - self assert: assignedVariableInFor localDeclaration equals: assignedVariable. - self assert: assignedVariableInFor equals: assignedVariableInFor localDeclaration localUses second. - - usedVariable := model module statements second statements first arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: usedVariable localDeclaration localUses third -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableOfForRedefinedInside [ - - | declared usedVariable | - self parseAndResolve: 'for x in range(5): - x += 1'. - - declared := model module statements first left. - self assert: declared localDeclaration equals: declared. - self assert: declared localDeclaration name equals: 'x'. - self assert: declared localDeclaration variableDeclarator equals: model module statements first. - self assert: declared localDeclaration isVariableWriteAccess. - self deny: declared localDeclaration isNonLocalDeclaration. - self assert: declared localDeclaration localUses size equals: 2. - self assert: declared localDeclaration localUses first equals: declared. - - usedVariable := model module statements first statements first left. - self assert: usedVariable localDeclaration equals: declared. - self assert: usedVariable equals: declared localDeclaration localUses second -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ - - | assignedVariable usedVariable | - self parseAndResolve: 'for x in range(5): - pass - -print(x)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'x'. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. - - usedVariable := model module statements second arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: usedVariable localDeclaration localUses second -] - -{ #category : 'tests - for' } -FASTPythonLocalResolverTest >> testVariableOfForWithTuple [ - - | declaredA usedVariableA declaredB usedVariableB | - self parseAndResolve: 'for a, b in arg: - print(a, b)'. - - declaredA := model module statements first left initializers first. - self assert: declaredA localDeclaration equals: declaredA. - self assert: declaredA localDeclaration name equals: 'a'. - self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. - self assert: declaredA localDeclaration isVariableWriteAccess. - self deny: declaredA localDeclaration isNonLocalDeclaration. - self assert: declaredA localDeclaration localUses size equals: 2. - self assert: declaredA localDeclaration localUses first equals: declaredA. - - usedVariableA := model module statements first statements first arguments first. - self assert: usedVariableA localDeclaration equals: declaredA. - self assert: usedVariableA equals: declaredA localDeclaration localUses second. - - declaredB := model module statements first left initializers second. - self assert: declaredB localDeclaration equals: declaredB. - self assert: declaredB localDeclaration name equals: 'b'. - self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. - self assert: declaredB localDeclaration isVariableWriteAccess. - self deny: declaredB localDeclaration isNonLocalDeclaration. - self assert: declaredB localDeclaration localUses size equals: 2. - self assert: declaredB localDeclaration localUses first equals: declaredB. - - usedVariableB := model module statements first statements first arguments second. - self assert: usedVariableB localDeclaration equals: declaredB. - self assert: usedVariableB equals: declaredB localDeclaration localUses second -] - -{ #category : 'tests' } -FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ - - | assignedVariable assignedVariable2 usedVariable | - self parseAndResolve: 'glob = 1 - -if True: - glob = 3 - -print(glob)'. - - assignedVariable := model module statements first left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'glob'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 3. - - assignedVariable2 := model module statements second thenClause statements first left. - self assert: assignedVariable2 localDeclaration equals: assignedVariable. - self assert: assignedVariable2 equals: assignedVariable localDeclaration localUses second. - - usedVariable := model module statements third arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses third -] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st deleted file mode 100644 index f55ecbf..0000000 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ /dev/null @@ -1,261 +0,0 @@ -Class { - #name : 'FASTPythonSSATest', - #superclass : 'FASTPythonAbstractTestCase', - #instVars : [ - 'model' - ], - #category : 'FAST-Python-Tools-Tests-Algos', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Algos' -} - -{ #category : 'parsing' } -FASTPythonSSATest >> parseAndResolve: aString [ - - model := self parse: aString. - - FASTPythonSSAVisitor resolve: model module -] - -{ #category : 'tests - for' } -FASTPythonSSATest >> testForVariableUsed [ - - | assignedVar usedVar | - self parseAndResolve: 'for x in range(5): - print(x)'. - - assignedVar := model module statements first left. - self assert: assignedVar ssaVersion version equals: 1. - self assert: assignedVar ssaName equals: 'x_1'. - self assert: assignedVar ssaVersion localUses size equals: 2. - - usedVar := model module statements first statements first arguments first. - self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion -] - -{ #category : 'tests - for' } -FASTPythonSSATest >> testForVariablesInTupleUsed [ - - | assignedVarA assignedVarB usedVarA usedVarB | - self parseAndResolve: 'for a, b in data: - print(a, b)'. - - assignedVarA := model module statements first left initializers first. - self assert: assignedVarA ssaVersion version equals: 1. - self assert: assignedVarA ssaName equals: 'a_1'. - self assert: assignedVarA ssaVersion localUses size equals: 2. - - usedVarA := model module statements first statements first arguments first. - self assert: usedVarA ssaVersion identicalTo: assignedVarA ssaVersion. - - assignedVarB := model module statements first left initializers second. - self assert: assignedVarB ssaVersion version equals: 1. - self assert: assignedVarB ssaName equals: 'b_1'. - self assert: assignedVarB ssaVersion localUses size equals: 2. - - usedVarB := model module statements first statements first arguments second. - self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion -] - -{ #category : 'tests - parameters' } -FASTPythonSSATest >> testParameterUsed [ - - | parameterDeclaration parameterUsage | - self parseAndResolve: 'def func(x): - print(x)'. - - parameterDeclaration := model module statements first parameters first. - self assert: parameterDeclaration ssaVersion version equals: 1. - self assert: parameterDeclaration ssaName equals: 'x_1'. - self assert: parameterDeclaration ssaVersion localUses size equals: 2. - - parameterUsage := model module statements first statements first arguments first. - self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testReAssignement [ - - | assignedVar1 assignedVar2 | - self parseAndResolve: 'x = 3 - -x = 4'. - - assignedVar1 := model module statements first left. - self assert: assignedVar1 ssaVersion version equals: 1. - self assert: assignedVar1 ssaName equals: 'x_1'. - self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. - self assert: assignedVar1 ssaVersion localUses size equals: 1. - - assignedVar2 := model module statements second left. - self assert: assignedVar2 ssaVersion version equals: 2. - self assert: assignedVar2 ssaName equals: 'x_2'. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. - self assert: assignedVar2 ssaVersion localUses size equals: 1 -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testReAssignementAndUsage [ - - | assignedVar1 assignedVar2 usedVar1 usedVar2 | - self parseAndResolve: 'x = 3 - -print(x) - - x = 4 - -print(x)'. - - assignedVar1 := model module statements first left. - self assert: assignedVar1 ssaVersion version equals: 1. - self assert: assignedVar1 ssaName equals: 'x_1'. - self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. - self assert: assignedVar1 ssaVersion localUses size equals: 2. - - usedVar1 := model module statements second arguments first. - self deny: usedVar1 ssaVersion isPhi. - self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. - - assignedVar2 := model module statements third left. - self assert: assignedVar2 ssaVersion version equals: 2. - self assert: assignedVar2 ssaName equals: 'x_2'. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. - self assert: assignedVar2 ssaVersion localUses size equals: 2. - - usedVar2 := model module statements fourth arguments first. - self deny: usedVar2 ssaVersion isPhi. - self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testReAssignementInIf [ - - | assignedVar1 assignedVar2 | - self parseAndResolve: 'x = 3 - -if y < 2: - x = 4'. - - assignedVar1 := model module statements first left. - self assert: assignedVar1 ssaVersion version equals: 1. - self assert: assignedVar1 ssaName equals: 'x_1'. - self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. - self assert: assignedVar1 ssaVersion localUses size equals: 1. - - assignedVar2 := model module statements second thenClause statements first left. - self assert: assignedVar2 ssaVersion version equals: 2. - self assert: assignedVar2 ssaName equals: 'x_2'. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. - self assert: assignedVar2 ssaVersion localUses size equals: 1 -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testReAssignementInIfAndUsage [ - - | assignedVar1 assignedVar2 usedVar | - self parseAndResolve: 'x = 3 - -if y < 2: - x = 4 - -print(x)'. - - assignedVar1 := model module statements first left. - self assert: assignedVar1 ssaVersion version equals: 1. - self assert: assignedVar1 ssaName equals: 'x_1'. - self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. - self assert: assignedVar1 ssaVersion localUses size equals: 2. - - assignedVar2 := model module statements second thenClause statements first left. - self assert: assignedVar2 ssaVersion version equals: 2. - self assert: assignedVar2 ssaName equals: 'x_2'. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. - self assert: assignedVar2 ssaVersion localUses size equals: 2. - - usedVar := model module statements third arguments first. - self assert: usedVar ssaVersion isPhi. - self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { - assignedVar1 ssaVersion. - assignedVar2 ssaVersion } -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testSingleAssignement [ - - | assignedVar | - self parseAndResolve: 'x = 5'. - - assignedVar := model module statements first left. - self assert: assignedVar ssaVersion version equals: 1. - self assert: assignedVar ssaName equals: 'x_1'. - - self assert: assignedVar localDeclaration newVersionNumber equals: 2. - self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. - self assert: assignedVar ssaVersion localUses size equals: 1 -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testSingleAssignementAndUsage [ - - | assignedVar usedVar | - self parseAndResolve: 'x = 5 - -print(x)'. - - assignedVar := model module statements first left. - self assert: assignedVar ssaVersion version equals: 1. - self assert: assignedVar ssaName equals: 'x_1'. - self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. - self assert: assignedVar ssaVersion localUses size equals: 2. - - usedVar := model module statements second arguments first. - self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testTupleAssignement [ - - | assignedVarX assignedVarY | - self parseAndResolve: 'x, y = 5, 6'. - - assignedVarX := model module statements first left initializers first. - self assert: assignedVarX ssaVersion version equals: 1. - self assert: assignedVarX ssaName equals: 'x_1'. - - assignedVarY := model module statements first left initializers second. - self assert: assignedVarY ssaVersion version equals: 1. - self assert: assignedVarY ssaName equals: 'y_1' -] - -{ #category : 'tests - assignments' } -FASTPythonSSATest >> testTupleInTupleAssignement [ - - | assignedVarX assignedVarY assignedVarZ | - self parseAndResolve: 'x, (y, z) = 5, (6, 7)'. - - assignedVarX := model module statements first left initializers first. - self assert: assignedVarX ssaVersion version equals: 1. - self assert: assignedVarX ssaName equals: 'x_1'. - - assignedVarY := model module statements first left initializers second initializers first. - self assert: assignedVarY ssaVersion version equals: 1. - self assert: assignedVarY ssaName equals: 'y_1'. - - assignedVarZ := model module statements first left initializers second initializers second. - self assert: assignedVarZ ssaVersion version equals: 1. - self assert: assignedVarZ ssaName equals: 'z_1' -] - -{ #category : 'tests - non local declarations' } -FASTPythonSSATest >> testUndeclaredVariable [ - - | undeclared | - self parseAndResolve: 'print(x)'. - - undeclared := model module statements first arguments first. - self assert: undeclared ssaVersion isNil -] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 82b79af..d85df03 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -11,29 +11,3 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] - -{ #category : '*FAST-Python-Tools' } -FASTPyEntity >> isVariableWriteAccess [ - "I am used in the LR and SSA builder to know if I represent the assignment of a variable." - - ^ self variableDeclarator isNotNil -] - -{ #category : '*FAST-Python-Tools' } -FASTPyEntity >> localResolverKind [ - "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. - - I am used to know the kind of entity that is been declared." - - ^ self error: 'This entity cannot be a local declaration or is missing the overriding method.' -] - -{ #category : '*FAST-Python-Tools' } -FASTPyEntity >> variableDeclarator [ - "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. - Nodes representing potential variable write access should override me. - - I am used by the LocalResolver and potentially SSA" - - ^ nil -] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st deleted file mode 100644 index e73ab50..0000000 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ /dev/null @@ -1,27 +0,0 @@ -Extension { #name : 'FASTPyIdentifier' } - -{ #category : '*FAST-Python-Tools' } -FASTPyIdentifier >> localResolverKind [ - - self isVariableWriteAccess ifTrue: [ ^ #variable ]. - - self halt "I don't know if it can be something else." -] - -{ #category : '*FAST-Python-Tools' } -FASTPyIdentifier >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment." - - | assignedNode | - "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - assignedNode := self. - [ assignedNode collectionInitializer isNotNil and: [ assignedNode collectionInitializer isTuple ] ] whileTrue: [ assignedNode := assignedNode collectionInitializer ]. - - assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. - - assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. - - assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. - - ^ super variableDeclarator -] diff --git a/src/FAST-Python-Tools/FASTPyImport.extension.st b/src/FAST-Python-Tools/FASTPyImport.extension.st deleted file mode 100644 index 2d8f610..0000000 --- a/src/FAST-Python-Tools/FASTPyImport.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTPyImport' } - -{ #category : '*FAST-Python-Tools' } -FASTPyImport >> localResolverKind [ - - ^ #import -] diff --git a/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st deleted file mode 100644 index 3e8ae44..0000000 --- a/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTPyMethodDefinition' } - -{ #category : '*FAST-Python-Tools' } -FASTPyMethodDefinition >> localResolverKind [ - - ^ #method -] diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st deleted file mode 100644 index 2ecef63..0000000 --- a/src/FAST-Python-Tools/FASTPyParameter.extension.st +++ /dev/null @@ -1,14 +0,0 @@ -Extension { #name : 'FASTPyParameter' } - -{ #category : '*FAST-Python-Tools' } -FASTPyParameter >> localResolverKind [ - - ^ #parameter -] - -{ #category : '*FAST-Python-Tools' } -FASTPyParameter >> variableDeclarator [ - "For parameters, they are their own declarator." - - ^ self -] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index e850dde..9608efa 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -35,9 +35,9 @@ Class { 'started', 'cfgs' ], - #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', - #tag : 'CFG/LocalResolver/SSA' + #tag : 'CFG/DataFlow' } { #category : 'running' } diff --git a/src/FAST-Python-Tools/FASTPythonLRScope.class.st b/src/FAST-Python-Tools/FASTPythonLRScope.class.st deleted file mode 100644 index 72628a6..0000000 --- a/src/FAST-Python-Tools/FASTPythonLRScope.class.st +++ /dev/null @@ -1,57 +0,0 @@ -Class { - #name : 'FASTPythonLRScope', - #superclass : 'Object', - #instVars : [ - 'entity', - 'nameDictionary' - ], - #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', - #package : 'FAST-Python-Tools', - #tag : 'CFG/LocalResolver/SSA' -} - -{ #category : 'instance creation' } -FASTPythonLRScope class >> for: anEntity [ - - ^ self new - entity: anEntity; - yourself -] - -{ #category : 'actions' } -FASTPythonLRScope >> declarationNamed: aVariableName ifPresent: aBlock [ - - ^ nameDictionary at: aVariableName ifPresent: aBlock -] - -{ #category : 'actions' } -FASTPythonLRScope >> ensureDeclarationOf: aName declaration: aFASTNode [ - "If it is already present we do nothing. Else we create the local declaration. - - I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." - - ^ nameDictionary - at: aName - ifPresent: [ :declaration | - declaration localResolverKind = aFASTNode localResolverKind - ifTrue: [ ^ declaration ] - ifFalse: [ "If the kind is different, we save a new declaration." - aFASTNode ensureLocalUses. - nameDictionary at: aName put: aFASTNode ] ] - ifAbsentPut: [ - aFASTNode - ensureLocalUses; - yourself ] -] - -{ #category : 'accessing' } -FASTPythonLRScope >> entity: anObject [ - entity := anObject -] - -{ #category : 'initialization' } -FASTPythonLRScope >> initialize [ - - super initialize. - nameDictionary := Dictionary new -] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st deleted file mode 100644 index 8acae27..0000000 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ /dev/null @@ -1,184 +0,0 @@ -" -I am a visitor used to link entities usages to their declaration. - -You can run me like this: - -```st -FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" -``` - -Once I ran, all entities will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. - -The declaration can be various things: -- First variable assignement -- Function definition -- Variable declared in a loop structure (like in the left side of a for each) -- An imported entity -... -" -Class { - #name : 'FASTPythonLocalResolverVisitor', - #superclass : 'FASTPythonVisitor', - #instVars : [ - 'scopes' - ], - #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', - #package : 'FAST-Python-Tools', - #tag : 'CFG/LocalResolver/SSA' -} - -{ #category : 'instance creation' } -FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ - - ^ self new resolve: aPythonEntity -] - -{ #category : 'declarations' } -FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ - - | declaration | - declaration := (self declarationNamed: aName) ifNil: [ "If it is undeclared, we create an undeclared in the lowest scope in the stack." - scopes first ensureDeclarationOf: aName declaration: (FASTNonLocalDeclaration new - name: aName; - yourself) ]. - - aFASTNode localDeclaration: declaration. - declaration addLocalUse: aFASTNode -] - -{ #category : 'declarations' } -FASTPythonLocalResolverVisitor >> declarationNamed: aName [ - - scopes do: [ :scope | scope declarationNamed: aName ifPresent: [ :declaration | ^ declaration ] ]. - ^ nil -] - -{ #category : 'declarations' } -FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName declaration: aFASTNode [ - - scopes top ensureDeclarationOf: aName declaration: aFASTNode. - self bind: anEntity toDeclarationNamed: aName -] - -{ #category : 'initialization' } -FASTPythonLocalResolverVisitor >> initialize [ - - super initialize. - scopes := Stack new -] - -{ #category : 'initialization' } -FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ - - scopes push: (FASTPythonLRScope for: aFASTBehaviouralEntity). - - "We fulsh the attributes in case this is not the fist resolution" - aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. - - aFASTBehaviouralEntity accept: self. - scopes pop. - self assert: scopes isEmpty -] - -{ #category : 'declarations' } -FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ - - scopes push: aScope. - - [ aBlock value ] ensure: [ scopes pop ] -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ - "This should be improved later to check if we already encountered this accessed attribute and maybe this should go in the scopes?." - - | declaration | - declaration := FASTNonLocalDeclaration new - name: anAttribute name; - yourself. - - declaration clearLocalUses. - - anAttribute localDeclaration: declaration. - declaration addLocalUse: anAttribute. - - super visitFASTPyAttributeAccess: anAttribute -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ - "Reordering the visit of children to ensure for clauses are visited before the body and conditions since they can refer to it." - - "In Python 3, the comprehension has its own scope. In the future we should also manage python 2 that had no scope and could leek its variables." - - self useScope: (FASTPythonLRScope for: aComprehension) during: [ - self visitFASTPyTSplatExpression: aComprehension. - self visitFASTPyExpression: aComprehension. - - self visitCollection: aComprehension forClauses. - self visitCollection: aComprehension conditions. - self visitEntity: aComprehension body ] -] - -{ #category : 'visiting - reordering' } -FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ - "Reorginizing the order" - - self visitEntity: aForStatement left. - self visitEntity: aForStatement right. - - self visitFASTPyTWithElseClause: aForStatement. - self visitFASTTStatementBlock: aForStatement. - self visitFASTPyStatement: aForStatement -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ - - self ensureDeclarationOf: aFunctionDefinition named: aFunctionDefinition name declaration: aFunctionDefinition. - self - useScope: (FASTPythonLRScope for: aFunctionDefinition) - during: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." - self visitFASTTWithParameters: aFunctionDefinition. - self visitFASTPyTWithTypeParameters: aFunctionDefinition. - self visitFASTPyStatement: aFunctionDefinition. - self visitEntity: aFunctionDefinition returnType. - self visitFASTPyTDefinition: aFunctionDefinition ] -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - - anIdentifier isVariableWriteAccess ifTrue: [ - ^ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier "We cannot put the right node because of the tuples" ]. - - self bind: anIdentifier toDeclarationNamed: anIdentifier name -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ - - anImport importedEntities do: [ :entity | - entity hasAlias - ifTrue: [ self ensureDeclarationOf: entity named: entity alias declaration: anImport ] - ifFalse: [ - entity segments size = 1 - ifTrue: [ self ensureDeclarationOf: entity named: entity segments last declaration: anImport ] - ifFalse: [ self flag: #todo "I don't know yet how to manage this" ] ] ]. - - super visitFASTPyImport: anImport -] - -{ #category : 'visiting - reordering' } -FASTPythonLocalResolverVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ - "We resolve in the same way as functions." - - self visitFASTPyFunctionDefinition: aMethodDefinition -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ - - self ensureDeclarationOf: aParameter named: aParameter name declaration: aParameter. - super visitFASTPyParameter: aParameter -] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st deleted file mode 100644 index daaa090..0000000 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ /dev/null @@ -1,158 +0,0 @@ -Class { - #name : 'FASTPythonSSAVisitor', - #superclass : 'FASTPythonVisitor', - #traits : 'FASTCFGTVisitor', - #classTraits : 'FASTCFGTVisitor classTrait', - #instVars : [ - 'variableVersions' - ], - #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', - #package : 'FAST-Python-Tools', - #tag : 'CFG/LocalResolver/SSA' -} - -{ #category : 'resolving' } -FASTPythonSSAVisitor class >> resolve: aPythonEntity [ - - ^ self new resolve: aPythonEntity -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> createPhiVersionFor: localDeclaration versions: allVersions [ - "No need to add it to the versions since it was already added by the previous versions." - - | phiVersion | - phiVersion := FASTVariablePhiVersionSSA for: allVersions. - localDeclaration activeVersion: phiVersion. - ^ phiVersion -] - -{ #category : 'actions' } -FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ - - | newSSA | - newSSA := FASTVariableVersionSSA for: aFASTEntity. - aFASTEntity localDeclaration activeVersion ifNotNil: [ :lastSSA | newSSA version: lastSSA version ]. - - aFASTEntity localDeclaration activeVersion: newSSA. - - variableVersions add: aFASTEntity localDeclaration. - - ^ newSSA -] - -{ #category : 'accessing' } -FASTPythonSSAVisitor >> currentActiveVersions [ - - ^ variableVersions collect: #activeVersion -] - -{ #category : 'actions' } -FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ - - aFASTEntity ssaVersion: ((self createVariableVersionFor: aFASTEntity) - newVersionNumber; - yourself) -] - -{ #category : 'initialization' } -FASTPythonSSAVisitor >> initialize [ - - super initialize. - variableVersions := IdentitySet new -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap [ - - | declarationsToMerge | - declarationsToMerge := newVariablesMap values flatten collectAsSet: #localDeclaration. - - declarationsToMerge do: [ :localDeclaration | - | allVersions | - "First we collect all the versions to use to produce a new Phi version for the current local declaration. " - allVersions := Set new. - newVariablesMap valuesDo: [ :variables | - variables - detect: [ :variable | variable localDeclaration = localDeclaration ] - ifFound: [ :variable | allVersions add: variable ] ]. - - "If not all branches are creating a new version, we need to add the previous version also to the list of variables for the Phi variable. Note that it is possible it did not exist before." - allVersions size = newVariablesMap size ifFalse: [ - previousVariables - detect: [ :variable | variable localDeclaration = localDeclaration ] - ifFound: [ :variable | allVersions add: variable ] ]. - - self createPhiVersionFor: localDeclaration versions: allVersions ] -] - -{ #category : 'actions' } -FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ - - | cfg | - "First we do a local resolution so that each entity are linked to their local declaration" - FASTPythonLocalResolverVisitor resolve: aFASTBehaviouralEntity. - - "Then we build the CFG to know the different paths on the entity" - cfg := aFASTBehaviouralEntity cfg. - - "And lastly, I can build the SSA now that I have the CFG and Local declarations." - self visit: cfg -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ - - self flag: #todo. "Should be moved to the CFG visitor of FAST" - ^ aCFGBlockOrFASTEntity ifNotNil: [ aCFGBlockOrFASTEntity accept: self ] -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitCFGAbstractConditionalBlock: aBlock [ - - | previousVariables newVariablesMap firstCommonChild reacheableBlocksByBranch | - self visitCFGAbstractBlock: aBlock. - - reacheableBlocksByBranch := aBlock nextBlocks collect: [ :block | block withAllFollowingBlocks ]. - - firstCommonChild := self findClosestMergePointIn: reacheableBlocksByBranch for: aBlock. - - previousVariables := self currentActiveVersions. "We need to do this after visiting the statements that could produce new variables." - newVariablesMap := IdentityDictionary new. - - aBlock nextBlocks do: [ :block | - self visit: block. - newVariablesMap at: block put: (self currentActiveVersions difference: previousVariables) ]. - - self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ - "Reordering for parameters to be visited before the statements in order to have all declarations" - - self visitFASTTWithParameters: aFunctionDefinition. - self visitEntity: aFunctionDefinition returnType. - self visitFASTPyTDefinition: aFunctionDefinition. - self visitFASTPyTWithTypeParameters: aFunctionDefinition. - self visitFASTPyStatement: aFunctionDefinition -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - - anIdentifier isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anIdentifier ]. - - anIdentifier localDeclaration isNonLocalDeclaration ifFalse: [ anIdentifier ssaVersion: anIdentifier localDeclaration activeVersion ]. - - super visitFASTPyIdentifier: anIdentifier -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ - "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" - - aParameter isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: aParameter ]. - - super visitFASTPyParameter: aParameter -] diff --git a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index cdea4a5..d77ae30 100644 --- a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -619,26 +619,21 @@ FASTPythonTreeSitterVisitor >> visitGlobalStatement: aTSNode [ { #category : 'visiting' } FASTPythonTreeSitterVisitor >> visitIdentifier: aNode [ - | name | - name := self sourceCodeOf: aNode. - - (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: name ]. + (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: (self sourceCodeOf: aNode) ]. "If we are in a field `name` then we are probably in a definition of an entity and we set my content as a name." - self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: name ]. + self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: (self sourceCodeOf: aNode) ]. self isIdentifierAVariableInTheCurrentContext ifTrue: [ | variable | variable := self handleNode: aNode kind: FASTPyVariable. - variable name: name. + variable name: (self sourceCodeOf: aNode). ^ variable ]. "In case we are in an alias, we edit the property alias of the last imported entity" - aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: name ]. + aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: (self sourceCodeOf: aNode) ]. - ^ (self handleNode: aNode) - name: name; - yourself + ^ self handleNode: aNode ] { #category : 'visiting - skip' } diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st deleted file mode 100644 index 622a8a4..0000000 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ /dev/null @@ -1,14 +0,0 @@ -Extension { #name : 'FASTTEntity' } - -{ #category : '*FAST-Python-Tools' } -FASTTEntity >> ensureLocalUses [ - - self attributeAt: #localUses ifAbsentPut: OrderedCollection new -] - -{ #category : '*FAST-Python-Tools' } -FASTTEntity >> resetLocalResolution [ - - self removeAttribute: #localDeclaration. - self removeAttribute: #localUses -] diff --git a/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st deleted file mode 100644 index 775889d..0000000 --- a/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st +++ /dev/null @@ -1,17 +0,0 @@ -" -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 : 'ManifestFASTPythonTools', - #superclass : 'PackageManifest', - #category : 'FAST-Python-Tools-Manifest', - #package : 'FAST-Python-Tools', - #tag : 'Manifest' -} - -{ #category : 'code-critics' } -ManifestFASTPythonTools class >> ruleInconsistentMethodClassificationRuleV1FalsePositive [ - - - ^ #(#(#(#RGClassDefinition #(#FASTPythonLocalResolverVisitor)) #'2026-07-30T14:41:37.271103+02:00') ) -] From 42c307a4d174e544685c80647ea8d15e4d7f99ed Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 4 Aug 2026 18:32:15 +0200 Subject: [PATCH 076/151] Merge branch 'cfg' into local-resolver --- README.md | 88 + .../FASTPythonMetamodelGenerator.class.st | 2 + src/FAST-Python-Model/FASTPyEntity.class.st | 7 + .../FASTPyIdentifier.class.st | 13 +- .../FASTPyImportedEntity.class.st | 6 + src/FAST-Python-Model/FASTPyTVisitor.trait.st | 5 +- src/FAST-Python-Model/FASTPyTuple.class.st | 7 + .../FASTPythonAbstractTestCase.class.st | 5 +- .../FASTPythonCFGTest.class.st | 5 +- .../FASTPythonImporterTest.class.st | 2237 +++++++++++++---- .../FASTPythonLocalResolverTest.class.st | 1288 ++++++++++ .../FASTPythonSSATest.class.st | 261 ++ .../FASTPyEntity.extension.st | 26 + .../FASTPyIdentifier.extension.st | 27 + .../FASTPyImport.extension.st | 7 + .../FASTPyMethodDefinition.extension.st | 7 + .../FASTPyParameter.extension.st | 14 + .../FASTPythonCFGVisitor.class.st | 4 +- .../FASTPythonLRScope.class.st | 57 + .../FASTPythonLocalResolverVisitor.class.st | 184 ++ .../FASTPythonSSAVisitor.class.st | 158 ++ .../FASTPythonTreeSitterVisitor.class.st | 15 +- .../FASTTEntity.extension.st | 14 + .../ManifestFASTPythonTools.class.st | 17 + 24 files changed, 3982 insertions(+), 472 deletions(-) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st create mode 100644 src/FAST-Python-Tools/FASTPyIdentifier.extension.st create mode 100644 src/FAST-Python-Tools/FASTPyImport.extension.st create mode 100644 src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st create mode 100644 src/FAST-Python-Tools/FASTPyParameter.extension.st create mode 100644 src/FAST-Python-Tools/FASTPythonLRScope.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st create mode 100644 src/FAST-Python-Tools/FASTTEntity.extension.st create mode 100644 src/FAST-Python-Tools/ManifestFASTPythonTools.class.st diff --git a/README.md b/README.md index 0a8a9f1..7864658 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,26 @@ Famix AST representation for Python based on TreeSitter + + +- [FAST-Python](#fast-python) + - [Installation](#installation) + - [Quick start](#quick-start) + - [Documentation](#documentation) + - [Control flow graph](#control-flow-graph) + - [Local resolutions](#local-resolutions) + - [Shadowing](#shadowing) + - [Limitations](#limitations) + - [Separated dotted names](#separated-dotted-names) + - [Access to non local entities](#access-to-non-local-entities) + - [Python 2 management](#python-2-management) + - [Moose versions compatibility](#moose-versions-compatibility) + - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) + - [Python version compatibility](#python-version-compatibility) + - [Contact](#contact) + + + ## Installation To install this project on your Pharo image, execute the following script: @@ -64,6 +84,74 @@ A CFG can be done on a function, method, class, module or lambda. You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` +## Local resolutions + +It is possible to apply a local name resolution on a FAST-Python model by executing this piece of code: + +```smalltalk +FASTPythonLocalResolverVisitor resolve: model module "Can be any behavioral entity" +``` + +Once this is executed, all nodes resolved will be able to provide a `#localDeclaration` pointing to the declaration/first use of the entity. This local declaration also knows all the `#localUses` of the entity. + +The local declaration can be multiple things such as: +- An assignement +- A function/class/method declaration +- An import +- A parameter declaration +- A for loop to declare a variable +- ... + +### Shadowing + +In Python anything named can shadow anything named. For example we can declare a global variable then shadow it with an import, then shadow it with a function... + +In the case of a shadowing, we manage it in two distinct ways: +- If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration +- If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration + +### Limitations + +This project has a few limitations. + +#### Separated dotted names + +In case we have a dotted name but we do not use the same way to declare it, we are currently not keeping track of the declaration. For example, ßhis kind of uses are not supported: + +```python +a.b.c = 3 +d = a.b +print(d.c) +``` + +Here `a.b.c` will have a local declaration, but it will not know that`d.c` is a local use of this declared variable. + +#### Access to non local entities + +If the code has access to entities that we do not know, then we create a `FASTNonLocalDeclaration`. For example: + +```python +import x + +x.y +``` + +Here, in the expression `x.y` we will be able to link `x` to its declaration in the import, but we have no declaration for y since this is done in another project. +In that case, we associate it to a non local declaration. + +But, this has the current limit that if you access multiple times this `y` field of `x`, then each of them ill have their own non local declaration. +This is not the way I would like the project to work and this could be improved by having all references point to the same non local declaration object, but we need time for this :) + +See (https://github.com/moosetechnology/FAST-Python/issues/26)[https://github.com/moosetechnology/FAST-Python/issues/26] + +#### Python 2 management + +Currently, the Local resolver is based on Python 3. In the future we should add the support for Python 2 and let the user configure his version of Python. + +This has an influence for example on the scope of comprehensions. In Python 2 comprehensions do not have any scope and the variable declared in it leak while in Python 3 there is a scope and the variable does not leak. + +See (https://github.com/moosetechnology/FAST-Python/issues/27)[https://github.com/moosetechnology/FAST-Python/issues/27] + ## Moose versions compatibility | Version | Compatible Moose versions | diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 5a4ca7d..c8de6d7 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -333,6 +333,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ thenClause := builder newClassNamed: #ThenClause. tryStatement := builder newClassNamed: #TryStatement. tuple := builder newClassNamed: #Tuple. + tuple withTesting. type := builder newClassNamed: #Type. typeAliasStatement := builder newClassNamed: #TypeAliasStatement. typeConversion := builder newClassNamed: #TypeConversion. @@ -487,6 +488,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ identifier --|> tReturnReferenceable. identifier --|> tAsPatternTarget. identifier --|> tSplatParameterTarget. + identifier --|> tNamedEntity. ifClause --|> expression. "This is wrong! I am just here temporarily until we rework the relation to the for in clause (I need to be able to be a clause of a list comprehension)" diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 97ffa8b..9c851de 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -148,6 +148,13 @@ FASTPyEntity >> isStringLiteral [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isTuple [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isVariableEntity [ diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 949880f..17ff4de 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -6,6 +6,7 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `caller` | `FASTPyTCallable` | `callee` | `FASTPyCall` | The call entity calling me (if it's the case)| +| `invokedIn` | `FASTTNamedEntity` | `invoked` | `FASTTInvocation` | Optional invocation where this name is used| | `parentAsPatternSource` | `FASTPyTAsPatternSource` | `source` | `FASTPyAsPattern` | | | `parentAsPatternTarget` | `FASTPyTAsPatternTarget` | `target` | `FASTPyAsPattern` | | | `parentAssignmentLeft` | `FASTPyTAssignable` | `left` | `FASTPyAssignment` | | @@ -19,13 +20,21 @@ | `parentSplatParameter` | `FASTPyTSplatParameterTarget` | `target` | `FASTPySplatParameter` | | +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `name` | `String` | nil | | +| `startPos` | `Number` | nil | | " Class { #name : 'FASTPyIdentifier', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' diff --git a/src/FAST-Python-Model/FASTPyImportedEntity.class.st b/src/FAST-Python-Model/FASTPyImportedEntity.class.st index be0334c..f5c8600 100644 --- a/src/FAST-Python-Model/FASTPyImportedEntity.class.st +++ b/src/FAST-Python-Model/FASTPyImportedEntity.class.st @@ -53,6 +53,12 @@ FASTPyImportedEntity >> alias: anObject [ alias := anObject ] +{ #category : 'testing' } +FASTPyImportedEntity >> hasAlias [ + + ^ self alias isNotNil +] + { #category : 'accessing' } FASTPyImportedEntity >> import [ "Relation named: #import type: #FASTPyImport opposite: #importedEntities" diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 6eece1e..12d25dc 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -491,6 +491,7 @@ FASTPyTVisitor >> visitFASTPyIdentifier: anIdentifier [ self visitFASTPyTAsPatternTarget: anIdentifier. self visitFASTPyTReturnReferenceable: anIdentifier. self visitFASTPyTSplatParameterTarget: anIdentifier. + self visitFASTTNamedEntity: anIdentifier. self visitFASTPyExpression: anIdentifier ] @@ -1295,7 +1296,9 @@ FASTPyTVisitor >> visitFASTTStringLiteral: aTStringLiteral [ FASTPyTVisitor >> visitFASTTVariableEntity: aTVariableEntity [ - self visitFASTTNamedEntity: aTVariableEntity. + "We do not visit all behaviorals because some classes already visit it in their superclasses in this language implementation. Visiting them here also would cause a double visit of this trait." + ({ FASTPyVariable } includes: aTVariableEntity class) + ifFalse: [ self visitFASTTNamedEntity: aTVariableEntity ]. ] diff --git a/src/FAST-Python-Model/FASTPyTuple.class.st b/src/FAST-Python-Model/FASTPyTuple.class.st index 6f59475..4a059d7 100644 --- a/src/FAST-Python-Model/FASTPyTuple.class.st +++ b/src/FAST-Python-Model/FASTPyTuple.class.st @@ -30,3 +30,10 @@ FASTPyTuple class >> annotation [ ] + +{ #category : 'testing' } +FASTPyTuple >> isTuple [ + + + ^ true +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st index 72f2c13..07b2367 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st @@ -1,8 +1,9 @@ Class { #name : 'FASTPythonAbstractTestCase', #superclass : 'TestCase', - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Core', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Core' } { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 535c4d7..79daaa7 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -4,8 +4,9 @@ Class { #instVars : [ 'startBlock' ], - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' } { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index fcebba6..4be1b1e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -37,8 +37,9 @@ Dictionary new Class { #name : 'FASTPythonImporterTest', #superclass : 'TSFASTAbstractImporterTest', - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Importer', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Importer' } { #category : 'class initialization' } @@ -124,6 +125,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -141,6 +143,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'container'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'container'. stack pop. stack pop. stack pop. @@ -196,6 +199,7 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -212,11 +216,13 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'reader'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'reader'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'writer'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'writer'. stack pop. stack pop. stack pop. @@ -270,6 +276,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -279,6 +286,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -332,6 +340,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -341,6 +350,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -384,6 +394,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation target" @@ -392,6 +403,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -443,6 +455,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation value" @@ -451,6 +464,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -460,6 +474,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -515,6 +530,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -558,6 +574,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'targets'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'targets'. stack pop. stack pop. stack pop. @@ -614,6 +631,7 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -630,11 +648,13 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'g'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'g'. stack pop. stack pop. stack pop. @@ -710,6 +730,7 @@ FASTPythonImporterTest >> testAssertStatement [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack push: (stack top operands at: 2). @@ -842,6 +863,7 @@ FASTPythonImporterTest >> testAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -886,6 +908,7 @@ FASTPythonImporterTest >> testAssignmentInList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote'. stack pop. stack pop. @@ -930,11 +953,13 @@ FASTPythonImporterTest >> testAssignmentInPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1000,11 +1025,13 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'j'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'j'. stack pop. stack pop. @@ -1014,6 +1041,7 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst'. stack pop. stack pop. @@ -1022,7 +1050,8 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'seq'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'seq' ] { #category : 'tests - assignments' } @@ -1066,6 +1095,7 @@ FASTPythonImporterTest >> testAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'variables'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'variables'. stack pop. stack pop. @@ -1109,11 +1139,13 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1122,7 +1154,8 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1166,7 +1199,8 @@ FASTPythonImporterTest >> testAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1268,6 +1302,7 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -1276,7 +1311,8 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - assignments' } @@ -1321,7 +1357,8 @@ FASTPythonImporterTest >> testAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -1468,6 +1505,7 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -1475,7 +1513,8 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1683,7 +1722,8 @@ FASTPythonImporterTest >> testAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -1766,6 +1806,7 @@ FASTPythonImporterTest >> testAssignmentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -1818,7 +1859,8 @@ FASTPythonImporterTest >> testAssignmentToList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - assignments' } @@ -1865,6 +1907,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -1880,6 +1923,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -1906,7 +1950,8 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -1986,7 +2031,8 @@ FASTPythonImporterTest >> testAssignmentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - assignments' } @@ -2030,11 +2076,13 @@ FASTPythonImporterTest >> testAssignmentToPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -2126,6 +2174,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -2141,6 +2190,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -2167,7 +2217,8 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -2258,7 +2309,8 @@ FASTPythonImporterTest >> testAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -2442,7 +2494,8 @@ FASTPythonImporterTest >> testAssignmentType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - accesses' } @@ -2467,7 +2520,8 @@ FASTPythonImporterTest >> testAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - accesses' } @@ -2500,7 +2554,8 @@ FASTPythonImporterTest >> testAttributeAccessNested [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -2533,7 +2588,8 @@ FASTPythonImporterTest >> testAttributeAccessOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2615,6 +2671,7 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -2623,7 +2680,8 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - attributes' } @@ -2658,7 +2716,8 @@ FASTPythonImporterTest >> testAttributeAccessOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -2775,6 +2834,7 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -2782,7 +2842,8 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2878,6 +2939,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -2886,6 +2948,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -2902,6 +2965,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -2909,7 +2973,8 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2988,7 +3053,8 @@ FASTPythonImporterTest >> testAttributeAccessOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -3021,7 +3087,8 @@ FASTPythonImporterTest >> testAttributeAccessOnList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - attributes' } @@ -3058,6 +3125,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3073,6 +3141,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3099,7 +3168,8 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - attributes' } @@ -3159,7 +3229,8 @@ FASTPythonImporterTest >> testAttributeAccessOnNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - attributes' } @@ -3231,6 +3302,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3246,6 +3318,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3272,7 +3345,8 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - attributes' } @@ -3343,7 +3417,8 @@ FASTPythonImporterTest >> testAttributeAccessOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - attributes' } @@ -3404,11 +3479,13 @@ FASTPythonImporterTest >> testAttributeAccessOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - attributes' } @@ -3471,7 +3548,8 @@ FASTPythonImporterTest >> testAttributeAccessWithReceiverParenthesised [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -3506,6 +3584,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3599,6 +3678,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3644,11 +3724,13 @@ FASTPythonImporterTest >> testAugmentedAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3705,7 +3787,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -3809,7 +3892,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -3904,6 +3988,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -3911,7 +3996,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -3985,7 +4071,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -4078,7 +4165,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -4151,7 +4239,8 @@ FASTPythonImporterTest >> testAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'future'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'future' ] { #category : 'tests - await' } @@ -4187,6 +4276,7 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4195,7 +4285,8 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4230,6 +4321,7 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4238,7 +4330,8 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4274,6 +4367,7 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -4282,7 +4376,8 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4329,6 +4424,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4337,6 +4433,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4345,7 +4442,8 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4372,6 +4470,7 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -4379,7 +4478,8 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4425,6 +4525,7 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4433,7 +4534,8 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - operators' } @@ -4513,6 +4615,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4530,7 +4633,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -4642,6 +4746,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -4659,6 +4764,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4668,6 +4774,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4678,7 +4785,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -4714,6 +4822,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4732,7 +4841,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -4889,6 +4999,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4905,6 +5016,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4914,6 +5026,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4923,7 +5036,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -5056,6 +5170,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5064,6 +5179,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5080,6 +5196,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5088,6 +5205,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -5113,6 +5231,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5121,6 +5240,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5137,6 +5257,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5144,7 +5265,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -5246,6 +5368,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: '+'. @@ -5254,7 +5377,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -5326,6 +5450,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5342,7 +5467,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - operators' } @@ -5379,6 +5505,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5394,6 +5521,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5421,6 +5549,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5440,6 +5569,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5455,6 +5585,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5481,7 +5612,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - operators' } @@ -5516,6 +5648,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: ') + ('. @@ -5533,7 +5666,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -5624,6 +5758,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5639,6 +5774,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5666,6 +5802,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5685,6 +5822,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5700,6 +5838,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5726,7 +5865,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - operators' } @@ -5809,6 +5949,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5835,7 +5976,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -5907,11 +6049,13 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5929,11 +6073,13 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - operators' } @@ -6110,6 +6256,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6127,7 +6274,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -6162,6 +6310,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6171,6 +6320,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6189,6 +6339,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6197,7 +6348,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -6239,6 +6391,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6248,6 +6401,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6258,6 +6412,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6267,7 +6422,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -6303,6 +6459,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6321,7 +6478,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -6486,6 +6644,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -6502,6 +6661,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6511,6 +6671,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -6520,7 +6681,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -6712,6 +6874,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6720,7 +6883,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -6827,6 +6991,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6844,7 +7009,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -6981,6 +7147,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7007,7 +7174,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -7079,11 +7247,13 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7101,11 +7271,13 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - operators' } @@ -7241,6 +7413,7 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7249,7 +7422,8 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7284,6 +7458,7 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7292,7 +7467,8 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7340,6 +7516,7 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7348,7 +7525,8 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7384,6 +7562,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -7393,6 +7572,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -7401,7 +7581,8 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7437,6 +7618,7 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -7445,7 +7627,8 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7480,11 +7663,13 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -7494,7 +7679,8 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7531,7 +7717,8 @@ FASTPythonImporterTest >> testCalWithArgumentComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7578,6 +7765,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -7586,6 +7774,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7594,7 +7783,8 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7648,6 +7838,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -7657,7 +7848,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7701,6 +7893,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -7709,6 +7902,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7725,6 +7919,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -7733,6 +7928,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -7742,7 +7938,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7777,6 +7974,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -7785,7 +7983,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7821,7 +8020,8 @@ FASTPythonImporterTest >> testCalWithArgumentEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7858,7 +8058,8 @@ FASTPythonImporterTest >> testCalWithArgumentFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7895,7 +8096,8 @@ FASTPythonImporterTest >> testCalWithArgumentFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7922,6 +8124,7 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -7929,7 +8132,8 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7966,7 +8170,8 @@ FASTPythonImporterTest >> testCalWithArgumentInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8003,6 +8208,7 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -8021,7 +8227,8 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8067,7 +8274,8 @@ FASTPythonImporterTest >> testCalWithArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8113,6 +8321,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8122,6 +8331,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8138,6 +8348,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8165,6 +8376,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8175,7 +8387,8 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8210,6 +8423,7 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -8218,7 +8432,8 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8254,7 +8469,8 @@ FASTPythonImporterTest >> testCalWithArgumentNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8290,6 +8506,7 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -8298,7 +8515,8 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8344,7 +8562,8 @@ FASTPythonImporterTest >> testCalWithArgumentSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8390,6 +8609,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8399,6 +8619,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8415,6 +8636,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8442,6 +8664,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8452,7 +8675,8 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8489,7 +8713,8 @@ FASTPythonImporterTest >> testCalWithArgumentString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8535,6 +8760,7 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8543,7 +8769,8 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8580,7 +8807,8 @@ FASTPythonImporterTest >> testCalWithArgumentTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8615,11 +8843,13 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -8628,7 +8858,8 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8664,6 +8895,7 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -8673,7 +8905,8 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8710,7 +8943,8 @@ FASTPythonImporterTest >> testCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print' ] { #category : 'tests - calls' } @@ -8746,6 +8980,7 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CFG'. stack pop. stack pop. @@ -8754,7 +8989,8 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8810,6 +9046,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'train_bs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'train_bs'. stack pop. stack pop. self assert: self topEntity operator equals: '*'. @@ -8820,6 +9057,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'epochs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'epochs'. stack pop. stack pop. @@ -8828,7 +9066,8 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8910,6 +9149,7 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'data'. stack pop. stack pop. stack pop. @@ -8920,7 +9160,8 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8955,11 +9196,13 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'shape0'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'shape0'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'resize'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'resize'. stack pop. self assert: self topEntity operators equals: #('!='). stack pop. @@ -8969,7 +9212,8 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9032,6 +9276,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_ids'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pred_ids'. stack pop. stack pop. @@ -9055,6 +9300,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_classes'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pred_classes'. stack pop. stack pop. stack pop. @@ -9064,7 +9310,8 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9108,7 +9355,8 @@ FASTPythonImporterTest >> testCallArgumentWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9163,7 +9411,8 @@ FASTPythonImporterTest >> testCallArgumentWithKeywordArgument [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9191,6 +9440,7 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'img'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'img'. stack pop. stack push: (stack top arguments at: 2). @@ -9203,11 +9453,13 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'padx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'padx'. stack pop. stack pop. @@ -9216,7 +9468,8 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9262,7 +9515,8 @@ FASTPythonImporterTest >> testCallChained [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9318,6 +9572,7 @@ FASTPythonImporterTest >> testCallLambda [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -9371,7 +9626,8 @@ FASTPythonImporterTest >> testCallOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - calls' } @@ -9406,7 +9662,8 @@ FASTPythonImporterTest >> testCallOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - calls' } @@ -9453,6 +9710,7 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -9460,7 +9718,8 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - calls' } @@ -9486,7 +9745,8 @@ FASTPythonImporterTest >> testCallOnIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - calls' } @@ -9523,6 +9783,7 @@ FASTPythonImporterTest >> testCallOnLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -9577,7 +9838,8 @@ FASTPythonImporterTest >> testCallOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions' ] { #category : 'tests - calls' } @@ -9633,7 +9895,8 @@ FASTPythonImporterTest >> testCallSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - calls' } @@ -9668,7 +9931,8 @@ FASTPythonImporterTest >> testCallWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'tqdm'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'tqdm' ] { #category : 'tests - calls' } @@ -9714,6 +9978,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -9723,6 +9988,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -9739,6 +10005,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -9766,6 +10033,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -9776,7 +10044,8 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'sum'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'sum' ] { #category : 'tests - operators' } @@ -9866,6 +10135,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclass [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. self assert: self topEntity name equals: 'aClass'. @@ -9913,6 +10183,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclassCustomizations [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. @@ -9975,16 +10246,19 @@ FASTPythonImporterTest >> testClassDefinitionWithMultipleSuperclasses [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'Super1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super1'. stack pop. stack push: (stack top superclasses at: 2). self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super2'. stack pop. stack push: (stack top superclasses at: 3). self assert: self topEntity sourceCode equals: 'Super3'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super3' ] { #category : 'tests - classes' } @@ -10029,7 +10303,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'module' ] { #category : 'tests - classes' } @@ -10075,7 +10350,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - classes' } @@ -10132,6 +10408,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super2'. stack pop. "Testing value of monovalue relation thenExpression" @@ -10139,7 +10416,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Super1'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super1' ] { #category : 'tests - classes' } @@ -10175,7 +10453,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassIdentifier [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'SuperClass'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'SuperClass' ] { #category : 'tests - classes' } @@ -10219,7 +10498,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - classes' } @@ -10274,7 +10554,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'classes'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'classes' ] { #category : 'tests - classes' } @@ -10319,6 +10600,7 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -10331,7 +10613,8 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'V'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'V' ] { #category : 'tests - comments' } @@ -10391,6 +10674,7 @@ FASTPythonImporterTest >> testCommentInArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct'. stack pop. "Testing value of multivalued relation comments" @@ -10455,6 +10739,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10510,6 +10795,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10546,6 +10832,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -10562,6 +10849,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10605,6 +10893,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -10694,6 +10983,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10709,7 +10999,8 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -10798,6 +11089,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithEllipsis [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -10901,6 +11193,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithIdentifier [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -11045,6 +11338,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithNotOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack push: (stack top operands at: 2). @@ -11176,6 +11470,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -11253,11 +11548,13 @@ FASTPythonImporterTest >> testComparisonOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -11373,6 +11670,7 @@ FASTPythonImporterTest >> testConcatenatedString [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'name'. stack pop. stack pop. stack pop. @@ -11426,6 +11724,7 @@ FASTPythonImporterTest >> testConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -11512,6 +11811,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11528,7 +11828,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -11574,6 +11875,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11583,6 +11885,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11600,6 +11903,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11608,7 +11912,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -11654,6 +11959,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11663,6 +11969,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -11680,6 +11987,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11688,7 +11996,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -11735,6 +12044,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -11752,7 +12062,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - conditional expressions' } @@ -11797,11 +12108,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -11819,11 +12132,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -11909,6 +12224,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11918,6 +12234,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -11963,6 +12280,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11972,6 +12290,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11981,6 +12300,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12026,6 +12346,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -12035,6 +12356,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -12044,6 +12366,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12090,6 +12413,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -12099,6 +12423,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12143,11 +12468,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -12158,6 +12485,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12205,6 +12533,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComplexe [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12260,6 +12589,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12268,6 +12598,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12277,6 +12608,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12324,6 +12656,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFalse [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12371,6 +12704,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFloat [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12407,6 +12741,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation elseExpression" @@ -12415,6 +12750,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12461,6 +12797,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionInteger [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12506,6 +12843,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -12515,6 +12853,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12569,6 +12908,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -12578,6 +12918,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12625,6 +12966,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionTrue [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12670,6 +13012,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -12680,6 +13023,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12744,6 +13088,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12752,6 +13097,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12779,6 +13125,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12786,7 +13133,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -12850,6 +13198,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -12883,7 +13232,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -12937,6 +13287,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -12945,6 +13296,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12961,6 +13313,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -12969,6 +13322,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -12993,6 +13347,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -13001,6 +13356,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13017,6 +13373,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -13024,7 +13381,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -13202,6 +13560,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13209,7 +13568,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -13304,6 +13664,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13331,6 +13692,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13461,6 +13823,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13470,6 +13833,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13486,6 +13850,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13513,6 +13878,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -13539,6 +13905,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13548,6 +13915,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13564,6 +13932,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13590,7 +13959,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - conditional expressions' } @@ -13635,6 +14005,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -13650,7 +14021,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - conditional expressions' } @@ -13742,6 +14114,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -13758,7 +14131,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - conditional expressions' } @@ -13785,6 +14159,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). @@ -13808,6 +14183,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13816,12 +14192,14 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - conditional expressions' } @@ -13942,6 +14320,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13951,6 +14330,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13967,6 +14347,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13994,6 +14375,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -14020,6 +14402,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -14029,6 +14412,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -14045,6 +14429,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -14071,7 +14456,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - conditional expressions' } @@ -14175,6 +14561,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -14200,7 +14587,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions' ] { #category : 'tests - conditional expressions' } @@ -14292,11 +14680,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -14313,11 +14703,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -14363,6 +14755,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -14381,6 +14774,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -14443,6 +14837,7 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -14458,7 +14853,8 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T' ] { #category : 'tests - statements' } @@ -14539,6 +14935,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decorator'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decorator'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -14585,6 +14982,7 @@ class MyComponent: pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'register_component'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'register_component'. stack pop. stack pop. self assert: self topEntity name equals: 'MyComponent'. @@ -14632,6 +15030,7 @@ def func(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'func'. @@ -14693,6 +15092,7 @@ FASTPythonImporterTest >> testDecoratorOnMethodDefinition [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'meth'. @@ -14749,6 +15149,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functools'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functools'. stack pop. stack pop. stack pop. @@ -14816,6 +15217,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -14875,6 +15277,7 @@ def funct(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of multivalued relation parameters" @@ -14952,6 +15355,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'decorators'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decorators'. stack pop. stack pop. stack pop. @@ -15003,6 +15407,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorA'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decoratorA'. stack pop. stack pop. @@ -15016,6 +15421,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorB'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decoratorB'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -15123,6 +15529,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15180,6 +15587,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15250,6 +15658,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15308,6 +15717,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -15317,6 +15727,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15376,6 +15787,7 @@ FASTPythonImporterTest >> testDefaultParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15433,11 +15845,13 @@ FASTPythonImporterTest >> testDefaultParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -15558,6 +15972,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -15566,6 +15981,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15642,6 +16058,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -15709,6 +16126,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -15717,6 +16135,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -15733,6 +16152,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -15741,6 +16161,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -15940,6 +16361,7 @@ FASTPythonImporterTest >> testDefaultParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. stack pop. @@ -16047,6 +16469,7 @@ FASTPythonImporterTest >> testDefaultParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -16185,6 +16608,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16194,6 +16618,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16210,6 +16635,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16237,6 +16663,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16346,6 +16773,7 @@ FASTPythonImporterTest >> testDefaultParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16474,6 +16902,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16483,6 +16912,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16499,6 +16929,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16526,6 +16957,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16646,6 +17078,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16753,11 +17186,13 @@ FASTPythonImporterTest >> testDefaultParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16816,6 +17251,7 @@ FASTPythonImporterTest >> testDefaultParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -16884,6 +17320,7 @@ FASTPythonImporterTest >> testDefaultTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -16942,6 +17379,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16959,6 +17397,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17016,6 +17455,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17033,6 +17473,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17103,6 +17544,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17120,6 +17562,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17178,6 +17621,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -17187,6 +17631,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17204,6 +17649,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17263,6 +17709,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17280,6 +17727,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17337,11 +17785,13 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -17360,6 +17810,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17428,6 +17879,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComplexe [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17497,6 +17949,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -17505,6 +17958,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17522,6 +17976,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17598,6 +18053,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -17616,6 +18072,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17682,6 +18139,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -17690,6 +18148,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -17706,6 +18165,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -17714,6 +18174,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -17732,6 +18193,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17799,6 +18261,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithEllipsis [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17867,6 +18330,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFalse [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17935,6 +18399,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFloat [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17984,6 +18449,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. @@ -18000,6 +18466,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18068,6 +18535,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithInteger [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18126,6 +18594,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -18153,6 +18622,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18230,6 +18700,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithList [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18299,6 +18770,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18308,6 +18780,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18324,6 +18797,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18351,6 +18825,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18370,6 +18845,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18437,6 +18913,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNone [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18495,6 +18972,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18512,6 +18990,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18589,6 +19068,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSet [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18658,6 +19138,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18667,6 +19148,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18683,6 +19165,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18710,6 +19193,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18729,6 +19213,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18797,6 +19282,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithString [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18865,6 +19351,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18882,6 +19369,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18950,6 +19438,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTrue [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19007,11 +19496,13 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -19029,6 +19520,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19087,6 +19579,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -19105,6 +19598,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19138,7 +19632,8 @@ FASTPythonImporterTest >> testDelStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - statements' } @@ -19171,7 +19666,8 @@ FASTPythonImporterTest >> testDelStatementAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19204,11 +19700,13 @@ FASTPythonImporterTest >> testDelStatementExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'rate'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'rate'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'add_baudrate_if_supported'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'add_baudrate_if_supported' ] { #category : 'tests - statements' } @@ -19242,11 +19740,13 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'obj1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj1'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'obj2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj2'. stack pop. stack push: (stack top initializers at: 3). @@ -19259,7 +19759,8 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19311,7 +19812,8 @@ FASTPythonImporterTest >> testDelStatementSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19467,6 +19969,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19475,6 +19978,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -19498,11 +20002,13 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -19528,7 +20034,8 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'class_indices' ] { #category : 'tests - comprehensions' } @@ -19567,6 +20074,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19575,6 +20083,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -19591,6 +20100,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack push: (stack top operands at: 2). @@ -19622,11 +20132,13 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -19652,7 +20164,8 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'class_indices' ] { #category : 'tests - splats' } @@ -19687,6 +20200,7 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -19695,7 +20209,8 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19731,6 +20246,7 @@ FASTPythonImporterTest >> testDictionarySplatInDictionary [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'd1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'd1'. stack pop. stack pop. @@ -19799,6 +20315,7 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -19808,7 +20325,8 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -19852,6 +20370,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'default_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'default_args'. stack pop. self assert: self topEntity operator equals: '|'. @@ -19861,6 +20380,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'subprocess_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'subprocess_args'. stack pop. stack pop. stack pop. @@ -19870,7 +20390,8 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19915,6 +20436,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'extra'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'extra'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -19933,7 +20455,8 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19977,6 +20500,7 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get_config'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get_config'. stack pop. stack pop. stack pop. @@ -19986,7 +20510,8 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -20041,6 +20566,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. "Testing value of monovalue relation value" @@ -20057,6 +20583,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. self assert: self topEntity operator equals: '*'. @@ -20092,11 +20619,13 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -20106,6 +20635,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'items'. stack pop. stack pop. stack pop. @@ -20116,7 +20646,8 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -20151,6 +20682,7 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -20159,7 +20691,8 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -20213,6 +20746,7 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'd'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'd'. stack pop. stack pop. stack pop. @@ -20222,7 +20756,8 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - function definitions' } @@ -20313,7 +20848,8 @@ FASTPythonImporterTest >> testDictionaryWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -20431,6 +20967,7 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -20439,7 +20976,8 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -20492,7 +21030,8 @@ FASTPythonImporterTest >> testDictionaryWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -20663,6 +21202,7 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -20670,7 +21210,8 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -20916,7 +21457,8 @@ FASTPythonImporterTest >> testDictionaryWithIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -21015,6 +21557,7 @@ FASTPythonImporterTest >> testDictionaryWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -21128,7 +21671,8 @@ FASTPythonImporterTest >> testDictionaryWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -21183,6 +21727,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21198,6 +21743,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21224,7 +21770,8 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -21320,7 +21867,8 @@ FASTPythonImporterTest >> testDictionaryWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -21428,6 +21976,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21443,6 +21992,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21469,7 +22019,8 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -21504,6 +22055,7 @@ FASTPythonImporterTest >> testDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'base'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'base'. stack pop. stack pop. @@ -21634,7 +22186,8 @@ FASTPythonImporterTest >> testDictionaryWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -21918,6 +22471,7 @@ except exceptions.Exception: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -21984,6 +22538,7 @@ except Exception(): pass' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22058,6 +22613,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -22075,6 +22631,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Error'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Error'. stack pop. "Testing value of monovalue relation thenExpression" @@ -22083,6 +22640,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22139,6 +22697,7 @@ except Exception: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22213,6 +22772,7 @@ except exceptions[2]: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -22270,6 +22830,7 @@ except Exception as e: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22310,7 +22871,8 @@ FASTPythonImporterTest >> testExecStatementOfIdentifier [ stack push: self topEntity code. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - statements' } @@ -22346,11 +22908,13 @@ FASTPythonImporterTest >> testExecStatementWithScopes [ stack push: (stack top scopes at: 1). self assert: self topEntity sourceCode equals: 'globals_dict'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'globals_dict'. stack pop. stack push: (stack top scopes at: 2). self assert: self topEntity sourceCode equals: 'locals_dict'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'locals_dict' ] { #category : 'tests - literals' } @@ -22413,6 +22977,7 @@ FASTPythonImporterTest >> testForStatement [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22463,6 +23028,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22512,6 +23078,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22520,6 +23087,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -22560,6 +23128,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22609,6 +23178,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22617,6 +23187,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -22685,6 +23256,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -22695,6 +23267,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22744,6 +23317,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22751,7 +23325,8 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun' ] { #category : 'tests - advanced statements' } @@ -22780,6 +23355,7 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22795,11 +23371,13 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -22846,6 +23424,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top initializers at: 2). @@ -22858,11 +23437,13 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'widths'. stack pop. stack pop. stack pop. @@ -22873,6 +23454,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'data'. stack pop. "Testing value of multivalued relation statements" @@ -22890,16 +23472,19 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top arguments at: 2). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top arguments at: 3). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'widths'. stack pop. "Testing value of monovalue relation callee" @@ -22907,7 +23492,8 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print' ] { #category : 'tests - imports' } @@ -23404,6 +23990,7 @@ FASTPythonImporterTest >> testFunctionDefinitionWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -23508,6 +24095,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -23517,6 +24105,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23533,6 +24122,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23559,7 +24149,8 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23596,6 +24187,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23612,6 +24204,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23638,7 +24231,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23674,6 +24268,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23690,6 +24285,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23716,7 +24312,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23753,6 +24350,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -23762,6 +24360,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23778,6 +24377,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23804,7 +24404,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23841,6 +24442,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -23850,6 +24452,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -23866,6 +24469,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23892,7 +24496,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23929,6 +24534,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -23945,6 +24551,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23971,7 +24578,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24007,11 +24615,13 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -24029,6 +24639,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24055,7 +24666,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24101,6 +24713,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24127,7 +24740,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24175,6 +24789,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -24183,6 +24798,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24199,6 +24815,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24225,7 +24842,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24279,6 +24897,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -24296,6 +24915,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24322,7 +24942,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24366,6 +24987,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -24374,6 +24996,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24390,6 +25013,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -24398,6 +25022,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -24415,6 +25040,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24441,7 +25067,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24486,6 +25113,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24512,7 +25140,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24558,6 +25187,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24584,7 +25214,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24630,6 +25261,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24656,7 +25288,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24684,6 +25317,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -24699,6 +25333,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24725,7 +25360,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24754,6 +25390,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -24769,6 +25406,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -24793,6 +25431,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24819,7 +25458,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24864,6 +25504,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24890,7 +25531,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24928,6 +25570,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -24954,6 +25597,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24980,7 +25624,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25024,6 +25669,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25050,7 +25696,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25095,6 +25742,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25104,6 +25752,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25120,6 +25769,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25147,6 +25797,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25165,6 +25816,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25191,7 +25843,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25217,6 +25870,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -25232,6 +25886,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -25240,6 +25895,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -25253,6 +25909,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25260,7 +25917,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -25290,6 +25948,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -25313,6 +25972,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -25354,6 +26014,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -25390,6 +26051,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25416,7 +26078,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25461,6 +26124,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25487,7 +26151,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25524,6 +26189,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -25540,6 +26206,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25566,7 +26233,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25620,6 +26288,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25646,7 +26315,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25691,6 +26361,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25700,6 +26371,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25716,6 +26388,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25743,6 +26416,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25761,6 +26435,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25787,7 +26462,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25833,6 +26509,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25859,7 +26536,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25905,6 +26583,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -25921,6 +26600,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25947,7 +26627,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25993,6 +26674,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26019,7 +26701,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -26055,6 +26738,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -26071,6 +26755,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26097,7 +26782,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -26134,6 +26820,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -26151,6 +26838,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26177,7 +26865,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - types' } @@ -26241,6 +26930,7 @@ FASTPythonImporterTest >> testGenericType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -26316,6 +27006,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. stack pop. @@ -26329,6 +27020,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -26398,7 +27090,8 @@ FASTPythonImporterTest >> testGlobalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'counter' ] { #category : 'tests - statements' } @@ -26479,16 +27172,19 @@ FASTPythonImporterTest >> testGlobalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'z' ] { #category : 'tests - advanced statements' } @@ -26528,6 +27224,7 @@ FASTPythonImporterTest >> testIf [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26600,6 +27297,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26691,6 +27389,7 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26726,6 +27425,7 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26813,6 +27513,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26848,6 +27549,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26891,6 +27593,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26983,6 +27686,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27018,6 +27722,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27061,6 +27766,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27156,6 +27862,7 @@ FASTPythonImporterTest >> testIfStatementWithABreak [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27219,6 +27926,7 @@ FASTPythonImporterTest >> testIfStatementWithAContinue [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27430,7 +28138,8 @@ FASTPythonImporterTest >> testImportInFunction [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'np'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'np' ] { #category : 'tests - imports' } @@ -27605,6 +28314,7 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'name'. stack pop. stack pop. @@ -27617,7 +28327,8 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - interpolations' } @@ -27660,7 +28371,8 @@ FASTPythonImporterTest >> testInterpolationWithAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CFG' ] { #category : 'tests - interpolations' } @@ -27705,6 +28417,7 @@ FASTPythonImporterTest >> testInterpolationWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. self assert: self topEntity operator equals: '+'. @@ -27759,6 +28472,7 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -27767,7 +28481,8 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - interpolations' } @@ -27822,7 +28537,8 @@ FASTPythonImporterTest >> testInterpolationWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'myMethod'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'myMethod' ] { #category : 'tests - interpolations' } @@ -27865,11 +28581,13 @@ FASTPythonImporterTest >> testInterpolationWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('==') ] @@ -27915,6 +28633,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -27930,6 +28649,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -27937,7 +28657,8 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'items' ] { #category : 'tests - interpolations' } @@ -27981,6 +28702,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -27989,6 +28711,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -27996,7 +28719,8 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: ''. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: '' ] { #category : 'tests - interpolations' } @@ -28089,6 +28813,7 @@ FASTPythonImporterTest >> testInterpolationWithLambda [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -28153,6 +28878,7 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -28160,7 +28886,8 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'label_order'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'label_order' ] { #category : 'tests - interpolations' } @@ -28195,6 +28922,7 @@ FASTPythonImporterTest >> testInterpolationWithTypeConversion [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'text'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'text'. stack pop. self assert: self topEntity typeConversion equals: 'r' ] @@ -28241,6 +28969,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28250,7 +28979,8 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28294,6 +29024,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28303,7 +29034,8 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28360,6 +29092,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28369,7 +29102,8 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28414,6 +29148,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -28423,6 +29158,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -28432,7 +29168,8 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28477,6 +29214,7 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -28486,7 +29224,8 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28530,11 +29269,13 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -28545,7 +29286,8 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28592,7 +29334,8 @@ FASTPythonImporterTest >> testKeywordArgumentToComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28648,6 +29391,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -28656,6 +29400,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28665,7 +29410,8 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28728,6 +29474,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28738,7 +29485,8 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28791,6 +29539,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -28799,6 +29548,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -28815,6 +29565,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -28823,6 +29574,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -28833,7 +29585,8 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28879,7 +29632,8 @@ FASTPythonImporterTest >> testKeywordArgumentToEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28926,7 +29680,8 @@ FASTPythonImporterTest >> testKeywordArgumentToFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28973,7 +29728,8 @@ FASTPythonImporterTest >> testKeywordArgumentToFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29009,6 +29765,7 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29017,7 +29774,8 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29064,7 +29822,8 @@ FASTPythonImporterTest >> testKeywordArgumentToInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29110,6 +29869,7 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -29129,7 +29889,8 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29185,7 +29946,8 @@ FASTPythonImporterTest >> testKeywordArgumentToList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29240,6 +30002,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -29249,6 +30012,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29265,6 +30029,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -29292,6 +30057,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -29303,7 +30069,8 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29347,6 +30114,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -29356,7 +30124,8 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29402,7 +30171,8 @@ FASTPythonImporterTest >> testKeywordArgumentToNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29447,6 +30217,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. stack pop. @@ -29456,7 +30227,8 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29512,7 +30284,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29567,6 +30340,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -29576,6 +30350,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29592,6 +30367,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -29619,6 +30395,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -29630,7 +30407,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29677,7 +30455,8 @@ FASTPythonImporterTest >> testKeywordArgumentToString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29732,6 +30511,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29741,7 +30521,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29788,7 +30569,8 @@ FASTPythonImporterTest >> testKeywordArgumentToTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29832,11 +30614,13 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -29846,7 +30630,8 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29891,6 +30676,7 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -29901,7 +30687,8 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - function definitions' } @@ -30009,6 +30796,7 @@ FASTPythonImporterTest >> testLambdaWithDefaultParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30056,6 +30844,7 @@ FASTPythonImporterTest >> testLambdaWithDictionarySplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30109,6 +30898,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30118,6 +30908,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30169,6 +30960,7 @@ FASTPythonImporterTest >> testLambdaWithListSplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30221,6 +31013,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -30230,6 +31023,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30276,6 +31070,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30285,6 +31080,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -30339,6 +31135,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30348,6 +31145,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30448,6 +31246,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -30457,6 +31256,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30473,6 +31273,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30499,7 +31300,8 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30536,6 +31338,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30552,6 +31355,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30578,7 +31382,8 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30614,6 +31419,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30630,6 +31436,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30656,7 +31463,8 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30693,6 +31501,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30702,6 +31511,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30718,6 +31528,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30744,7 +31555,8 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30781,6 +31593,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -30790,6 +31603,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -30806,6 +31620,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30832,7 +31647,8 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30869,6 +31685,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -30885,6 +31702,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30911,7 +31729,8 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30947,11 +31766,13 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -30969,6 +31790,7 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30995,7 +31817,8 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31041,6 +31864,7 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31067,7 +31891,8 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31115,6 +31940,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -31123,6 +31949,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31139,6 +31966,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31165,7 +31993,8 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31219,6 +32048,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -31236,6 +32066,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31262,7 +32093,8 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31306,6 +32138,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -31314,6 +32147,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31330,6 +32164,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -31338,6 +32173,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -31355,6 +32191,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31381,7 +32218,8 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31426,6 +32264,7 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31452,7 +32291,8 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31498,6 +32338,7 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31524,7 +32365,8 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31570,6 +32412,7 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31596,7 +32439,8 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31624,6 +32468,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -31639,6 +32484,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31665,7 +32511,8 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31694,6 +32541,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -31709,6 +32557,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -31733,6 +32582,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31759,7 +32609,8 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31804,6 +32655,7 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31830,7 +32682,8 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31868,6 +32721,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -31894,6 +32748,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31920,7 +32775,8 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31964,6 +32820,7 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31990,7 +32847,8 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32034,6 +32892,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32043,6 +32902,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32059,6 +32919,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32086,6 +32947,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32104,6 +32966,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32130,7 +32993,8 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32156,6 +33020,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -32171,6 +33036,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -32179,6 +33045,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -32192,6 +33059,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32199,7 +33067,8 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -32229,6 +33098,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -32252,6 +33122,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -32293,6 +33164,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -32329,6 +33201,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32355,7 +33228,8 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32400,6 +33274,7 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32426,7 +33301,8 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32463,6 +33339,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -32479,6 +33356,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32505,7 +33383,8 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32551,6 +33430,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -32559,6 +33439,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'abs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -32578,6 +33459,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation callee" @@ -32586,6 +33468,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'abs'. stack pop. stack pop. stack pop. @@ -32610,11 +33493,13 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -32623,7 +33508,8 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'points'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'points' ] { #category : 'tests - comprehensions' } @@ -32677,6 +33563,7 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32703,7 +33590,8 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32748,6 +33636,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32757,6 +33646,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32773,6 +33663,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32800,6 +33691,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32818,6 +33710,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32844,7 +33737,8 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32890,6 +33784,7 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32916,7 +33811,8 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32962,6 +33858,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -32978,6 +33875,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33004,7 +33902,8 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33050,6 +33949,7 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33076,7 +33976,8 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33112,6 +34013,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -33128,6 +34030,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33154,7 +34057,8 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33191,6 +34095,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -33208,6 +34113,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33234,7 +34140,8 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - splats' } @@ -33269,6 +34176,7 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33277,7 +34185,8 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33311,6 +34220,7 @@ FASTPythonImporterTest >> testListSplatInList [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33362,6 +34272,7 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -33371,7 +34282,8 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33415,6 +34327,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -33424,6 +34337,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack pop. @@ -33433,7 +34347,8 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33477,6 +34392,7 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'getList'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'getList'. stack pop. stack pop. stack pop. @@ -33486,7 +34402,8 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33548,7 +34465,8 @@ FASTPythonImporterTest >> testListSplatOnList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33601,6 +34519,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation callee" @@ -33609,6 +34528,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'format'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'format'. stack pop. stack pop. @@ -33625,6 +34545,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation right" @@ -33633,6 +34554,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'FILES'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'FILES'. stack pop. stack pop. stack pop. @@ -33643,7 +34565,8 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33678,6 +34601,7 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33686,7 +34610,8 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33732,7 +34657,8 @@ FASTPythonImporterTest >> testListSplatOnString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33786,6 +34712,7 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -33795,7 +34722,8 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33838,6 +34766,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'func'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func'. stack pop. stack push: (stack top initializers at: 2). @@ -33850,6 +34779,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -33860,7 +34790,8 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - function definitions' } @@ -33932,7 +34863,8 @@ FASTPythonImporterTest >> testListWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -34012,6 +34944,7 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -34020,7 +34953,8 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -34054,7 +34988,8 @@ FASTPythonImporterTest >> testListWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -34168,6 +35103,7 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -34175,7 +35111,8 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -34328,7 +35265,8 @@ FASTPythonImporterTest >> testListWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -34389,6 +35327,7 @@ FASTPythonImporterTest >> testListWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -34463,7 +35402,8 @@ FASTPythonImporterTest >> testListWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -34499,6 +35439,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -34514,6 +35455,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -34540,7 +35482,8 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -34598,7 +35541,8 @@ FASTPythonImporterTest >> testListWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -34668,6 +35612,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -34683,6 +35628,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -34709,7 +35655,8 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -34743,6 +35690,7 @@ FASTPythonImporterTest >> testListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -34819,7 +35767,8 @@ FASTPythonImporterTest >> testListWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -34971,7 +35920,8 @@ FASTPythonImporterTest >> testMatchAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - match' } @@ -35027,7 +35977,8 @@ FASTPythonImporterTest >> testMatchCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - match' } @@ -35194,7 +36145,8 @@ FASTPythonImporterTest >> testMatchIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - match' } @@ -35377,7 +36329,8 @@ FASTPythonImporterTest >> testMatchPatternComplexOperation [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -35434,7 +36387,8 @@ FASTPythonImporterTest >> testMatchPatternComplexe [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35544,7 +36498,8 @@ FASTPythonImporterTest >> testMatchPatternDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35590,6 +36545,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -35607,7 +36563,8 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35662,7 +36619,8 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35799,7 +36757,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35889,7 +36848,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithNoValues [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35970,6 +36930,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. stack pop. @@ -35988,7 +36949,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36097,7 +37059,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithVariables [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36153,7 +37116,8 @@ FASTPythonImporterTest >> testMatchPatternDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -36210,7 +37174,8 @@ FASTPythonImporterTest >> testMatchPatternFalse [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36267,7 +37232,8 @@ FASTPythonImporterTest >> testMatchPatternFloat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36324,7 +37290,8 @@ FASTPythonImporterTest >> testMatchPatternInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36391,7 +37358,8 @@ FASTPythonImporterTest >> testMatchPatternKeyword [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36466,7 +37434,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithClass [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36555,7 +37524,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithComplexPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36621,7 +37591,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36687,7 +37658,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36754,7 +37726,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36830,7 +37803,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36906,7 +37880,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36989,7 +37964,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37062,7 +38038,8 @@ FASTPythonImporterTest >> testMatchPatternList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -37143,7 +38120,8 @@ FASTPythonImporterTest >> testMatchPatternListInList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37189,6 +38167,7 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'list'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'list'. stack pop. stack pop. @@ -37206,7 +38185,8 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37261,7 +38241,8 @@ FASTPythonImporterTest >> testMatchPatternListSplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37323,6 +38304,7 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -37341,7 +38323,8 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37430,7 +38413,8 @@ FASTPythonImporterTest >> testMatchPatternListWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37486,7 +38470,8 @@ FASTPythonImporterTest >> testMatchPatternNone [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37543,7 +38528,8 @@ FASTPythonImporterTest >> testMatchPatternString [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37600,7 +38586,8 @@ FASTPythonImporterTest >> testMatchPatternTrue [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37673,7 +38660,8 @@ FASTPythonImporterTest >> testMatchPatternTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -37753,7 +38741,8 @@ FASTPythonImporterTest >> testMatchPatternUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37835,7 +38824,8 @@ FASTPythonImporterTest >> testMatchPatternUnionClassPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37936,7 +38926,8 @@ FASTPythonImporterTest >> testMatchPatternUnionDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38009,7 +39000,8 @@ FASTPythonImporterTest >> testMatchPatternUnionDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38091,7 +39083,8 @@ FASTPythonImporterTest >> testMatchPatternUnionList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38173,7 +39166,8 @@ FASTPythonImporterTest >> testMatchPatternUnionTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38230,7 +39224,8 @@ FASTPythonImporterTest >> testMatchPatternWithAlias [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -38278,6 +39273,7 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -38312,7 +39308,8 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38544,6 +39541,7 @@ FASTPythonImporterTest >> testMethodWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'CSVDataset'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CSVDataset'. stack pop. stack pop. @@ -38706,6 +39704,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -38773,6 +39772,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -38890,7 +39890,8 @@ FASTPythonImporterTest >> testNonlocalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'counter' ] { #category : 'tests - statements' } @@ -38971,16 +39972,19 @@ FASTPythonImporterTest >> testNonlocalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'z' ] { #category : 'tests - operators' } @@ -39030,7 +40034,8 @@ FASTPythonImporterTest >> testNotOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39065,6 +40070,7 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '&'. @@ -39073,7 +40079,8 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39108,6 +40115,7 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'or'. @@ -39117,7 +40125,8 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -39152,7 +40161,8 @@ FASTPythonImporterTest >> testNotOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -39261,6 +40271,7 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -39276,7 +40287,8 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39380,7 +40392,8 @@ FASTPythonImporterTest >> testNotOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -39465,7 +40478,8 @@ FASTPythonImporterTest >> testNotOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -39571,7 +40585,8 @@ FASTPythonImporterTest >> testNotOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -39804,7 +40819,8 @@ FASTPythonImporterTest >> testPrintStatmentWithChevron [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'file_object'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'file_object' ] { #category : 'tests - raise statement' } @@ -39853,7 +40869,8 @@ FASTPythonImporterTest >> testRaiseAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'module' ] { #category : 'tests - raise statement' } @@ -39887,6 +40904,7 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'ValueError'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'ValueError'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -39895,7 +40913,8 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'TypeError'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'TypeError' ] { #category : 'tests - raise statement' } @@ -39940,7 +40959,8 @@ FASTPythonImporterTest >> testRaiseCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception' ] { #category : 'tests - raise statement' } @@ -39964,7 +40984,8 @@ FASTPythonImporterTest >> testRaiseIdentifier [ stack push: self topEntity exception. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception' ] { #category : 'tests - raise statement' } @@ -39997,6 +41018,7 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation value" @@ -40004,7 +41026,8 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions' ] { #category : 'tests - literals' } @@ -40252,6 +41275,7 @@ FASTPythonImporterTest >> testReturnMultiple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'len'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'len'. stack pop. stack pop. @@ -40404,6 +41428,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation forClauses" @@ -40419,6 +41444,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -40443,7 +41469,8 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v' ] { #category : 'tests - comprehensions' } @@ -40480,6 +41507,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40496,6 +41524,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40522,7 +41551,8 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40558,6 +41588,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40574,6 +41605,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40600,7 +41632,8 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40637,6 +41670,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -40646,6 +41680,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40662,6 +41697,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40688,7 +41724,8 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40725,6 +41762,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -40734,6 +41772,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -40750,6 +41789,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40776,7 +41816,8 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40813,6 +41854,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -40829,6 +41871,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40855,7 +41898,8 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40891,11 +41935,13 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -40913,6 +41959,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40939,7 +41986,8 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40985,6 +42033,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41011,7 +42060,8 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41059,6 +42109,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -41067,6 +42118,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41083,6 +42135,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41109,7 +42162,8 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41163,6 +42217,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -41180,6 +42235,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41206,7 +42262,8 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41250,6 +42307,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -41258,6 +42316,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41274,6 +42333,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -41282,6 +42342,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -41299,6 +42360,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41325,7 +42387,8 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41370,6 +42433,7 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41396,7 +42460,8 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41442,6 +42507,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41468,7 +42534,8 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41514,6 +42581,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41540,7 +42608,8 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41568,6 +42637,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -41583,6 +42653,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41609,7 +42680,8 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41639,6 +42711,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation conditions" @@ -41654,6 +42727,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. stack push: (stack top operands at: 2). @@ -41678,6 +42752,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -41702,7 +42777,8 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v' ] { #category : 'tests - comprehensions' } @@ -41747,6 +42823,7 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41773,7 +42850,8 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41811,6 +42889,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -41837,6 +42916,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41863,7 +42943,8 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41907,6 +42988,7 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41933,7 +43015,8 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41978,6 +43061,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -41987,6 +43071,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42003,6 +43088,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -42030,6 +43116,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -42048,6 +43135,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42074,7 +43162,8 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42100,6 +43189,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -42115,6 +43205,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -42123,6 +43214,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -42136,6 +43228,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42143,7 +43236,8 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -42173,6 +43267,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -42196,6 +43291,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -42237,6 +43333,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -42273,6 +43370,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42299,7 +43397,8 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42344,6 +43443,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42370,7 +43470,8 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42407,6 +43508,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -42423,6 +43525,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42449,7 +43552,8 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42503,6 +43607,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42529,7 +43634,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42573,6 +43679,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -42582,6 +43689,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42598,6 +43706,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -42625,6 +43734,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -42643,6 +43753,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42669,7 +43780,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42715,6 +43827,7 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42741,7 +43854,8 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42787,6 +43901,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -42803,6 +43918,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42829,7 +43945,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42875,6 +43992,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42901,7 +44019,8 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42937,6 +44056,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42953,6 +44073,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42979,7 +44100,8 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -43016,6 +44138,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -43033,6 +44156,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43059,7 +44183,8 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43092,7 +44217,8 @@ FASTPythonImporterTest >> testSetWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -43172,6 +44298,7 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -43180,7 +44307,8 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -43214,7 +44342,8 @@ FASTPythonImporterTest >> testSetWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -43328,6 +44457,7 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -43335,7 +44465,8 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -43488,7 +44619,8 @@ FASTPythonImporterTest >> testSetWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -43549,6 +44681,7 @@ FASTPythonImporterTest >> testSetWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -43624,7 +44757,8 @@ FASTPythonImporterTest >> testSetWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -43660,6 +44794,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -43675,6 +44810,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43701,7 +44837,8 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43759,7 +44896,8 @@ FASTPythonImporterTest >> testSetWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -43828,6 +44966,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -43843,6 +44982,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43869,7 +45009,8 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43903,6 +45044,7 @@ FASTPythonImporterTest >> testSetWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -43979,7 +45121,8 @@ FASTPythonImporterTest >> testSetWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -44133,6 +45276,7 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -44142,7 +45286,8 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44185,6 +45330,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44194,6 +45340,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -44208,6 +45355,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44217,6 +45365,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -44233,7 +45382,8 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44284,7 +45434,8 @@ FASTPythonImporterTest >> testSliceBoolean [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44335,6 +45486,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -44343,6 +45495,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'indexOf'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'indexOf'. stack pop. stack pop. stack pop. @@ -44352,7 +45505,8 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44394,6 +45548,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -44402,6 +45557,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. "Testing value of monovalue relation thenExpression" @@ -44410,12 +45566,14 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -44424,7 +45582,8 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44457,7 +45616,8 @@ FASTPythonImporterTest >> testSliceEmpty [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44508,7 +45668,8 @@ FASTPythonImporterTest >> testSliceNone [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44542,6 +45703,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). @@ -44555,6 +45717,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44564,6 +45727,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'h'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'h'. stack pop. stack pop. stack pop. @@ -44573,7 +45737,8 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44628,7 +45793,8 @@ FASTPythonImporterTest >> testSliceReverse [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44679,6 +45845,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack pop. @@ -44702,6 +45869,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack pop. stack pop. @@ -44711,7 +45879,8 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44800,7 +45969,8 @@ FASTPythonImporterTest >> testSliceUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44833,11 +46003,13 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -44846,7 +46018,8 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44890,7 +46063,8 @@ FASTPythonImporterTest >> testSliceWithEnd [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44934,7 +46108,8 @@ FASTPythonImporterTest >> testSliceWithStart [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44992,7 +46167,8 @@ FASTPythonImporterTest >> testSliceWithStartStopStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -45036,7 +46212,8 @@ FASTPythonImporterTest >> testSliceWithStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - types' } @@ -45165,7 +46342,8 @@ FASTPythonImporterTest >> testSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - subscripts' } @@ -45209,7 +46387,8 @@ FASTPythonImporterTest >> testSubscriptOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45253,7 +46432,8 @@ FASTPythonImporterTest >> testSubscriptOnAttributeWithParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'os'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'os' ] { #category : 'tests - subscripts' } @@ -45296,7 +46476,8 @@ FASTPythonImporterTest >> testSubscriptOnAwait [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45341,6 +46522,7 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45349,7 +46531,8 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45394,7 +46577,8 @@ FASTPythonImporterTest >> testSubscriptOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - subscripts' } @@ -45450,6 +46634,7 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -45457,7 +46642,8 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45518,7 +46704,8 @@ FASTPythonImporterTest >> testSubscriptOnDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45571,6 +46758,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -45579,6 +46767,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45595,6 +46784,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -45602,7 +46792,8 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - subscripts' } @@ -45637,7 +46828,8 @@ FASTPythonImporterTest >> testSubscriptOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - subscripts' } @@ -45736,6 +46928,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45745,6 +46938,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45761,6 +46955,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45787,7 +46982,8 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - subscripts' } @@ -45830,7 +47026,8 @@ FASTPythonImporterTest >> testSubscriptOnListSplat [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - subscripts' } @@ -45929,6 +47126,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45938,6 +47136,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45954,6 +47153,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45980,7 +47180,8 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - subscripts' } @@ -46069,7 +47270,8 @@ FASTPythonImporterTest >> testSubscriptOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - subscripts' } @@ -46113,11 +47315,13 @@ FASTPythonImporterTest >> testSubscriptOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - subscripts' } @@ -46162,6 +47366,7 @@ FASTPythonImporterTest >> testSubscriptOnUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '-' @@ -46198,6 +47403,7 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -46206,7 +47412,8 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - subscripts' } @@ -46262,7 +47469,8 @@ FASTPythonImporterTest >> testSubscriptWithBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -46294,6 +47502,7 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: (stack top indices at: 2). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -46301,7 +47510,8 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'imgs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'imgs' ] { #category : 'tests - subscripts' } @@ -46343,7 +47553,8 @@ FASTPythonImporterTest >> testSubscriptWithTwoIndicies [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'loc'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'loc' ] { #category : 'tests - subscripts' } @@ -46416,7 +47627,8 @@ FASTPythonImporterTest >> testSubscriptWithTwoSlices [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'arr'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'arr' ] { #category : 'tests - literals' } @@ -46539,6 +47751,7 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -46557,6 +47770,7 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -46617,6 +47831,7 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -46661,6 +47876,7 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -46779,6 +47995,7 @@ FASTPythonImporterTest >> testTupleExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'toto'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'toto'. stack pop. stack pop. @@ -46947,6 +48164,7 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'bytearray'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'bytearray'. stack pop. stack pop. @@ -46986,7 +48204,8 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'self'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'self' ] { #category : 'tests - collections' } @@ -47019,7 +48238,8 @@ FASTPythonImporterTest >> testTupleWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47064,7 +48284,8 @@ FASTPythonImporterTest >> testTupleWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47098,6 +48319,7 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -47106,7 +48328,8 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -47140,7 +48363,8 @@ FASTPythonImporterTest >> testTupleWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - collections' } @@ -47173,11 +48397,13 @@ FASTPythonImporterTest >> testTupleWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -47250,6 +48476,7 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -47257,7 +48484,8 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47308,7 +48536,8 @@ FASTPythonImporterTest >> testTupleWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47350,6 +48579,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -47358,6 +48588,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47374,6 +48605,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -47381,7 +48613,8 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -47482,7 +48715,8 @@ FASTPythonImporterTest >> testTupleWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47543,6 +48777,7 @@ FASTPythonImporterTest >> testTupleWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -47631,6 +48866,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47640,6 +48876,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47656,6 +48893,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47682,7 +48920,8 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -47714,7 +48953,8 @@ FASTPythonImporterTest >> testTupleWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -47772,7 +49012,8 @@ FASTPythonImporterTest >> testTupleWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -47851,6 +49092,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47860,6 +49102,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47876,6 +49119,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47902,7 +49146,8 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -47971,7 +49216,8 @@ FASTPythonImporterTest >> testTupleWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -48029,11 +49275,13 @@ FASTPythonImporterTest >> testTupleWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -48067,6 +49315,7 @@ FASTPythonImporterTest >> testTupleWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -48197,6 +49446,7 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -48212,7 +49462,8 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int' ] { #category : 'tests - statements' } @@ -48257,6 +49508,7 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -48272,7 +49524,8 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int' ] { #category : 'tests - types' } @@ -48319,6 +49572,7 @@ FASTPythonImporterTest >> testTypeAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'subprocess'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'subprocess'. stack pop. stack pop. stack pop. @@ -48375,6 +49629,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. self assert: self topEntity operator equals: '|'. @@ -48384,6 +49639,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. stack pop. stack pop. @@ -48441,6 +49697,7 @@ FASTPythonImporterTest >> testTypeCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. stack pop. @@ -48783,6 +50040,7 @@ FASTPythonImporterTest >> testTypeIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Path'. stack pop. stack pop. @@ -48942,6 +50200,7 @@ FASTPythonImporterTest >> testTypeList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'object'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'object'. stack pop. stack pop. stack pop. @@ -48999,6 +50258,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. "Testing value of multivalued relation forClauses" @@ -49014,6 +50274,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. "Testing value of monovalue relation right" @@ -49030,6 +50291,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -49191,7 +50453,8 @@ FASTPythonImporterTest >> testTypeParametersInFunctionDefinition [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T' ] { #category : 'tests - types' } @@ -49237,6 +50500,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. @@ -49250,6 +50514,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -49262,7 +50527,8 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'L'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'L' ] { #category : 'tests - types' } @@ -49579,6 +50845,7 @@ FASTPythonImporterTest >> testTypedListSplatParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Any'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Any'. stack pop. stack pop. stack pop. @@ -49636,6 +50903,7 @@ FASTPythonImporterTest >> testTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Path'. stack pop. stack pop. stack pop. @@ -49697,6 +50965,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49733,6 +51002,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49790,6 +51060,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'e'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'e'. stack pop. stack pop. self assert: self topEntity operator equals: '-'. @@ -49829,6 +51100,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -49838,6 +51110,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -49876,6 +51149,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49912,11 +51186,13 @@ FASTPythonImporterTest >> testUnaryOperatorWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -49995,6 +51271,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -50003,6 +51280,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -50089,6 +51367,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '~' ] @@ -50154,6 +51433,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -50230,6 +51510,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -50295,6 +51576,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -50377,6 +51659,7 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'bytes'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'bytes'. stack pop. stack pop. stack pop. @@ -50392,6 +51675,7 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -50446,7 +51730,8 @@ FASTPythonImporterTest >> testVariableDeclaration [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'ModuleType'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'ModuleType' ] { #category : 'tests - assignments' } @@ -50507,7 +51792,8 @@ FASTPythonImporterTest >> testWalrusAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -50589,6 +51875,7 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -50597,7 +51884,8 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - assignments' } @@ -50632,7 +51920,8 @@ FASTPythonImporterTest >> testWalrusCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -50741,6 +52030,7 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -50756,7 +52046,8 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -50914,7 +52205,8 @@ FASTPythonImporterTest >> testWalrusIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -50977,6 +52269,7 @@ FASTPythonImporterTest >> testWalrusLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -51019,7 +52312,8 @@ FASTPythonImporterTest >> testWalrusList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - assignments' } @@ -51052,7 +52346,8 @@ FASTPythonImporterTest >> testWalrusListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - assignments' } @@ -51089,6 +52384,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -51104,6 +52400,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -51130,7 +52427,8 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -51190,7 +52488,8 @@ FASTPythonImporterTest >> testWalrusNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - assignments' } @@ -51224,12 +52523,14 @@ FASTPythonImporterTest >> testWalrusPatternList [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -51301,6 +52602,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -51316,6 +52618,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -51342,7 +52645,8 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -51413,7 +52717,8 @@ FASTPythonImporterTest >> testWalrusSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -51474,11 +52779,13 @@ FASTPythonImporterTest >> testWalrusTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -51631,6 +52938,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -51650,6 +52958,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -51657,7 +52966,8 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun' ] { #category : 'tests - with statements' } @@ -51694,6 +53004,7 @@ FASTPythonImporterTest >> testWithStatement [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -51747,6 +53058,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -51756,6 +53068,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -51799,6 +53112,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr1'. stack pop. "Testing value of monovalue relation target" @@ -51807,6 +53121,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target1'. stack pop. stack pop. @@ -51820,6 +53135,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr2'. stack pop. "Testing value of monovalue relation target" @@ -51828,6 +53144,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target2'. stack pop. stack pop. @@ -51841,6 +53158,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr3'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr3'. stack pop. "Testing value of monovalue relation target" @@ -51849,6 +53167,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target3'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target3'. stack pop. stack pop. @@ -51897,7 +53216,8 @@ FASTPythonImporterTest >> testYieldFrom [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests' } @@ -51921,7 +53241,8 @@ FASTPythonImporterTest >> testYieldWithIdentifier [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st new file mode 100644 index 0000000..6509491 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -0,0 +1,1288 @@ +Class { + #name : 'FASTPythonLocalResolverTest', + #superclass : 'FASTPythonAbstractTestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' +} + +{ #category : 'resolving' } +FASTPythonLocalResolverTest >> parseAndResolve: aString [ + + model := self parse: aString. + + FASTPythonLocalResolverVisitor resolve: model module +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToTuple [ + + | assignedVariableX assignedVariableY usedVariableX | + self parseAndResolve: 'x, y = 1, 2 + +print(x)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToTupleInTuples [ + + | assignedVariableX assignedVariableY assignedVariableZ usedVariableX usedVariableY usedVariableZ | + self parseAndResolve: 'x, (y, z) = 1, (2, 4) + +print(x) +print(y) +print(z)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second initializers first. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 2. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + + usedVariableY := model module statements third arguments first. + self assert: usedVariableY localDeclaration equals: assignedVariableY. + self assert: usedVariableY equals: assignedVariableY localDeclaration localUses second. + + assignedVariableZ := model module statements first left initializers second initializers second. + self assert: assignedVariableZ localDeclaration equals: assignedVariableZ. + self assert: assignedVariableZ localDeclaration name equals: 'z'. + self assert: assignedVariableZ localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableZ localDeclaration isVariableWriteAccess. + self deny: assignedVariableZ localDeclaration isNonLocalDeclaration. + self assert: assignedVariableZ localDeclaration localUses size equals: 2. + self assert: assignedVariableZ localDeclaration localUses first equals: assignedVariableZ. + + usedVariableZ := model module statements fourth arguments first. + self assert: usedVariableZ localDeclaration equals: assignedVariableZ. + self assert: usedVariableZ equals: assignedVariableZ localDeclaration localUses second +] + +{ #category : 'tests - non local declarations' } +FASTPythonLocalResolverTest >> testAttributeAccessHalfResolved [ + "Here x is resolved but y is not resolved locally." + + | import importedEntity receiver value | + self parseAndResolve: 'import x + +x.y'. + + import := model module statements first. + importedEntity := import importedEntities first. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + receiver := model module statements second value. + self assert: receiver localDeclaration equals: import. + self deny: receiver localDeclaration isNonLocalDeclaration. + self assert: receiver localDeclaration localUses second equals: receiver. + + value := model module statements second. + self assert: value localDeclaration name equals: 'y'. + self assert: value localDeclaration isNonLocalDeclaration. + self assert: value localDeclaration localUses size equals: 1. + self assert: value localDeclaration localUses first equals: value +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ + + | assignedVariable | + self parseAndResolve: 'x = 3 + +# {x: 2}'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 1. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntity [ + + | import importedEntity call | + self parseAndResolve: 'from matplotlib import __version__ + +print(__version__)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: '__version__'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second arguments first. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntityWithAlias [ + + | import importedEntity call | + self parseAndResolve: 'from matplotlib import __version__ as v + +print(v)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'v'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second arguments first. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntityWithAliasDoesNotShadowVariable [ + + | import importedEntity call assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'x = 1 + +print(x) + +from y import x as func + +func() + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fifth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements fourth callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - functions' } +FASTPythonLocalResolverTest >> testFunctionDeclaredAndCalled [ + + | functionDefinition call | + self parseAndResolve: 'def func(): + pass + +func()'. + + functionDefinition := model module statements first. + self assert: functionDefinition localDeclaration equals: functionDefinition. + self assert: functionDefinition localDeclaration name equals: 'func'. + self deny: functionDefinition localDeclaration isNonLocalDeclaration. + self assert: functionDefinition localDeclaration localUses size equals: 2. + self assert: functionDefinition localDeclaration localUses first equals: functionDefinition. + + call := model module statements second callee. + self assert: call localDeclaration equals: functionDefinition. + self assert: call equals: functionDefinition localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameter [ + + | declaration usedVariable | + self parseAndResolve: 'def funct(y): + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ + + | declaration usedVariable | + self parseAndResolve: 'def funct(y=3): + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ + + | assignedGlobal usedGlobal assignedTemporary temporaryUsage1 temporaryUsage2 | + self parseAndResolve: 'glob = 1 + +def fun(): + glob = 3 + print(glob) + return glob + +fun() +print(glob)'. + + assignedGlobal := model module statements first left. + self assert: assignedGlobal localDeclaration equals: assignedGlobal. + self assert: assignedGlobal localDeclaration name equals: 'glob'. + self assert: assignedGlobal localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedGlobal localDeclaration isNonLocalDeclaration. + self assert: assignedGlobal localDeclaration localUses size equals: 2. + self assert: assignedGlobal localDeclaration localUses first equals: assignedGlobal. + + usedGlobal := model module statements fourth arguments first. + self assert: usedGlobal localDeclaration equals: assignedGlobal. + self assert: usedGlobal equals: assignedGlobal localDeclaration localUses second. + + assignedTemporary := model module statements second statements first left. + self assert: assignedTemporary localDeclaration equals: assignedTemporary. + self assert: assignedTemporary localDeclaration name equals: 'glob'. + self assert: assignedTemporary localDeclaration variableDeclarator equals: model module statements second statements first. + self deny: assignedTemporary localDeclaration isNonLocalDeclaration. + self assert: assignedTemporary localDeclaration localUses size equals: 3. + self assert: assignedTemporary localDeclaration localUses first equals: assignedTemporary. + + temporaryUsage1 := model module statements second statements second arguments first. + self assert: temporaryUsage1 localDeclaration equals: assignedTemporary. + self assert: temporaryUsage1 equals: assignedTemporary localDeclaration localUses second. + + temporaryUsage2 := model module statements second statements third expression. + self assert: temporaryUsage2 localDeclaration equals: assignedTemporary. + self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | assignedVariable usedVariable import importedEntity usedImportedEntity | + self parseAndResolve: 'x = 1 +print(x) + +import x + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImportAlias [ + "Here we cannot know if the second printing is of a variable." + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x) + +import a as x + +print(x)'. + + self skip. "We need to update the behavior" + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + self deny: model module statements fourth arguments first hasLocalDeclaration +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImportInFunction [ + + | assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'matplotlib = 3 + +print(matplotlib) + +def f(): + import matplotlib + return matplotlib + +print(matplotlib)'. + + self skip. "To update and fix" + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'matplotlib'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fourth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsageInCall [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +{x: 2}'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first key. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ + + | assignedVariable usedVariable | + self parseAndResolve: 'glob = 1 + +def fun(): + return glob + +print(fun())'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second statements first expression. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInLambda [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 + +lambda: x'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInList [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +[ x ]'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInSet [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +{ x }'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +(x, 2)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testImportShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | import importedEntity1 usedImportedEntity1 importedEntity2 usedImportedEntity2 | + self parseAndResolve: 'import time + +print(time) + +from time import time + +print(time)'. + + import := model module statements first. + importedEntity1 := import importedEntities anyOne. + self assert: importedEntity1 localDeclaration equals: import. + self deny: importedEntity1 localDeclaration importedEntities first hasAlias. + self assert: importedEntity1 localDeclaration importedEntities first segments last equals: 'time'. + self deny: importedEntity1 localDeclaration isNonLocalDeclaration. + self assert: importedEntity1 localDeclaration localUses size equals: 4. + self assert: importedEntity1 localDeclaration localUses first equals: importedEntity1. + + usedImportedEntity1 := model module statements second arguments first. + self assert: usedImportedEntity1 localDeclaration equals: import. + self assert: usedImportedEntity1 equals: importedEntity1 localDeclaration localUses second. + + importedEntity2 := model module statements third importedEntities anyOne. + self assert: importedEntity2 localDeclaration equals: import. + self assert: importedEntity2 localDeclaration localUses third equals: importedEntity2. + + usedImportedEntity2 := model module statements fourth arguments first. + self assert: usedImportedEntity2 localDeclaration equals: import. + self assert: usedImportedEntity2 equals: importedEntity2 localDeclaration localUses fourth +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntity [ + + | import importedEntity call | + self parseAndResolve: 'import func + +func()'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntityWithAlias [ + + | import importedEntity call | + self parseAndResolve: 'import functi as func + +func()'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntityWithAliasDoesNotShadowVariable [ + + | import importedEntity call assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'x = 1 + +print(x) + +import x as func + +func() + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fifth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements fourth callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testLambdaParameter [ + + | declaration usedVariable | + self parseAndResolve: 'lambda y: y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - local variables' } +FASTPythonLocalResolverTest >> testLocalVariableInFunction [ + + | assignedVariable usedVariable | + self parseAndResolve: 'def f(): + x = 1 + return x + +print(f())'. + + assignedVariable := model module statements first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - local variables' } +FASTPythonLocalResolverTest >> testLocalVariableInFunctionWithTuples [ + + | assignedVariableX assignedVariableY usedVariable | + self parseAndResolve: 'def f(): + x, y = 1, 2 + return x + +print(f())'. + + assignedVariableX := model module statements first statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariableX. + self assert: usedVariable equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + +] + +{ #category : 'tests - methods' } +FASTPythonLocalResolverTest >> testMethodRedefined [ + + | declaration1 declaration2 | + self parseAndResolve: 'class C: + def meth(self): + return self + + def meth(self): + return self'. + + declaration1 := model module statements first statements first. + self assert: declaration1 localDeclaration equals: declaration1. + self assert: declaration1 localDeclaration name equals: 'meth'. + self deny: declaration1 localDeclaration isNonLocalDeclaration. + self assert: declaration1 localDeclaration localUses size equals: 2. + self assert: declaration1 localDeclaration localUses first equals: declaration1. + + declaration2 := model module statements first statements second. + self assert: declaration2 localDeclaration equals: declaration1. + self assert: declaration1 localDeclaration localUses second equals: declaration2 +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testMethodSelfParameter [ + + | declaration usedVariable | + self parseAndResolve: 'class C: + def meth(self): + return self'. + + declaration := model module statements first statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'self'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ + + | declaration usedVariable | + self parseAndResolve: 'class C: + def meth(this): + return this'. + + declaration := model module statements first statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'this'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - non local declarations' } +FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ + + | nonLocalCall nonLocalAccess | + self parseAndResolve: 'print(x)'. + + nonLocalCall := model module statements first callee. + self assert: nonLocalCall localDeclaration name equals: 'print'. + self assert: nonLocalCall localDeclaration isNonLocalDeclaration. + self assert: nonLocalCall localDeclaration localUses size equals: 1. + self assert: nonLocalCall localDeclaration localUses first equals: nonLocalCall. + + nonLocalAccess := model module statements first arguments first. + self assert: nonLocalAccess localDeclaration name equals: 'x'. + self assert: nonLocalAccess localDeclaration isNonLocalDeclaration. + self assert: nonLocalAccess localDeclaration localUses size equals: 1. + self assert: nonLocalAccess localDeclaration localUses first equals: nonLocalAccess +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ + + | parameter usedParameter assignedVariable usedVariable | + self parseAndResolve: 'def func(param): + print(param) + param = 3 + print(param)'. + + parameter := model module statements first parameters first. + self assert: parameter localDeclaration equals: parameter. + self assert: parameter localDeclaration name equals: 'param'. + self deny: parameter localDeclaration isNonLocalDeclaration. + self assert: parameter localDeclaration localUses size equals: 2. + self assert: parameter localDeclaration localUses first equals: parameter. + + usedParameter := model module statements first statements first arguments first. + self assert: usedParameter localDeclaration equals: parameter. + self assert: usedParameter equals: parameter localDeclaration localUses second. + + assignedVariable := model module statements first statements second left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'param'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements second. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements first statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ + + | assignedVariable1 assignedVariable2 usedVariable | + self parseAndResolve: 'x = 1 +x = 2 +x'. + + assignedVariable1 := model module statements first left. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'x'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self assert: assignedVariable1 localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 3. + self assert: assignedVariable1 localDeclaration localUses first equals: assignedVariable1. + + assignedVariable2 := model module statements second left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable1. + self assert: assignedVariable2 equals: assignedVariable1 localDeclaration localUses second. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignedVariable1. + self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoResolutionsDoNotClash [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + "Do a second resolution to ensure the first one is cleared" + FASTPythonLocalResolverVisitor resolve: model module. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ + + | assignedVariable usedVariable | + self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] +for x in fruits: + pass'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'fruits'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + usedVariable := model module statements second right. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableAccessedInIf [ + + | assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'glob = 1 + +if glob < 3: + print(glob)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + usedVariable1 := model module statements second condition operands first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements second thenClause statements first arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableDeclaredInFor [ + + | declared usedVariable | + self parseAndResolve: 'for x in "banana": + i = 2 + +print(i)'. + + declared := model module statements first statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'i'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. + self assert: declared localDeclaration isVariableWriteAccess. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testVariableDeclaredInWhile [ + + | declared usedVariable | + self parseAndResolve: 'while False: + i = 2 + +print(i)'. + + declared := model module statements first statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'i'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - comprehensions' } +FASTPythonLocalResolverTest >> testVariableInListComprehensions [ + + | declared usedVariable | + self parseAndResolve: 'fruits = ["apple", "banana", "cherry", "kiwi", "mango"] + +[x for x in fruits]'. + + declared := model module statements second forClauses first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements second forClauses first. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second body. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - comprehensions' } +FASTPythonLocalResolverTest >> testVariableInListComprehensionsDoesNotLeak [ + "Here the x of the comprehension should not leek outside of it if we consider we are in Python 3" + + | import importedEntity declared usedVariable usedImportedEntity | + self parseAndResolve: 'import x + +fruits = ["apple", "banana", "cherry", "kiwi", "mango"] + +[x for x in fruits] + +print(x)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + declared := model module statements third forClauses first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements third forClauses first. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements third body. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfFor [ + + | declared usedVariable | + self parseAndResolve: 'for x in "banana": + print(x)'. + + declared := model module statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first. + self assert: declared localDeclaration isVariableWriteAccess. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements first statements first arguments first. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForClashingWithOtherVariables [ + + | assignedVariable assignedVariableInFor usedVariable | + self parseAndResolve: 'x = 3 + +for x in range(5): + print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + assignedVariableInFor := model module statements second left. + self assert: assignedVariableInFor localDeclaration equals: assignedVariable. + self assert: assignedVariableInFor equals: assignedVariableInFor localDeclaration localUses second. + + usedVariable := model module statements second statements first arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: usedVariable localDeclaration localUses third +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForRedefinedInside [ + + | declared usedVariable | + self parseAndResolve: 'for x in range(5): + x += 1'. + + declared := model module statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first. + self assert: declared localDeclaration isVariableWriteAccess. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements first statements first left. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ + + | assignedVariable usedVariable | + self parseAndResolve: 'for x in range(5): + pass + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: usedVariable localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForWithTuple [ + + | declaredA usedVariableA declaredB usedVariableB | + self parseAndResolve: 'for a, b in arg: + print(a, b)'. + + declaredA := model module statements first left initializers first. + self assert: declaredA localDeclaration equals: declaredA. + self assert: declaredA localDeclaration name equals: 'a'. + self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. + self assert: declaredA localDeclaration isVariableWriteAccess. + self deny: declaredA localDeclaration isNonLocalDeclaration. + self assert: declaredA localDeclaration localUses size equals: 2. + self assert: declaredA localDeclaration localUses first equals: declaredA. + + usedVariableA := model module statements first statements first arguments first. + self assert: usedVariableA localDeclaration equals: declaredA. + self assert: usedVariableA equals: declaredA localDeclaration localUses second. + + declaredB := model module statements first left initializers second. + self assert: declaredB localDeclaration equals: declaredB. + self assert: declaredB localDeclaration name equals: 'b'. + self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. + self assert: declaredB localDeclaration isVariableWriteAccess. + self deny: declaredB localDeclaration isNonLocalDeclaration. + self assert: declaredB localDeclaration localUses size equals: 2. + self assert: declaredB localDeclaration localUses first equals: declaredB. + + usedVariableB := model module statements first statements first arguments second. + self assert: usedVariableB localDeclaration equals: declaredB. + self assert: usedVariableB equals: declaredB localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ + + | assignedVariable assignedVariable2 usedVariable | + self parseAndResolve: 'glob = 1 + +if True: + glob = 3 + +print(glob)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + assignedVariable2 := model module statements second thenClause statements first left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable. + self assert: assignedVariable2 equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st new file mode 100644 index 0000000..f55ecbf --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -0,0 +1,261 @@ +Class { + #name : 'FASTPythonSSATest', + #superclass : 'FASTPythonAbstractTestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' +} + +{ #category : 'parsing' } +FASTPythonSSATest >> parseAndResolve: aString [ + + model := self parse: aString. + + FASTPythonSSAVisitor resolve: model module +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariableUsed [ + + | assignedVar usedVar | + self parseAndResolve: 'for x in range(5): + print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements first statements first arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariablesInTupleUsed [ + + | assignedVarA assignedVarB usedVarA usedVarB | + self parseAndResolve: 'for a, b in data: + print(a, b)'. + + assignedVarA := model module statements first left initializers first. + self assert: assignedVarA ssaVersion version equals: 1. + self assert: assignedVarA ssaName equals: 'a_1'. + self assert: assignedVarA ssaVersion localUses size equals: 2. + + usedVarA := model module statements first statements first arguments first. + self assert: usedVarA ssaVersion identicalTo: assignedVarA ssaVersion. + + assignedVarB := model module statements first left initializers second. + self assert: assignedVarB ssaVersion version equals: 1. + self assert: assignedVarB ssaName equals: 'b_1'. + self assert: assignedVarB ssaVersion localUses size equals: 2. + + usedVarB := model module statements first statements first arguments second. + self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def func(x): + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first arguments first. + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignement [ + + | assignedVar1 assignedVar2 | + self parseAndResolve: 'x = 3 + +x = 4'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementAndUsage [ + + | assignedVar1 assignedVar2 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +print(x) + + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements second arguments first. + self deny: usedVar1 ssaVersion isPhi. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + assignedVar2 := model module statements third left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fourth arguments first. + self deny: usedVar2 ssaVersion isPhi. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInIf [ + + | assignedVar1 assignedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInIfAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testSingleAssignement [ + + | assignedVar | + self parseAndResolve: 'x = 5'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + + self assert: assignedVar localDeclaration newVersionNumber equals: 2. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testSingleAssignementAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 5 + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testTupleAssignement [ + + | assignedVarX assignedVarY | + self parseAndResolve: 'x, y = 5, 6'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1' +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testTupleInTupleAssignement [ + + | assignedVarX assignedVarY assignedVarZ | + self parseAndResolve: 'x, (y, z) = 5, (6, 7)'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second initializers first. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1'. + + assignedVarZ := model module statements first left initializers second initializers second. + self assert: assignedVarZ ssaVersion version equals: 1. + self assert: assignedVarZ ssaName equals: 'z_1' +] + +{ #category : 'tests - non local declarations' } +FASTPythonSSATest >> testUndeclaredVariable [ + + | undeclared | + self parseAndResolve: 'print(x)'. + + undeclared := model module statements first arguments first. + self assert: undeclared ssaVersion isNil +] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index d85df03..82b79af 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -11,3 +11,29 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> isVariableWriteAccess [ + "I am used in the LR and SSA builder to know if I represent the assignment of a variable." + + ^ self variableDeclarator isNotNil +] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> localResolverKind [ + "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. + + I am used to know the kind of entity that is been declared." + + ^ self error: 'This entity cannot be a local declaration or is missing the overriding method.' +] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> variableDeclarator [ + "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. + Nodes representing potential variable write access should override me. + + I am used by the LocalResolver and potentially SSA" + + ^ nil +] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st new file mode 100644 index 0000000..e73ab50 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -0,0 +1,27 @@ +Extension { #name : 'FASTPyIdentifier' } + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> localResolverKind [ + + self isVariableWriteAccess ifTrue: [ ^ #variable ]. + + self halt "I don't know if it can be something else." +] + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + | assignedNode | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + assignedNode := self. + [ assignedNode collectionInitializer isNotNil and: [ assignedNode collectionInitializer isTuple ] ] whileTrue: [ assignedNode := assignedNode collectionInitializer ]. + + assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. + + assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Tools/FASTPyImport.extension.st b/src/FAST-Python-Tools/FASTPyImport.extension.st new file mode 100644 index 0000000..2d8f610 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyImport.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyImport' } + +{ #category : '*FAST-Python-Tools' } +FASTPyImport >> localResolverKind [ + + ^ #import +] diff --git a/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st new file mode 100644 index 0000000..3e8ae44 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyMethodDefinition' } + +{ #category : '*FAST-Python-Tools' } +FASTPyMethodDefinition >> localResolverKind [ + + ^ #method +] diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st new file mode 100644 index 0000000..2ecef63 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -0,0 +1,14 @@ +Extension { #name : 'FASTPyParameter' } + +{ #category : '*FAST-Python-Tools' } +FASTPyParameter >> localResolverKind [ + + ^ #parameter +] + +{ #category : '*FAST-Python-Tools' } +FASTPyParameter >> variableDeclarator [ + "For parameters, they are their own declarator." + + ^ self +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 9608efa..e850dde 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -35,9 +35,9 @@ Class { 'started', 'cfgs' ], - #category : 'FAST-Python-Tools-CFG/DataFlow', + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' + #tag : 'CFG/LocalResolver/SSA' } { #category : 'running' } diff --git a/src/FAST-Python-Tools/FASTPythonLRScope.class.st b/src/FAST-Python-Tools/FASTPythonLRScope.class.st new file mode 100644 index 0000000..72628a6 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLRScope.class.st @@ -0,0 +1,57 @@ +Class { + #name : 'FASTPythonLRScope', + #superclass : 'Object', + #instVars : [ + 'entity', + 'nameDictionary' + ], + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #package : 'FAST-Python-Tools', + #tag : 'CFG/LocalResolver/SSA' +} + +{ #category : 'instance creation' } +FASTPythonLRScope class >> for: anEntity [ + + ^ self new + entity: anEntity; + yourself +] + +{ #category : 'actions' } +FASTPythonLRScope >> declarationNamed: aVariableName ifPresent: aBlock [ + + ^ nameDictionary at: aVariableName ifPresent: aBlock +] + +{ #category : 'actions' } +FASTPythonLRScope >> ensureDeclarationOf: aName declaration: aFASTNode [ + "If it is already present we do nothing. Else we create the local declaration. + + I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." + + ^ nameDictionary + at: aName + ifPresent: [ :declaration | + declaration localResolverKind = aFASTNode localResolverKind + ifTrue: [ ^ declaration ] + ifFalse: [ "If the kind is different, we save a new declaration." + aFASTNode ensureLocalUses. + nameDictionary at: aName put: aFASTNode ] ] + ifAbsentPut: [ + aFASTNode + ensureLocalUses; + yourself ] +] + +{ #category : 'accessing' } +FASTPythonLRScope >> entity: anObject [ + entity := anObject +] + +{ #category : 'initialization' } +FASTPythonLRScope >> initialize [ + + super initialize. + nameDictionary := Dictionary new +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st new file mode 100644 index 0000000..8acae27 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -0,0 +1,184 @@ +" +I am a visitor used to link entities usages to their declaration. + +You can run me like this: + +```st +FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" +``` + +Once I ran, all entities will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. + +The declaration can be various things: +- First variable assignement +- Function definition +- Variable declared in a loop structure (like in the left side of a for each) +- An imported entity +... +" +Class { + #name : 'FASTPythonLocalResolverVisitor', + #superclass : 'FASTPythonVisitor', + #instVars : [ + 'scopes' + ], + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #package : 'FAST-Python-Tools', + #tag : 'CFG/LocalResolver/SSA' +} + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ + + | declaration | + declaration := (self declarationNamed: aName) ifNil: [ "If it is undeclared, we create an undeclared in the lowest scope in the stack." + scopes first ensureDeclarationOf: aName declaration: (FASTNonLocalDeclaration new + name: aName; + yourself) ]. + + aFASTNode localDeclaration: declaration. + declaration addLocalUse: aFASTNode +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> declarationNamed: aName [ + + scopes do: [ :scope | scope declarationNamed: aName ifPresent: [ :declaration | ^ declaration ] ]. + ^ nil +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName declaration: aFASTNode [ + + scopes top ensureDeclarationOf: aName declaration: aFASTNode. + self bind: anEntity toDeclarationNamed: aName +] + +{ #category : 'initialization' } +FASTPythonLocalResolverVisitor >> initialize [ + + super initialize. + scopes := Stack new +] + +{ #category : 'initialization' } +FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ + + scopes push: (FASTPythonLRScope for: aFASTBehaviouralEntity). + + "We fulsh the attributes in case this is not the fist resolution" + aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. + + aFASTBehaviouralEntity accept: self. + scopes pop. + self assert: scopes isEmpty +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ + + scopes push: aScope. + + [ aBlock value ] ensure: [ scopes pop ] +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ + "This should be improved later to check if we already encountered this accessed attribute and maybe this should go in the scopes?." + + | declaration | + declaration := FASTNonLocalDeclaration new + name: anAttribute name; + yourself. + + declaration clearLocalUses. + + anAttribute localDeclaration: declaration. + declaration addLocalUse: anAttribute. + + super visitFASTPyAttributeAccess: anAttribute +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ + "Reordering the visit of children to ensure for clauses are visited before the body and conditions since they can refer to it." + + "In Python 3, the comprehension has its own scope. In the future we should also manage python 2 that had no scope and could leek its variables." + + self useScope: (FASTPythonLRScope for: aComprehension) during: [ + self visitFASTPyTSplatExpression: aComprehension. + self visitFASTPyExpression: aComprehension. + + self visitCollection: aComprehension forClauses. + self visitCollection: aComprehension conditions. + self visitEntity: aComprehension body ] +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ + "Reorginizing the order" + + self visitEntity: aForStatement left. + self visitEntity: aForStatement right. + + self visitFASTPyTWithElseClause: aForStatement. + self visitFASTTStatementBlock: aForStatement. + self visitFASTPyStatement: aForStatement +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + + self ensureDeclarationOf: aFunctionDefinition named: aFunctionDefinition name declaration: aFunctionDefinition. + self + useScope: (FASTPythonLRScope for: aFunctionDefinition) + during: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." + self visitFASTTWithParameters: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition ] +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ + + anIdentifier isVariableWriteAccess ifTrue: [ + ^ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier "We cannot put the right node because of the tuples" ]. + + self bind: anIdentifier toDeclarationNamed: anIdentifier name +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ + + anImport importedEntities do: [ :entity | + entity hasAlias + ifTrue: [ self ensureDeclarationOf: entity named: entity alias declaration: anImport ] + ifFalse: [ + entity segments size = 1 + ifTrue: [ self ensureDeclarationOf: entity named: entity segments last declaration: anImport ] + ifFalse: [ self flag: #todo "I don't know yet how to manage this" ] ] ]. + + super visitFASTPyImport: anImport +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ + "We resolve in the same way as functions." + + self visitFASTPyFunctionDefinition: aMethodDefinition +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ + + self ensureDeclarationOf: aParameter named: aParameter name declaration: aParameter. + super visitFASTPyParameter: aParameter +] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st new file mode 100644 index 0000000..daaa090 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -0,0 +1,158 @@ +Class { + #name : 'FASTPythonSSAVisitor', + #superclass : 'FASTPythonVisitor', + #traits : 'FASTCFGTVisitor', + #classTraits : 'FASTCFGTVisitor classTrait', + #instVars : [ + 'variableVersions' + ], + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #package : 'FAST-Python-Tools', + #tag : 'CFG/LocalResolver/SSA' +} + +{ #category : 'resolving' } +FASTPythonSSAVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> createPhiVersionFor: localDeclaration versions: allVersions [ + "No need to add it to the versions since it was already added by the previous versions." + + | phiVersion | + phiVersion := FASTVariablePhiVersionSSA for: allVersions. + localDeclaration activeVersion: phiVersion. + ^ phiVersion +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ + + | newSSA | + newSSA := FASTVariableVersionSSA for: aFASTEntity. + aFASTEntity localDeclaration activeVersion ifNotNil: [ :lastSSA | newSSA version: lastSSA version ]. + + aFASTEntity localDeclaration activeVersion: newSSA. + + variableVersions add: aFASTEntity localDeclaration. + + ^ newSSA +] + +{ #category : 'accessing' } +FASTPythonSSAVisitor >> currentActiveVersions [ + + ^ variableVersions collect: #activeVersion +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ + + aFASTEntity ssaVersion: ((self createVariableVersionFor: aFASTEntity) + newVersionNumber; + yourself) +] + +{ #category : 'initialization' } +FASTPythonSSAVisitor >> initialize [ + + super initialize. + variableVersions := IdentitySet new +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap [ + + | declarationsToMerge | + declarationsToMerge := newVariablesMap values flatten collectAsSet: #localDeclaration. + + declarationsToMerge do: [ :localDeclaration | + | allVersions | + "First we collect all the versions to use to produce a new Phi version for the current local declaration. " + allVersions := Set new. + newVariablesMap valuesDo: [ :variables | + variables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. + + "If not all branches are creating a new version, we need to add the previous version also to the list of variables for the Phi variable. Note that it is possible it did not exist before." + allVersions size = newVariablesMap size ifFalse: [ + previousVariables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. + + self createPhiVersionFor: localDeclaration versions: allVersions ] +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ + + | cfg | + "First we do a local resolution so that each entity are linked to their local declaration" + FASTPythonLocalResolverVisitor resolve: aFASTBehaviouralEntity. + + "Then we build the CFG to know the different paths on the entity" + cfg := aFASTBehaviouralEntity cfg. + + "And lastly, I can build the SSA now that I have the CFG and Local declarations." + self visit: cfg +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ + + self flag: #todo. "Should be moved to the CFG visitor of FAST" + ^ aCFGBlockOrFASTEntity ifNotNil: [ aCFGBlockOrFASTEntity accept: self ] +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitCFGAbstractConditionalBlock: aBlock [ + + | previousVariables newVariablesMap firstCommonChild reacheableBlocksByBranch | + self visitCFGAbstractBlock: aBlock. + + reacheableBlocksByBranch := aBlock nextBlocks collect: [ :block | block withAllFollowingBlocks ]. + + firstCommonChild := self findClosestMergePointIn: reacheableBlocksByBranch for: aBlock. + + previousVariables := self currentActiveVersions. "We need to do this after visiting the statements that could produce new variables." + newVariablesMap := IdentityDictionary new. + + aBlock nextBlocks do: [ :block | + self visit: block. + newVariablesMap at: block put: (self currentActiveVersions difference: previousVariables) ]. + + self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + "Reordering for parameters to be visited before the statements in order to have all declarations" + + self visitFASTTWithParameters: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ + + anIdentifier isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anIdentifier ]. + + anIdentifier localDeclaration isNonLocalDeclaration ifFalse: [ anIdentifier ssaVersion: anIdentifier localDeclaration activeVersion ]. + + super visitFASTPyIdentifier: anIdentifier +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ + "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" + + aParameter isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: aParameter ]. + + super visitFASTPyParameter: aParameter +] diff --git a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index d77ae30..cdea4a5 100644 --- a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -619,21 +619,26 @@ FASTPythonTreeSitterVisitor >> visitGlobalStatement: aTSNode [ { #category : 'visiting' } FASTPythonTreeSitterVisitor >> visitIdentifier: aNode [ - (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: (self sourceCodeOf: aNode) ]. + | name | + name := self sourceCodeOf: aNode. + + (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: name ]. "If we are in a field `name` then we are probably in a definition of an entity and we set my content as a name." - self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: (self sourceCodeOf: aNode) ]. + self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: name ]. self isIdentifierAVariableInTheCurrentContext ifTrue: [ | variable | variable := self handleNode: aNode kind: FASTPyVariable. - variable name: (self sourceCodeOf: aNode). + variable name: name. ^ variable ]. "In case we are in an alias, we edit the property alias of the last imported entity" - aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: (self sourceCodeOf: aNode) ]. + aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: name ]. - ^ self handleNode: aNode + ^ (self handleNode: aNode) + name: name; + yourself ] { #category : 'visiting - skip' } diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st new file mode 100644 index 0000000..622a8a4 --- /dev/null +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -0,0 +1,14 @@ +Extension { #name : 'FASTTEntity' } + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> ensureLocalUses [ + + self attributeAt: #localUses ifAbsentPut: OrderedCollection new +] + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> resetLocalResolution [ + + self removeAttribute: #localDeclaration. + self removeAttribute: #localUses +] diff --git a/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st new file mode 100644 index 0000000..775889d --- /dev/null +++ b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st @@ -0,0 +1,17 @@ +" +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 : 'ManifestFASTPythonTools', + #superclass : 'PackageManifest', + #category : 'FAST-Python-Tools-Manifest', + #package : 'FAST-Python-Tools', + #tag : 'Manifest' +} + +{ #category : 'code-critics' } +ManifestFASTPythonTools class >> ruleInconsistentMethodClassificationRuleV1FalsePositive [ + + + ^ #(#(#(#RGClassDefinition #(#FASTPythonLocalResolverVisitor)) #'2026-07-30T14:41:37.271103+02:00') ) +] From edf51ed55dd782b741fd39f5c254681c3c4fb7e5 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 10:04:09 +0200 Subject: [PATCH 077/151] Make new test pass by using the new CFG visit logic --- .../FASTPythonSSAVisitor.class.st | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index daaa090..c485369 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -4,7 +4,8 @@ Class { #traits : 'FASTCFGTVisitor', #classTraits : 'FASTCFGTVisitor classTrait', #instVars : [ - 'variableVersions' + 'variableVersions', + 'newVariablesMap' ], #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', @@ -59,7 +60,34 @@ FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ FASTPythonSSAVisitor >> initialize [ super initialize. - variableVersions := IdentitySet new + variableVersions := IdentitySet new. + newVariablesMap := IdentityDictionary new +] + +{ #category : 'hooks' } +FASTPythonSSAVisitor >> postConditonalsBranchVisitOf: firstBranchBlock conditional: aConditionalBlock [ + "Once we visited a conditional branch, we save the current active versions for this branch." + + | mapForConditional | + mapForConditional := newVariablesMap at: aConditionalBlock. + mapForConditional at: firstBranchBlock put: (self currentActiveVersions difference: (mapForConditional at: aConditionalBlock)) +] + +{ #category : 'hooks' } +FASTPythonSSAVisitor >> postConditonalsBranchesVisitOf: aConditionalBlock [ + "Once we're done visiting a conditional block we can clean the map and to build the Phi variables." + + | mapForConditional | + mapForConditional := newVariablesMap at: aConditionalBlock. + self producePhiVersionBasedOnPreviousVariables: (mapForConditional at: aConditionalBlock) andNewVariableMap: mapForConditional. + newVariablesMap removeKey: aConditionalBlock +] + +{ #category : 'hooks' } +FASTPythonSSAVisitor >> preConditonalsBranchesVisitOf: aConditionalBlock [ + "When we start to visit the branches of a conditional, we start by creating an entri for this conditional in the new variables map and we save the actives versions present before visiting the childrem." + + newVariablesMap at: aConditionalBlock put: (IdentityDictionary with: aConditionalBlock -> self currentActiveVersions) ] { #category : 'visiting' } @@ -100,33 +128,6 @@ FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ self visit: cfg ] -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visit: aCFGBlockOrFASTEntity [ - - self flag: #todo. "Should be moved to the CFG visitor of FAST" - ^ aCFGBlockOrFASTEntity ifNotNil: [ aCFGBlockOrFASTEntity accept: self ] -] - -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitCFGAbstractConditionalBlock: aBlock [ - - | previousVariables newVariablesMap firstCommonChild reacheableBlocksByBranch | - self visitCFGAbstractBlock: aBlock. - - reacheableBlocksByBranch := aBlock nextBlocks collect: [ :block | block withAllFollowingBlocks ]. - - firstCommonChild := self findClosestMergePointIn: reacheableBlocksByBranch for: aBlock. - - previousVariables := self currentActiveVersions. "We need to do this after visiting the statements that could produce new variables." - newVariablesMap := IdentityDictionary new. - - aBlock nextBlocks do: [ :block | - self visit: block. - newVariablesMap at: block put: (self currentActiveVersions difference: previousVariables) ]. - - self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap -] - { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ "Reordering for parameters to be visited before the statements in order to have all declarations" From 62934f1b77b6bf9c233631b190eb84c0e20d3907 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 15:29:50 +0200 Subject: [PATCH 078/151] Improve the logic of phi versions to work when we do not reassign a variable in a conditional (it should not produce any new phi version) --- .../FASTPythonSSATest.class.st | 24 +++++++++++++++++++ .../FASTPythonSSAVisitor.class.st | 16 +++++++------ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index f55ecbf..747a87a 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -17,6 +17,30 @@ FASTPythonSSATest >> parseAndResolve: aString [ FASTPythonSSAVisitor resolve: model module ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + function1() +else: + function2() + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index c485369..9b429e0 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -70,16 +70,18 @@ FASTPythonSSAVisitor >> postConditonalsBranchVisitOf: firstBranchBlock condition | mapForConditional | mapForConditional := newVariablesMap at: aConditionalBlock. - mapForConditional at: firstBranchBlock put: (self currentActiveVersions difference: (mapForConditional at: aConditionalBlock)) + mapForConditional at: firstBranchBlock put: (self currentActiveVersions difference: (mapForConditional at: #previousVariables)) ] { #category : 'hooks' } FASTPythonSSAVisitor >> postConditonalsBranchesVisitOf: aConditionalBlock [ "Once we're done visiting a conditional block we can clean the map and to build the Phi variables." - | mapForConditional | + | mapForConditional previousVariables | mapForConditional := newVariablesMap at: aConditionalBlock. - self producePhiVersionBasedOnPreviousVariables: (mapForConditional at: aConditionalBlock) andNewVariableMap: mapForConditional. + previousVariables := mapForConditional at: #previousVariables. + mapForConditional removeKey: #previousVariables. + self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: mapForConditional. newVariablesMap removeKey: aConditionalBlock ] @@ -87,7 +89,7 @@ FASTPythonSSAVisitor >> postConditonalsBranchesVisitOf: aConditionalBlock [ FASTPythonSSAVisitor >> preConditonalsBranchesVisitOf: aConditionalBlock [ "When we start to visit the branches of a conditional, we start by creating an entri for this conditional in the new variables map and we save the actives versions present before visiting the childrem." - newVariablesMap at: aConditionalBlock put: (IdentityDictionary with: aConditionalBlock -> self currentActiveVersions) + newVariablesMap at: aConditionalBlock put: (IdentityDictionary with: #previousVariables -> self currentActiveVersions) ] { #category : 'visiting' } @@ -101,9 +103,9 @@ FASTPythonSSAVisitor >> producePhiVersionBasedOnPreviousVariables: previousVaria "First we collect all the versions to use to produce a new Phi version for the current local declaration. " allVersions := Set new. newVariablesMap valuesDo: [ :variables | - variables - detect: [ :variable | variable localDeclaration = localDeclaration ] - ifFound: [ :variable | allVersions add: variable ] ]. + variables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. "If not all branches are creating a new version, we need to add the previous version also to the list of variables for the Phi variable. Note that it is possible it did not exist before." allVersions size = newVariablesMap size ifFalse: [ From 7de81222ce1ac435c98460eff1b52089f99d8f05 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 15:35:36 +0200 Subject: [PATCH 079/151] Add some more tests on if and phi versions --- .../FASTPythonSSATest.class.st | 97 ++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 747a87a..bc914b9 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -41,6 +41,28 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage2 [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + function1() + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ @@ -177,13 +199,86 @@ if y < 2: ] { #category : 'tests - assignments' } -FASTPythonSSATest >> testReAssignementInIfAndUsage [ +FASTPythonSSATest >> testReAssignementInIfInBithBranchesAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 +else: + x = 5 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second elseClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInIfInThenAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInIfInThenAndUsage2 [ | assignedVar1 assignedVar2 usedVar | self parseAndResolve: 'x = 3 if y < 2: x = 4 +else: + function() print(x)'. From 3ca992d8461f451d46dc00d325cc08fc148ee16b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 15:42:02 +0200 Subject: [PATCH 080/151] Do not create a phi version if we have only one variable as a choice + fix a typo in a test name --- .../FASTPythonSSATest.class.st | 60 ++++++++++++------- .../FASTPythonSSAVisitor.class.st | 2 + 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index bc914b9..ef53fcb 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -17,6 +17,37 @@ FASTPythonSSATest >> parseAndResolve: aString [ FASTPythonSSAVisitor resolve: model module ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementInIfInBothBranchesAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: + x = 4 +else: + x = 5 + +print(x)'. + + assignedVar1 := model module statements first thenClause statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elseClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage [ @@ -199,7 +230,7 @@ if y < 2: ] { #category : 'tests - assignments' } -FASTPythonSSATest >> testReAssignementInIfInBithBranchesAndUsage [ +FASTPythonSSATest >> testReAssignementInIfInBothBranchesAndUsage [ | assignedVar1 assignedVar2 assignedVar3 usedVar | self parseAndResolve: 'x = 3 @@ -241,32 +272,21 @@ print(x)'. { #category : 'tests - assignments' } FASTPythonSSATest >> testReAssignementInIfInThenAndUsage [ - | assignedVar1 assignedVar2 usedVar | - self parseAndResolve: 'x = 3 - -if y < 2: + | assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: x = 4 print(x)'. - assignedVar1 := model module statements first left. - self assert: assignedVar1 ssaVersion version equals: 1. - self assert: assignedVar1 ssaName equals: 'x_1'. - self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. - self assert: assignedVar1 ssaVersion localUses size equals: 2. - - assignedVar2 := model module statements second thenClause statements first left. - self assert: assignedVar2 ssaVersion version equals: 2. - self assert: assignedVar2 ssaName equals: 'x_2'. + assignedVar2 := model module statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_1'. self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. - self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. self assert: assignedVar2 ssaVersion localUses size equals: 2. - usedVar := model module statements third arguments first. - self assert: usedVar ssaVersion isPhi. - self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { - assignedVar1 ssaVersion. - assignedVar2 ssaVersion } + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion ] { #category : 'tests - assignments' } diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 9b429e0..6ebf73c 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -23,6 +23,8 @@ FASTPythonSSAVisitor >> createPhiVersionFor: localDeclaration versions: allVersi "No need to add it to the versions since it was already added by the previous versions." | phiVersion | + allVersions size < 2 ifTrue: [ ^ self ]. "No need to create a phi version if we don't have at least 2 versions" + phiVersion := FASTVariablePhiVersionSSA for: allVersions. localDeclaration activeVersion: phiVersion. ^ phiVersion From 1eedf2eb5faf484b284e97eb22363ed8510e0792 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 15:52:13 +0200 Subject: [PATCH 081/151] Ensure multiple phi are working + add more tests --- .../FASTPythonSSATest.class.st | 119 ++++++++++++++++-- 1 file changed, 111 insertions(+), 8 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index ef53fcb..42fb908 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -48,6 +48,48 @@ print(x)'. assignedVar2 ssaVersion } ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementInIfInThenAndUsage [ + + | assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: + x = 4 + +print(x)'. + + assignedVar2 := model module statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementInIfInThenAndUsage2 [ + + | assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: + x = 4 +else: + function() + +print(x)'. + + assignedVar2 := model module statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage [ @@ -272,21 +314,32 @@ print(x)'. { #category : 'tests - assignments' } FASTPythonSSATest >> testReAssignementInIfInThenAndUsage [ - | assignedVar2 usedVar | - self parseAndResolve: 'if y < 2: + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: x = 4 print(x)'. - assignedVar2 := model module statements first thenClause statements first left. - self assert: assignedVar2 ssaVersion version equals: 1. - self assert: assignedVar2 ssaName equals: 'x_1'. + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. self assert: assignedVar2 ssaVersion localUses size equals: 2. - usedVar := model module statements second arguments first. - self deny: usedVar ssaVersion isPhi. - self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } ] { #category : 'tests - assignments' } @@ -322,6 +375,56 @@ print(x)'. assignedVar2 ssaVersion } ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + +print(x) + +if y > 2: + x = 5 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 3. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 3. + + usedVar1 := model module statements third arguments first. + self assert: usedVar1 ssaVersion isPhi. + self assertCollection: usedVar1 ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion }. + + assignedVar3 := model module statements fourth thenClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fifth arguments first. + self assert: usedVar2 ssaVersion isPhi. + self assertCollection: usedVar2 ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ From 5cb628a988036cd03fecae0daa008e8c8b4c5e26 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 16:04:25 +0200 Subject: [PATCH 082/151] Add tests on match statements --- .../FASTPythonSSATest.class.st | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 42fb908..678f339 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -375,6 +375,136 @@ print(x)'. assignedVar2 ssaVersion } ] +{ #category : 'tests - match' } +FASTPythonSSATest >> testReAssignementInMatchAllCasesThenAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 4 +match toto: + case 1: + x = 5 + case 2: + x = 8 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second cases first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second cases second statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - match' } +FASTPythonSSATest >> testReAssignementInMatchThenAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 4 +match toto: + case 1: + x = 5 + case 2: + x = 8 + case 3: + function1() + case 4: + function2() + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second cases first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second cases second statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - match' } +FASTPythonSSATest >> testReAssignementInMatchWithDefaultThenAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 4 +match toto: + case 1: + x = 5 + case 3: + function1() + case 4: + function2() + case _: + x = 8 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second cases first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second cases fourth statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage [ @@ -425,6 +555,73 @@ print(x)'. assignedVar3 ssaVersion } ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage2 [ + + | assignedVar1 assignedVar2 assignedVar3 assignedVar4 assignedVar5 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 +else: + x = 6 + +print(x) + +if y > 2: + x = 5 +else: + x = 7 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second elseClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements third arguments first. + self assert: usedVar1 ssaVersion isPhi. + self assertCollection: usedVar1 ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion }. + + assignedVar4 := model module statements fourth thenClause statements first left. + self assert: assignedVar4 ssaVersion version equals: 4. + self assert: assignedVar4 ssaName equals: 'x_4'. + self assert: assignedVar4 ssaVersion localDeclaration equals: assignedVar4 localDeclaration. + self assert: assignedVar4 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar4 ssaVersion localUses size equals: 2. + + assignedVar5 := model module statements fourth elseClause statements first left. + self assert: assignedVar5 ssaVersion version equals: 5. + self assert: assignedVar5 ssaName equals: 'x_5'. + self assert: assignedVar5 ssaVersion localDeclaration equals: assignedVar5 localDeclaration. + self assert: assignedVar5 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar5 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fifth arguments first. + self assert: usedVar2 ssaVersion isPhi. + self assertCollection: usedVar2 ssaVersion ssaVariables hasSameElements: { + assignedVar4 ssaVersion. + assignedVar5 ssaVersion } +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ From f814ae272aa950e24ab251a5dbd12cea9eaebc0f Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 16:38:43 +0200 Subject: [PATCH 083/151] SSA: Add tests on for each --- .../FASTPythonSSATest.class.st | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 678f339..2309ad3 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -192,6 +192,62 @@ FASTPythonSSATest >> testParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testReAssignedVariableInFor [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 2 +for y in range(5): + x = 5 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testReAssignedVariableWithForVariable [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 2 + +for x in range(5): + pass + +print(x)'. + + self skip. "There is a problem with the CFG making this test fail." + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testReAssignement [ From 53311e623d2b5dfcd9117b72752fc331e7b72a21 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 16:39:32 +0200 Subject: [PATCH 084/151] Fix bug in Python CFG In case of a for, the variable definition should not be in the conditional block. If the collection is empty, the variable will never be declared --- src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index e850dde..2f0a63b 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -151,15 +151,14 @@ FASTPythonCFGVisitor >> visitFASTPyFinallyClause: aFinallyClause [ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self buildBlockIfNeeded. - - self addStatement: aForStatement left. self addStatement: aForStatement right. self buildAndUseLoopDuring: [ + self addStatement: aForStatement left. "The variable does not go in the conditional block because if the collection is empty, we never assign the variable." self visitFASTTStatementBlock: aForStatement. "We add the loops after finishing the first statement block, so the else can be managed in this block to be in the right context." - self visitFASTPyTWithElseClause: aForStatement ] + self visitFASTPyTWithElseClause: aForStatement ] ] { #category : 'visiting - entry points' } From e57df044259a6b4da232a293d8b97c02964d2a85 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 5 Aug 2026 16:39:59 +0200 Subject: [PATCH 085/151] Simplify tests + start to fix some to match the new for handling (CFG) --- .../FASTPythonCFGTest.class.st | 236 +++++++++--------- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 79daaa7..400f38f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -130,8 +130,8 @@ FASTPythonCFGTest >> testFunctionWithConditionalExpression [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -163,17 +163,17 @@ FASTPythonCFGTest >> testFunctionWithFor [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 1. - self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). self assert: forBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. @@ -195,22 +195,22 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). forCondition := startBlock nextBlock. self assert: forCondition isConditional. self deny: forCondition isFinal. - self assert: forCondition statements size equals: 2. - self assert: (forCondition statements first class isOfType: FASTPyIdentifier). - self assert: (forCondition statements second class isOfType: FASTPyIdentifier). + self assert: forCondition statements size equals: 1. + self assert: (forCondition statements first isOfType: FASTPyIdentifier). self assert: forCondition nextBlocks size equals: 2. self assert: (forCondition nextBlocks select: #isNullBlock) size equals: 1. forBlock := forCondition nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 1. - self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). self assert: forBlock nextBlock equals: forCondition. nullBlock := forCondition nextFalseBlock. @@ -231,18 +231,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyBreakStatement). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyBreakStatement). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. @@ -266,8 +266,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -308,8 +308,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -357,8 +357,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -409,8 +409,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -467,8 +467,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -537,8 +537,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -606,8 +606,8 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -655,8 +655,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinue [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -689,8 +689,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -731,8 +731,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -780,8 +780,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -832,8 +832,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseCon self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -890,8 +890,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContin self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -960,8 +960,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndEls self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1029,8 +1029,8 @@ FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1079,8 +1079,8 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1119,8 +1119,8 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1164,8 +1164,8 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1204,8 +1204,8 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyIdentifier). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1282,7 +1282,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1348,7 +1348,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1414,8 +1414,8 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1444,8 +1444,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -1474,7 +1474,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1506,7 +1506,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1552,7 +1552,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1612,7 +1612,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1676,7 +1676,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1727,8 +1727,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1767,8 +1767,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1805,7 +1805,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1844,7 +1844,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -1852,8 +1852,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyComparisonOperator). thenBlock2 := thenBlock nextTrueBlock. self deny: thenBlock2 isConditional. @@ -1888,7 +1888,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -1896,8 +1896,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyComparisonOperator). thenBlock2 := thenBlock nextTrueBlock. self deny: thenBlock2 isConditional. @@ -1928,7 +1928,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1936,8 +1936,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyComparisonOperator). thenBlock2 := thenBlock nextTrueBlock. self deny: thenBlock2 isConditional. @@ -1979,8 +1979,8 @@ FASTPythonCFGTest >> testFunctionWithMatch [ self assert: startBlock isSwitch. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 3. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2035,8 +2035,8 @@ FASTPythonCFGTest >> testFunctionWithMatchWith2IdenticalCase [ self assert: startBlock isSwitch. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2083,8 +2083,8 @@ FASTPythonCFGTest >> testFunctionWithMatchWithCondition [ self assert: startBlock isSwitch. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 3. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2181,7 +2181,7 @@ FASTPythonCFGTest >> testFunctionWithTry [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2232,7 +2232,7 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2301,7 +2301,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithElse [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2379,7 +2379,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithElseAndFinally [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2455,7 +2455,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithFinally [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2514,7 +2514,7 @@ FASTPythonCFGTest >> testFunctionWithWhile [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2549,7 +2549,7 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2604,7 +2604,7 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2656,13 +2656,13 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). whileCondition := startBlock nextBlock. self assert: whileCondition isConditional. self deny: whileCondition isFinal. self assert: whileCondition statements size equals: 1. - self assert: (whileCondition statements first class isOfType: FASTPyComparisonOperator). + self assert: (whileCondition statements first isOfType: FASTPyComparisonOperator). self assert: whileCondition nextBlocks size equals: 2. self assert: (whileCondition nextBlocks select: #isNullBlock) size equals: 1. @@ -2693,7 +2693,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2726,7 +2726,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2767,7 +2767,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2815,7 +2815,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2866,7 +2866,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaki self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2923,7 +2923,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2992,7 +2992,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3060,7 +3060,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3108,7 +3108,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3141,7 +3141,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3182,7 +3182,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3230,7 +3230,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElse self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3281,7 +3281,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElseC self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3338,7 +3338,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifAndElseAllCont self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3407,7 +3407,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifContinuingAndE self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3475,7 +3475,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3524,7 +3524,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInAllBranches [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3563,7 +3563,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInIf [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3607,7 +3607,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithoutBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3646,7 +3646,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). From 2aa103ccebd77aa75d311411600041a683ad79f7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 10:24:40 +0200 Subject: [PATCH 086/151] Fix CFG tests after fixing a bug un for management --- .../FASTPythonCFGTest.class.st | 188 +++++++++--------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 400f38f..cb5c335 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -265,18 +265,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -307,18 +307,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -356,18 +356,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -408,18 +408,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -466,18 +466,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -536,18 +536,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -605,18 +605,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -654,18 +654,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinue [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyContinueStatement). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyContinueStatement). self assert: forBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. @@ -688,18 +688,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -730,18 +730,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -779,18 +779,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -831,18 +831,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseCon self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -889,18 +889,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContin self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -959,18 +959,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndEls self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -1028,18 +1028,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -1078,18 +1078,18 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyBreakStatement). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyBreakStatement). elseBlock := startBlock nextFalseBlock. self deny: elseBlock isNullBlock. @@ -1118,18 +1118,18 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). forBlock := startBlock nextTrueBlock. self assert: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyComparisonOperator). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyComparisonOperator). self assert: forBlock nextFalseBlock equals: startBlock. thenBlock := forBlock nextTrueBlock. @@ -1163,17 +1163,17 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 1. - self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). self assert: forBlock nextBlock equals: startBlock. elseBlock := startBlock nextFalseBlock. @@ -1203,18 +1203,18 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first isOfType: FASTPyIdentifier). - self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. From 6e1638bd5f5dea00f49df0df9e686060aba03b56 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 14:46:07 +0200 Subject: [PATCH 087/151] Unskip test that now passes --- src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st | 1 - 1 file changed, 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 2309ad3..cab69c4 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -230,7 +230,6 @@ for x in range(5): print(x)'. - self skip. "There is a problem with the CFG making this test fail." assignedVar1 := model module statements first left. self assert: assignedVar1 ssaVersion version equals: 1. self assert: assignedVar1 ssaName equals: 'x_1'. From 0137be62c70846c9e1fecf3353c9be6f2ebd0337 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 15:40:59 +0200 Subject: [PATCH 088/151] LR: Begin to manage attribute access --- .../FASTPythonLocalResolverTest.class.st | 21 ++++++++++++++++++ .../FASTPyAttributeAccess.extension.st | 22 +++++++++++++++++++ .../FASTPyIdentifier.extension.st | 4 +++- .../FASTPythonLocalResolverVisitor.class.st | 11 ++-------- 4 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 6509491..d570a28 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -359,6 +359,27 @@ print(glob)'. self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalAsAttributeUsageInCall [ + + | assignedVariable usedVariable | + self parseAndResolve: 'y.x = 5 + +print(y.x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ "Here we cannot know if the second printing is of a variable." diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st new file mode 100644 index 0000000..d920a23 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -0,0 +1,22 @@ +Extension { #name : 'FASTPyAttributeAccess' } + +{ #category : '*FAST-Python-Tools' } +FASTPyAttributeAccess >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment. + + I should be similar to the implementation of FASTPyIdentifier! We should check later to remove the duplication." + + | assignedNode | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + assignedNode := self. + [ assignedNode collectionInitializer isNotNil and: [ assignedNode collectionInitializer isTuple ] ] whileTrue: [ + assignedNode := assignedNode collectionInitializer ]. + + assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. + + assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st index e73ab50..bf9ed9b 100644 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -10,7 +10,9 @@ FASTPyIdentifier >> localResolverKind [ { #category : '*FAST-Python-Tools' } FASTPyIdentifier >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment." + "In the case I represent a write access to a variable, I return the node representing my assignment. + + I should be similar to the implementation of FASTPyAttributeAccess! We should check later to remove the duplication." | assignedNode | "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 8acae27..94428aa 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -93,16 +93,9 @@ FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ "This should be improved later to check if we already encountered this accessed attribute and maybe this should go in the scopes?." | declaration | - declaration := FASTNonLocalDeclaration new - name: anAttribute name; - yourself. + anAttribute isVariableWriteAccess ifTrue: [ ^ self ensureDeclarationOf: anAttribute named: anAttribute sourceCode declaration: anAttribute ]. - declaration clearLocalUses. - - anAttribute localDeclaration: declaration. - declaration addLocalUse: anAttribute. - - super visitFASTPyAttributeAccess: anAttribute + self bind: anAttribute toDeclarationNamed:anAttribute sourceCode ] { #category : 'visiting' } From 6669a2670f48dc3f699fdc939adae3cd106cab43 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 15:59:02 +0200 Subject: [PATCH 089/151] Simplify code by removing lines that cannot happen --- src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index d920a23..8efa0d0 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -14,9 +14,5 @@ FASTPyAttributeAccess >> variableDeclarator [ assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. - assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. - - assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. - ^ super variableDeclarator ] From 443a990d5e9c1d3125580394b6fba4989af3bfcd Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 16:07:27 +0200 Subject: [PATCH 090/151] Manage SSA write access to attributes (WIP) --- .../FASTPythonSSATest.class.st | 13 +++++++++++++ .../FASTPyAttributeAccess.extension.st | 6 ++++++ .../FASTPythonLocalResolverVisitor.class.st | 11 ++++++++--- src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st | 10 ++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index cab69c4..fd94a45 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -136,6 +136,19 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementOfAttribute [ + + | assignedVar | + self parseAndResolve: 'x.y = 5'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x.y_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index 8efa0d0..24d5626 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -1,5 +1,11 @@ Extension { #name : 'FASTPyAttributeAccess' } +{ #category : '*FAST-Python-Tools' } +FASTPyAttributeAccess >> localDeclarationName [ + + ^ self sourceCode +] + { #category : '*FAST-Python-Tools' } FASTPyAttributeAccess >> variableDeclarator [ "In the case I represent a write access to a variable, I return the node representing my assignment. diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 94428aa..ec36e60 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -90,12 +90,17 @@ FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ - "This should be improved later to check if we already encountered this accessed attribute and maybe this should go in the scopes?." + "This has one limit. + + x.y.z = 3 + v = x.y + print(v.z) + + Here v.z should be linked to the z variable but it will not. This case will not be managed for now but we might need it in the future." - | declaration | anAttribute isVariableWriteAccess ifTrue: [ ^ self ensureDeclarationOf: anAttribute named: anAttribute sourceCode declaration: anAttribute ]. - self bind: anAttribute toDeclarationNamed:anAttribute sourceCode + self bind: anAttribute toDeclarationNamed: anAttribute sourceCode ] { #category : 'visiting' } diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 6ebf73c..cdc066a 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -132,6 +132,16 @@ FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ self visit: cfg ] +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyAttributeAccess: anAttribute [ + + anAttribute isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anAttribute ] + + "anIdentifier localDeclaration isNonLocalDeclaration ifFalse: [ anIdentifier ssaVersion: anIdentifier localDeclaration activeVersion ]. + + super visitFASTPyIdentifier: anIdentifier" +] + { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ "Reordering for parameters to be visited before the statements in order to have all declarations" From cdadf148e4daf2bc596bdbedb609e8ab31ec418e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 16:18:39 +0200 Subject: [PATCH 091/151] Finish the local resolution of attribute accesses (I think?) --- .../FASTPythonLocalResolverTest.class.st | 10 +++++++--- .../FASTPythonLocalResolverVisitor.class.st | 13 ++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index d570a28..20802af 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -121,7 +121,7 @@ x.y'. self assert: receiver localDeclaration localUses second equals: receiver. value := model module statements second. - self assert: value localDeclaration name equals: 'y'. + self assert: value localDeclaration name equals: 'x.y'. self assert: value localDeclaration isNonLocalDeclaration. self assert: value localDeclaration localUses size equals: 1. self assert: value localDeclaration localUses first equals: value @@ -362,7 +362,7 @@ print(glob)'. { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testGlobalAsAttributeUsageInCall [ - | assignedVariable usedVariable | + | assignedVariable usedVariable attributeReceiver | self parseAndResolve: 'y.x = 5 print(y.x)'. @@ -377,7 +377,11 @@ print(y.x)'. usedVariable := model module statements second arguments first. self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + attributeReceiver := assignedVariable value. + self assert: attributeReceiver localDeclaration isNonLocalDeclaration. + self assert: attributeReceiver localDeclaration name equals: 'y' ] { #category : 'tests - shadowing' } diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index ec36e60..eca0dc5 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -98,9 +98,11 @@ FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ Here v.z should be linked to the z variable but it will not. This case will not be managed for now but we might need it in the future." - anAttribute isVariableWriteAccess ifTrue: [ ^ self ensureDeclarationOf: anAttribute named: anAttribute sourceCode declaration: anAttribute ]. + anAttribute isVariableWriteAccess + ifTrue: [ self ensureDeclarationOf: anAttribute named: anAttribute sourceCode declaration: anAttribute ] + ifFalse: [ self bind: anAttribute toDeclarationNamed: anAttribute sourceCode ]. - self bind: anAttribute toDeclarationNamed: anAttribute sourceCode + super visitFASTPyAttributeAccess: anAttribute ] { #category : 'visiting' } @@ -147,10 +149,11 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - anIdentifier isVariableWriteAccess ifTrue: [ - ^ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier "We cannot put the right node because of the tuples" ]. + anIdentifier isVariableWriteAccess + ifTrue: [ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier "We cannot put the right node because of the tuples" ] + ifFalse: [ self bind: anIdentifier toDeclarationNamed: anIdentifier name ]. - self bind: anIdentifier toDeclarationNamed: anIdentifier name + super visitFASTPyIdentifier: anIdentifier ] { #category : 'visiting' } From 5bb3d5b0ad3b44d7ea4e78b959b5c4feef178473 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 16:19:11 +0200 Subject: [PATCH 092/151] SSA: Manage read access of attribute accesses --- .../FASTPythonSSATest.class.st | 18 ++++++++++++++++++ .../FASTPythonSSAVisitor.class.st | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index fd94a45..a4df679 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -149,6 +149,24 @@ FASTPythonSSATest >> testAssignementOfAttribute [ self assert: assignedVar ssaVersion localUses size equals: 1 ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementOfAttributeAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x.y = 5 + +print(x.y)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x.y_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index cdc066a..d187369 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -135,11 +135,11 @@ FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyAttributeAccess: anAttribute [ - anAttribute isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anAttribute ] + anAttribute isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anAttribute ]. - "anIdentifier localDeclaration isNonLocalDeclaration ifFalse: [ anIdentifier ssaVersion: anIdentifier localDeclaration activeVersion ]. + anAttribute localDeclaration isNonLocalDeclaration ifFalse: [ anAttribute ssaVersion: anAttribute localDeclaration activeVersion ]. - super visitFASTPyIdentifier: anIdentifier" + super visitFASTPyAttributeAccess: anAttribute ] { #category : 'visiting' } From f77c8d37b9298afd8b2ce062af0dfbbceec2e77a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 17:14:22 +0200 Subject: [PATCH 093/151] CFG: fix bug in gandling of lambdas If they were inside a statement, they appears two times in the statements of the block --- .../FASTPythonCFGTest.class.st | 14 ++++++++++++++ .../FASTPythonCFGVisitor.class.st | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index cb5c335..b8be475 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -84,6 +84,20 @@ print(i)') allModules first. self assertEmpty: startBlock nextBlocks ] +{ #category : 'tests' } +FASTPythonCFGTest >> testContainingLambdas [ + "Regression test. The CFG was duplicating the lambda node until now." + + self buildCFGForFunction: 'def funct(): + l = lambda x: x + 2 + l(4)'. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assertEmpty: startBlock nextBlocks +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionInFunction [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 2f0a63b..599b8dc 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -184,7 +184,7 @@ FASTPythonCFGVisitor >> visitFASTPyLambda: aLambda [ started ifTrue: [ - self visitFASTTStatement: aLambda. + self visitFASTPyExpression: aLambda. cfgs ifNotNil: [ "In this case, we also need to build the CFG of node and store it" cfgs at: aLambda put: aLambda cfg ] ] ifFalse: [ started := true. From b6d5986703f4a82e5ad0ccba132720e86dc09aeb Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 17:14:54 +0200 Subject: [PATCH 094/151] SSA: Test lambda parameters --- .../FASTPythonSSATest.class.st | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index a4df679..4257282 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -208,7 +208,7 @@ FASTPythonSSATest >> testForVariablesInTupleUsed [ ] { #category : 'tests - parameters' } -FASTPythonSSATest >> testParameterUsed [ +FASTPythonSSATest >> testFunctionParameterUsed [ | parameterDeclaration parameterUsage | self parseAndResolve: 'def func(x): @@ -223,6 +223,23 @@ FASTPythonSSATest >> testParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testLambdaParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'l = lambda x: x + 2 + +l(4)'. + + parameterDeclaration := model module statements first right parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first right expression leftOperand. + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testReAssignedVariableInFor [ From 879b86acb32602288b09aaaf08929c46d285af2d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 17:49:11 +0200 Subject: [PATCH 095/151] Fix SSA for method parameters --- .../FASTPythonSSATest.class.st | 17 +++++++++++++++++ .../FASTPythonSSAVisitor.class.st | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 4257282..37250ff 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -240,6 +240,23 @@ l(4)'. self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testMethodParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'class C(): + def method(self): + return self'. + + parameterDeclaration := model module statements first statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'self_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first statements first expression. + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testReAssignedVariableInFor [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index d187369..937d5c4 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -163,6 +163,13 @@ FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ super visitFASTPyIdentifier: anIdentifier ] +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ + "We resolve in the same way as functions." + + self visitFASTPyFunctionDefinition: aMethodDefinition +] + { #category : 'visiting' } FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" From b00ab8feb500f3212d4c564e4a91883ce30c4fc8 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 19:43:59 +0200 Subject: [PATCH 096/151] =?UTF-8?q?LR:=E2=80=AFfix=20reassignment=20of=20p?= =?UTF-8?q?arameters=20in=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonLocalResolverTest.class.st | 25 +++++++++++++++++++ .../FASTPyParameter.extension.st | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 20802af..30e809f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -296,6 +296,31 @@ FASTPythonLocalResolverTest >> testFunctionParameter [ self assert: usedVariable equals: declaration localDeclaration localUses second ] +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameterRedefined [ + + | declaration declaration2 usedVariable | + self parseAndResolve: 'def funct(y): + y = 2 + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 3. + self assert: declaration localDeclaration localUses first equals: declaration. + + declaration2 := model module statements first statements first left. + self assert: declaration2 localDeclaration equals: declaration. + self assert: declaration localDeclaration localUses second equals: declaration2. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses third +] + { #category : 'tests - parameters' } FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st index 2ecef63..dd4443c 100644 --- a/src/FAST-Python-Tools/FASTPyParameter.extension.st +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -2,8 +2,9 @@ Extension { #name : 'FASTPyParameter' } { #category : '*FAST-Python-Tools' } FASTPyParameter >> localResolverKind [ + "It was parameter at first, but parameters can be assigned so they act as variables." - ^ #parameter + ^ #variable ] { #category : '*FAST-Python-Tools' } From e4dd94ec0118bdf746b212cfbce7b6adc3b39a72 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 6 Aug 2026 19:47:05 +0200 Subject: [PATCH 097/151] =?UTF-8?q?SSA:=E2=80=AFAdd=20visit=20of=20the=20C?= =?UTF-8?q?FG=20in=20definitions=20+=20fix=20a=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonLocalResolverTest.class.st | 15 ++++------ .../FASTPythonSSATest.class.st | 29 +++++++++++++++++++ .../FASTPythonSSAVisitor.class.st | 14 +++++++++ 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 30e809f..1f21cc2 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -957,7 +957,7 @@ FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ self assert: parameter localDeclaration equals: parameter. self assert: parameter localDeclaration name equals: 'param'. self deny: parameter localDeclaration isNonLocalDeclaration. - self assert: parameter localDeclaration localUses size equals: 2. + self assert: parameter localDeclaration localUses size equals: 4. self assert: parameter localDeclaration localUses first equals: parameter. usedParameter := model module statements first statements first arguments first. @@ -965,17 +965,12 @@ FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ self assert: usedParameter equals: parameter localDeclaration localUses second. assignedVariable := model module statements first statements second left. - self assert: assignedVariable localDeclaration equals: assignedVariable. - self assert: assignedVariable localDeclaration name equals: 'param'. - self assert: assignedVariable localDeclaration isVariableWriteAccess. - self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements second. - self deny: assignedVariable localDeclaration isNonLocalDeclaration. - self assert: assignedVariable localDeclaration localUses size equals: 2. - self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + self assert: assignedVariable localDeclaration equals: parameter. + self assert: assignedVariable localDeclaration localUses third equals: assignedVariable. usedVariable := model module statements first statements third arguments first. - self assert: usedVariable localDeclaration equals: assignedVariable. - self assert: usedVariable equals: assignedVariable localDeclaration localUses second + self assert: usedVariable localDeclaration equals: parameter. + self assert: usedVariable equals: assignedVariable localDeclaration localUses fourth ] { #category : 'tests' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 37250ff..d0a6909 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -207,6 +207,35 @@ FASTPythonSSATest >> testForVariablesInTupleUsed [ self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion ] +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionParameterModified [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(x): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] + { #category : 'tests - parameters' } FASTPythonSSATest >> testFunctionParameterUsed [ diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 937d5c4..fbe07dc 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -178,3 +178,17 @@ FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ super visitFASTPyParameter: aParameter ] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyTDefinition: aTDefinition [ + "We need to redo the CFG for definitions" + + | cfg | + self visitFASTTNamedEntity: aTDefinition. + self visitCollection: aTDefinition decorators. + + cfg := aTDefinition cfg. + self visit: cfg + +" super visitFASTPyTDefinition: aTDefinition" +] From 39554ece7338add7fae53d1d983178c3f71f7d09 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 10:24:29 +0200 Subject: [PATCH 098/151] Manage subscripts in LR (only if the indexes are exactly the same source code) --- .../FASTPythonLocalResolverTest.class.st | 21 +++++++++++++++++++ .../FASTPyAttributeAccess.extension.st | 10 ++------- .../FASTPyEntity.extension.st | 14 +++++++++++++ .../FASTPyIdentifier.extension.st | 7 ++----- .../FASTPySubscript.extension.st | 11 ++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 10 +++++++++ .../FASTPythonSSAVisitor.class.st | 2 -- 7 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPySubscript.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 1f21cc2..764c48d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -973,6 +973,27 @@ FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ self assert: usedVariable equals: assignedVariable localDeclaration localUses fourth ] +{ #category : 'tests - subscripts' } +FASTPythonLocalResolverTest >> testSubscriptUsageInCall [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x[3] = 1 +print(x[3])'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration value name equals: 'x'. + self assert: assignedVariable localDeclaration indices first sourceCode equals: '3'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index 24d5626..d482673 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -8,17 +8,11 @@ FASTPyAttributeAccess >> localDeclarationName [ { #category : '*FAST-Python-Tools' } FASTPyAttributeAccess >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment. - - I should be similar to the implementation of FASTPyIdentifier! We should check later to remove the duplication." + "In the case I represent a write access to a variable, I return the node representing my assignment." - | assignedNode | "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - assignedNode := self. - [ assignedNode collectionInitializer isNotNil and: [ assignedNode collectionInitializer isTuple ] ] whileTrue: [ - assignedNode := assignedNode collectionInitializer ]. - assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + self selfOrTopmostTupleContainer parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. ^ super variableDeclarator ] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 82b79af..0b5da55 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -28,6 +28,20 @@ FASTPyEntity >> localResolverKind [ ^ self error: 'This entity cannot be a local declaration or is missing the overriding method.' ] +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> selfOrTopmostTupleContainer [ + "If I am in a tuple, I return the tuple (this applies recursively, if I am in a tuple in a tuple I return the topmost tuple). + + Else, return myself." + + | node | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + node := self. + [ node collectionInitializer isNotNil and: [ node collectionInitializer isTuple ] ] whileTrue: [ node := node collectionInitializer ]. + + ^ node +] + { #category : '*FAST-Python-Tools' } FASTPyEntity >> variableDeclarator [ "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st index bf9ed9b..5d39a58 100644 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -10,14 +10,11 @@ FASTPyIdentifier >> localResolverKind [ { #category : '*FAST-Python-Tools' } FASTPyIdentifier >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment. - - I should be similar to the implementation of FASTPyAttributeAccess! We should check later to remove the duplication." + "In the case I represent a write access to a variable, I return the node representing my assignment." | assignedNode | "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - assignedNode := self. - [ assignedNode collectionInitializer isNotNil and: [ assignedNode collectionInitializer isTuple ] ] whileTrue: [ assignedNode := assignedNode collectionInitializer ]. + assignedNode := self selfOrTopmostTupleContainer. assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. diff --git a/src/FAST-Python-Tools/FASTPySubscript.extension.st b/src/FAST-Python-Tools/FASTPySubscript.extension.st new file mode 100644 index 0000000..b52390e --- /dev/null +++ b/src/FAST-Python-Tools/FASTPySubscript.extension.st @@ -0,0 +1,11 @@ +Extension { #name : 'FASTPySubscript' } + +{ #category : '*FAST-Python-Tools' } +FASTPySubscript >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + self selfOrTopmostTupleContainer parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index eca0dc5..2235f7c 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -183,3 +183,13 @@ FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ self ensureDeclarationOf: aParameter named: aParameter name declaration: aParameter. super visitFASTPyParameter: aParameter ] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPySubscript: aSubscript [ + + aSubscript isVariableWriteAccess + ifTrue: [ self ensureDeclarationOf: aSubscript named: aSubscript sourceCode declaration: aSubscript ] + ifFalse: [ self bind: aSubscript toDeclarationNamed: aSubscript sourceCode ]. + + super visitFASTPySubscript: aSubscript +] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index fbe07dc..49c5e58 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -189,6 +189,4 @@ FASTPythonSSAVisitor >> visitFASTPyTDefinition: aTDefinition [ cfg := aTDefinition cfg. self visit: cfg - -" super visitFASTPyTDefinition: aTDefinition" ] From 7fc901bdf45e3e7596c9fef6a641ebfe0e72410f Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 15:56:49 +0200 Subject: [PATCH 099/151] Simplify visitors by adding TCanBeVariable This makes SSA work for subscripts out of the box (I still need to add tests) --- .../FASTPythonMetamodelGenerator.class.st | 9 +++- .../FASTPyAttributeAccess.class.st | 4 +- .../FASTPyIdentifier.class.st | 4 +- .../FASTPyParameter.class.st | 4 +- .../FASTPySubscript.class.st | 4 +- .../FASTPyTCanBeVariable.trait.st | 19 +++++++ src/FAST-Python-Model/FASTPyTVisitor.trait.st | 11 ++++ .../FASTPythonSSATest.class.st | 15 ++++++ .../FASTPySubscript.extension.st | 6 +++ .../FASTPythonLocalResolverVisitor.class.st | 53 +++++-------------- .../FASTPythonSSAVisitor.class.st | 33 +++--------- 11 files changed, 88 insertions(+), 74 deletions(-) create mode 100644 src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index c8de6d7..b8f0824 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -157,7 +157,8 @@ Class { 'tAwaitable', 'tExecutable', 'tBreakStatement', - 'tContinueStatement' + 'tContinueStatement', + 'tCanBeVariable' ], #category : 'FAST-Python-Model-Generator', #package : 'FAST-Python-Model-Generator' @@ -373,6 +374,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ attribute --|> tAsPatternTarget. attribute --|> tSplatParameterTarget. attribute --|> tNamedEntity. + attribute --|> tCanBeVariable. augmentedAssignment --|> assignment. @@ -489,6 +491,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ identifier --|> tAsPatternTarget. identifier --|> tSplatParameterTarget. identifier --|> tNamedEntity. + identifier --|> tCanBeVariable. ifClause --|> expression. "This is wrong! I am just here temporarily until we rework the relation to the for in clause (I need to be able to be a clause of a list comprehension)" @@ -555,6 +558,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ pair --|> expression. parameter --|> tVariableEntity. + parameter --|> tCanBeVariable. passStatement --|> statement. @@ -592,6 +596,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ subscript --|> expression. subscript --|> tReturnReferenceable. subscript --|> tAsPatternTarget. + subscript --|> tCanBeVariable. tAsPatternTarget --|> tAsPatternSource. @@ -866,6 +871,8 @@ FASTPythonMetamodelGenerator >> defineTraits [ tCallable := (builder newTraitNamed: #TCallable) comment: 'I represent something that can be the receiver of a call'. + tCanBeVariable := (builder newTraitNamed: #TCanBeVariable) comment: 'Represent everything that can be a variable. Used for the LocalResolver and the SSA builder. Maybe I should be merged with TAssignable?'. + tClassPatternElement := (builder newTraitNamed: #TClassPatternElement) comment: 'I represent the elements of a class pattern in python pattern matcher. The first element is the class name, the others the arguments.'. tDecoratorExpression := (builder newTraitNamed: #TDecoratorExpression) comment: 'I represent an entity that *can* be the expression of a decorator.'. diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index b00b6a1..2ab7b18 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -40,8 +40,8 @@ I represent an access to an attribute such as `module.globalVariable`. Class { #name : 'FASTPyAttributeAccess', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTCanBeVariable + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTCanBeVariable classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', #instVars : [ '#value => FMOne type: #FASTPyExpression opposite: #parentAttributeObject' ], diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 17ff4de..f781f62 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -33,8 +33,8 @@ Class { #name : 'FASTPyIdentifier', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTCanBeVariable + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTCanBeVariable classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' diff --git a/src/FAST-Python-Model/FASTPyParameter.class.st b/src/FAST-Python-Model/FASTPyParameter.class.st index 1560e7f..bef1555 100644 --- a/src/FAST-Python-Model/FASTPyParameter.class.st +++ b/src/FAST-Python-Model/FASTPyParameter.class.st @@ -29,8 +29,8 @@ Class { #name : 'FASTPyParameter', #superclass : 'FASTPyEntity', - #traits : 'FASTTVariableEntity', - #classTraits : 'FASTTVariableEntity classTrait', + #traits : 'FASTPyTCanBeVariable + FASTTVariableEntity', + #classTraits : 'FASTPyTCanBeVariable classTrait + FASTTVariableEntity classTrait', #instVars : [ '#defaultValue => FMOne type: #FASTPyExpression opposite: #parentDefaultParameterValue', '#type => FMOne type: #FASTPyType opposite: #parentParameter' diff --git a/src/FAST-Python-Model/FASTPySubscript.class.st b/src/FAST-Python-Model/FASTPySubscript.class.st index 690b271..b4c4cfa 100644 --- a/src/FAST-Python-Model/FASTPySubscript.class.st +++ b/src/FAST-Python-Model/FASTPySubscript.class.st @@ -29,8 +29,8 @@ Class { #name : 'FASTPySubscript', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTCanBeVariable + FASTPyTReturnReferenceable', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTCanBeVariable classTrait + FASTPyTReturnReferenceable classTrait', #instVars : [ '#indices => FMMany type: #FASTPyTSliceIndex opposite: #parentSubscriptIndex', '#value => FMOne type: #FASTPyExpression opposite: #parentSubscriptValue' diff --git a/src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st b/src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st new file mode 100644 index 0000000..ceb58fd --- /dev/null +++ b/src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st @@ -0,0 +1,19 @@ +" +Represent everything that can be a variable. Used for the LocalResolver and the SSA builder. Maybe I should be merged with TAssignable? + + +" +Trait { + #name : 'FASTPyTCanBeVariable', + #category : 'FAST-Python-Model-Traits', + #package : 'FAST-Python-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTPyTCanBeVariable classSide >> annotation [ + + + + +] diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 12d25dc..d1f6f4f 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -69,6 +69,7 @@ FASTPyTVisitor >> visitFASTPyAttributeAccess: anAttributeAccess [ self visitFASTPyTAsPatternTarget: anAttributeAccess. + self visitFASTPyTCanBeVariable: anAttributeAccess. self visitFASTPyTReturnReferenceable: anAttributeAccess. self visitFASTPyTSplatParameterTarget: anAttributeAccess. self visitFASTTNamedEntity: anAttributeAccess. @@ -489,6 +490,7 @@ FASTPyTVisitor >> visitFASTPyIdentifier: anIdentifier [ self visitFASTPyTAsPatternTarget: anIdentifier. + self visitFASTPyTCanBeVariable: anIdentifier. self visitFASTPyTReturnReferenceable: anIdentifier. self visitFASTPyTSplatParameterTarget: anIdentifier. self visitFASTTNamedEntity: anIdentifier. @@ -717,6 +719,7 @@ FASTPyTVisitor >> visitFASTPyPair: aPair [ FASTPyTVisitor >> visitFASTPyParameter: aParameter [ + self visitFASTPyTCanBeVariable: aParameter. self visitFASTTVariableEntity: aParameter. self visitEntity: aParameter type. @@ -846,6 +849,7 @@ FASTPyTVisitor >> visitFASTPySubscript: aSubscript [ self visitFASTPyTAsPatternTarget: aSubscript. + self visitFASTPyTCanBeVariable: aSubscript. self visitFASTPyTReturnReferenceable: aSubscript. self visitFASTPyExpression: aSubscript. @@ -890,6 +894,13 @@ FASTPyTVisitor >> visitFASTPyTCallable: aTCallable [ ] +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ + + + +] + { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTClassPatternElement: aTClassPatternElement [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index d0a6909..862ff29 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -804,6 +804,21 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - subscripts' } +FASTPythonSSATest >> testSubscriptAssignement [ + + | assignedVar | + self parseAndResolve: 'x[3] = 5'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x[3]_1'. + + self assert: assignedVar localDeclaration newVersionNumber equals: 2. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testTupleAssignement [ diff --git a/src/FAST-Python-Tools/FASTPySubscript.extension.st b/src/FAST-Python-Tools/FASTPySubscript.extension.st index b52390e..99257e8 100644 --- a/src/FAST-Python-Tools/FASTPySubscript.extension.st +++ b/src/FAST-Python-Tools/FASTPySubscript.extension.st @@ -1,5 +1,11 @@ Extension { #name : 'FASTPySubscript' } +{ #category : '*FAST-Python-Tools' } +FASTPySubscript >> localDeclarationName [ + + ^ self sourceCode +] + { #category : '*FAST-Python-Tools' } FASTPySubscript >> variableDeclarator [ "In the case I represent a write access to a variable, I return the node representing my assignment." diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 2235f7c..6c0e6ec 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -88,23 +88,6 @@ FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ [ aBlock value ] ensure: [ scopes pop ] ] -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyAttributeAccess: anAttribute [ - "This has one limit. - - x.y.z = 3 - v = x.y - print(v.z) - - Here v.z should be linked to the z variable but it will not. This case will not be managed for now but we might need it in the future." - - anAttribute isVariableWriteAccess - ifTrue: [ self ensureDeclarationOf: anAttribute named: anAttribute sourceCode declaration: anAttribute ] - ifFalse: [ self bind: anAttribute toDeclarationNamed: anAttribute sourceCode ]. - - super visitFASTPyAttributeAccess: anAttribute -] - { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ "Reordering the visit of children to ensure for clauses are visited before the body and conditions since they can refer to it." @@ -146,16 +129,6 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini self visitFASTPyTDefinition: aFunctionDefinition ] ] -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyIdentifier: anIdentifier [ - - anIdentifier isVariableWriteAccess - ifTrue: [ self ensureDeclarationOf: anIdentifier named: anIdentifier name declaration: anIdentifier "We cannot put the right node because of the tuples" ] - ifFalse: [ self bind: anIdentifier toDeclarationNamed: anIdentifier name ]. - - super visitFASTPyIdentifier: anIdentifier -] - { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ @@ -178,18 +151,20 @@ FASTPythonLocalResolverVisitor >> visitFASTPyMethodDefinition: aMethodDefinition ] { #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPyParameter: aParameter [ - - self ensureDeclarationOf: aParameter named: aParameter name declaration: aParameter. - super visitFASTPyParameter: aParameter -] - -{ #category : 'visiting' } -FASTPythonLocalResolverVisitor >> visitFASTPySubscript: aSubscript [ +FASTPythonLocalResolverVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ + "This has some limits. For example, + + x.y.z = 3 + v = x.y + print(v.z) + + Here v.z should be linked to the z variable but it will not. This case will not be managed for now but we might need it in the future. + + Or also subscripts are linked if their source code is identical only." - aSubscript isVariableWriteAccess - ifTrue: [ self ensureDeclarationOf: aSubscript named: aSubscript sourceCode declaration: aSubscript ] - ifFalse: [ self bind: aSubscript toDeclarationNamed: aSubscript sourceCode ]. + aTCanBeVariable isVariableWriteAccess + ifTrue: [ self ensureDeclarationOf: aTCanBeVariable named: aTCanBeVariable localDeclarationName declaration: aTCanBeVariable ] + ifFalse: [ self bind: aTCanBeVariable toDeclarationNamed: aTCanBeVariable localDeclarationName ]. - super visitFASTPySubscript: aSubscript + super visitFASTPyTCanBeVariable: aTCanBeVariable ] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 49c5e58..a86ec73 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -132,17 +132,7 @@ FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ self visit: cfg ] -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitFASTPyAttributeAccess: anAttribute [ - - anAttribute isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anAttribute ]. - - anAttribute localDeclaration isNonLocalDeclaration ifFalse: [ anAttribute ssaVersion: anAttribute localDeclaration activeVersion ]. - - super visitFASTPyAttributeAccess: anAttribute -] - -{ #category : 'visiting' } +{ #category : 'visiting - reordering' } FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ "Reordering for parameters to be visited before the statements in order to have all declarations" @@ -153,17 +143,7 @@ FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ self visitFASTPyStatement: aFunctionDefinition ] -{ #category : 'visiting' } -FASTPythonSSAVisitor >> visitFASTPyIdentifier: anIdentifier [ - - anIdentifier isVariableWriteAccess ifTrue: [ ^ self handleNewAssignemntTo: anIdentifier ]. - - anIdentifier localDeclaration isNonLocalDeclaration ifFalse: [ anIdentifier ssaVersion: anIdentifier localDeclaration activeVersion ]. - - super visitFASTPyIdentifier: anIdentifier -] - -{ #category : 'visiting' } +{ #category : 'visiting - reordering' } FASTPythonSSAVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ "We resolve in the same way as functions." @@ -171,12 +151,13 @@ FASTPythonSSAVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ ] { #category : 'visiting' } -FASTPythonSSAVisitor >> visitFASTPyParameter: aParameter [ - "Contrary to the visit of py identifier, we should always have a local declaration for a parameter. If it is nil, there is a bug in the local resolver" +FASTPythonSSAVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ - aParameter isVariableWriteAccess ifTrue: [ self handleNewAssignemntTo: aParameter ]. + aTCanBeVariable isVariableWriteAccess + ifTrue: [ self handleNewAssignemntTo: aTCanBeVariable ] + ifFalse: [ aTCanBeVariable localDeclaration isNonLocalDeclaration ifFalse: [ aTCanBeVariable ssaVersion: aTCanBeVariable localDeclaration activeVersion ] ]. - super visitFASTPyParameter: aParameter + super visitFASTPyTCanBeVariable: aTCanBeVariable ] { #category : 'visiting' } From eefe218b86c4290c1247d55a55ec6993481f4426 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 17:14:32 +0200 Subject: [PATCH 100/151] SSA: test subscript access and reference in default value of parameters --- .../FASTPythonSSATest.class.st | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 862ff29..cd9af47 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -252,6 +252,25 @@ FASTPythonSSATest >> testFunctionParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests' } +FASTPythonSSATest >> testGlobalReferencedInDefaultParameter [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 5 + +def function(arg = x): + return arg'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second parameters first defaultValue. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - parameters' } FASTPythonSSATest >> testLambdaParameterUsed [ @@ -819,6 +838,24 @@ FASTPythonSSATest >> testSubscriptAssignement [ self assert: assignedVar ssaVersion localUses size equals: 1 ] +{ #category : 'tests - subscripts' } +FASTPythonSSATest >> testSubscriptAssignementAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x[3] = 5 + +print(x[3])'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x[3]_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testTupleAssignement [ From dcb9281acd34bd089c92ed02cbf9b44e5115a80a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 17:42:07 +0200 Subject: [PATCH 101/151] SSA: Ensure separators are in the parameters --- .../FASTPythonSSATest.class.st | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index cd9af47..63fd444 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -899,3 +899,32 @@ FASTPythonSSATest >> testUndeclaredVariable [ undeclared := model module statements first arguments first. self assert: undeclared ssaVersion isNil ] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testWithSeparators [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(*, /, x): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters third. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] From c6b296326f80794ef860d717c00a097c63fb3a12 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 17:50:18 +0200 Subject: [PATCH 102/151] SSA: Ensure typed parameters are working --- .../FASTPythonSSATest.class.st | 87 ++++++++++++------- 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 63fd444..2aec6c0 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -252,6 +252,64 @@ FASTPythonSSATest >> testFunctionParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithSeparatorsParameters [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(*, /, x): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters third. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithTypedParameters [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(x: Index): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] + { #category : 'tests' } FASTPythonSSATest >> testGlobalReferencedInDefaultParameter [ @@ -899,32 +957,3 @@ FASTPythonSSATest >> testUndeclaredVariable [ undeclared := model module statements first arguments first. self assert: undeclared ssaVersion isNil ] - -{ #category : 'tests - parameters' } -FASTPythonSSATest >> testWithSeparators [ - - | parameterDeclaration assignedVar parameterUsage | - self parseAndResolve: 'def func(*, /, x): - if a: - x = 2 - - print(x)'. - - parameterDeclaration := model module statements first parameters third. - self assert: parameterDeclaration ssaVersion version equals: 1. - self assert: parameterDeclaration ssaName equals: 'x_1'. - self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. - self assert: parameterDeclaration ssaVersion localUses size equals: 2. - - assignedVar := model module statements first statements first thenClause statements first left. - self assert: assignedVar ssaVersion version equals: 2. - self assert: assignedVar ssaName equals: 'x_2'. - self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. - self assert: assignedVar ssaVersion localUses size equals: 2. - - parameterUsage := model module statements first statements second arguments first. - self assert: parameterUsage ssaVersion isPhi. - self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { - parameterDeclaration ssaVersion. - assignedVar ssaVersion } -] From e43172dfb7576415855ea8024ff406e6d00ce57e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 17:57:41 +0200 Subject: [PATCH 103/151] SSA: Manage splat parameters (*args or **kwargs as function parameters) --- .../FASTPythonMetamodelGenerator.class.st | 3 +- .../FASTPySplatParameter.class.st | 2 ++ .../FASTPythonSSATest.class.st | 36 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index b8f0824..845b6a6 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -326,7 +326,8 @@ FASTPythonMetamodelGenerator >> defineClasses [ slice := builder newClassNamed: #Slice. (splat := builder newClassNamed: #Splat) comment: 'In Python a collection (list or dictionary) splat is the unpacking of a collection in a call or in the definition of another definition like `[ *list , 4 ]` or `func(*list)`'. - splatParameter := builder newClassNamed: #SplatParameter. + (splatParameter := builder newClassNamed: #SplatParameter) comment: + 'A splat parameter is a parameter that is a list slpat such as *args or a dictionary splat such as **kwargs.'. splatType := builder newClassNamed: #SplatType. statement := builder newAbstractClassNamed: #Statement. string := builder newClassNamed: #String. diff --git a/src/FAST-Python-Model/FASTPySplatParameter.class.st b/src/FAST-Python-Model/FASTPySplatParameter.class.st index 24cd9d4..a21eac2 100644 --- a/src/FAST-Python-Model/FASTPySplatParameter.class.st +++ b/src/FAST-Python-Model/FASTPySplatParameter.class.st @@ -1,4 +1,6 @@ " +A splat parameter is a parameter that is a list slpat such as *args or a dictionary splat such as **kwargs. + ## Relations ====================== diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 2aec6c0..cf5ae5a 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -252,6 +252,42 @@ FASTPythonSSATest >> testFunctionParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithDictionarySplatParameter [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def sample(**kwargs): + print(kwargs)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'kwargs_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first arguments first. + self deny: parameterUsage ssaVersion isPhi. + self assert: parameterUsage ssaVersion equals: parameterDeclaration ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithListSplatParameter [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def sample(*args): + print(args)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'args_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first arguments first. + self deny: parameterUsage ssaVersion isPhi. + self assert: parameterUsage ssaVersion equals: parameterDeclaration ssaVersion +] + { #category : 'tests - parameters' } FASTPythonSSATest >> testFunctionWithSeparatorsParameters [ From 9c73a2e8d9c78836c5c20834a51a26534e111ee6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 19:22:24 +0200 Subject: [PATCH 104/151] SSA: Ensure phi version only gets last version of the branch --- .../FASTPythonSSATest.class.st | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index cf5ae5a..37eb344 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -607,13 +607,12 @@ print(x)'. { #category : 'tests - assignments' } FASTPythonSSATest >> testReAssignementInIfInThenAndUsage2 [ - | assignedVar1 assignedVar2 usedVar | + | assignedVar1 assignedVar2 assignedVar3 usedVar | self parseAndResolve: 'x = 3 if y < 2: x = 4 -else: - function() + x = 6 print(x)'. @@ -628,13 +627,20 @@ print(x)'. self assert: assignedVar2 ssaName equals: 'x_2'. self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. - self assert: assignedVar2 ssaVersion localUses size equals: 2. + self assert: assignedVar2 ssaVersion localUses size equals: 1. + + assignedVar3 := model module statements second thenClause statements second left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. usedVar := model module statements third arguments first. self assert: usedVar ssaVersion isPhi. self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { assignedVar1 ssaVersion. - assignedVar2 ssaVersion } + assignedVar3 ssaVersion } ] { #category : 'tests - match' } From 2cc4ef604ed62ac1933e595c1c4fe9852d3b8357 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 19:33:53 +0200 Subject: [PATCH 105/151] =?UTF-8?q?LR:=E2=80=AFSimplify=20the=20code=20by?= =?UTF-8?q?=20inlining=20the=20scopes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonLRScope.class.st | 57 --------------- .../FASTPythonLocalResolverVisitor.class.st | 73 ++++++++++++------- 2 files changed, 47 insertions(+), 83 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTPythonLRScope.class.st diff --git a/src/FAST-Python-Tools/FASTPythonLRScope.class.st b/src/FAST-Python-Tools/FASTPythonLRScope.class.st deleted file mode 100644 index 72628a6..0000000 --- a/src/FAST-Python-Tools/FASTPythonLRScope.class.st +++ /dev/null @@ -1,57 +0,0 @@ -Class { - #name : 'FASTPythonLRScope', - #superclass : 'Object', - #instVars : [ - 'entity', - 'nameDictionary' - ], - #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', - #package : 'FAST-Python-Tools', - #tag : 'CFG/LocalResolver/SSA' -} - -{ #category : 'instance creation' } -FASTPythonLRScope class >> for: anEntity [ - - ^ self new - entity: anEntity; - yourself -] - -{ #category : 'actions' } -FASTPythonLRScope >> declarationNamed: aVariableName ifPresent: aBlock [ - - ^ nameDictionary at: aVariableName ifPresent: aBlock -] - -{ #category : 'actions' } -FASTPythonLRScope >> ensureDeclarationOf: aName declaration: aFASTNode [ - "If it is already present we do nothing. Else we create the local declaration. - - I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." - - ^ nameDictionary - at: aName - ifPresent: [ :declaration | - declaration localResolverKind = aFASTNode localResolverKind - ifTrue: [ ^ declaration ] - ifFalse: [ "If the kind is different, we save a new declaration." - aFASTNode ensureLocalUses. - nameDictionary at: aName put: aFASTNode ] ] - ifAbsentPut: [ - aFASTNode - ensureLocalUses; - yourself ] -] - -{ #category : 'accessing' } -FASTPythonLRScope >> entity: anObject [ - entity := anObject -] - -{ #category : 'initialization' } -FASTPythonLRScope >> initialize [ - - super initialize. - nameDictionary := Dictionary new -] diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 6c0e6ec..1b79fc2 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -20,7 +20,7 @@ Class { #name : 'FASTPythonLocalResolverVisitor', #superclass : 'FASTPythonVisitor', #instVars : [ - 'scopes' + 'namesContext' ], #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', @@ -38,9 +38,12 @@ FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ | declaration | declaration := (self declarationNamed: aName) ifNil: [ "If it is undeclared, we create an undeclared in the lowest scope in the stack." - scopes first ensureDeclarationOf: aName declaration: (FASTNonLocalDeclaration new - name: aName; - yourself) ]. + self + ensureDeclarationOf: aName + declaration: (FASTNonLocalDeclaration new + name: aName; + yourself) + in: namesContext first ]. aFASTNode localDeclaration: declaration. declaration addLocalUse: aFASTNode @@ -49,14 +52,35 @@ FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ { #category : 'declarations' } FASTPythonLocalResolverVisitor >> declarationNamed: aName [ - scopes do: [ :scope | scope declarationNamed: aName ifPresent: [ :declaration | ^ declaration ] ]. + namesContext do: [ :scope | scope at: aName ifPresent: [ :declaration | ^ declaration ] ]. + ^ nil ] +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> ensureDeclarationOf: aName declaration: aFASTNode in: scope [ + "If it is already present we do nothing. Else we create the local declaration. + + I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." + + ^ scope + at: aName + ifPresent: [ :declaration | + declaration localResolverKind = aFASTNode localResolverKind + ifTrue: [ ^ declaration ] + ifFalse: [ "If the kind is different, we save a new declaration." + aFASTNode ensureLocalUses. + scope at: aName put: aFASTNode ] ] + ifAbsentPut: [ + aFASTNode + ensureLocalUses; + yourself ] +] + { #category : 'declarations' } FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName declaration: aFASTNode [ - scopes top ensureDeclarationOf: aName declaration: aFASTNode. + self ensureDeclarationOf: aName declaration: aFASTNode in: namesContext top. self bind: anEntity toDeclarationNamed: aName ] @@ -64,28 +88,27 @@ FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName dec FASTPythonLocalResolverVisitor >> initialize [ super initialize. - scopes := Stack new + namesContext := Stack new ] { #category : 'initialization' } FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ - scopes push: (FASTPythonLRScope for: aFASTBehaviouralEntity). - - "We fulsh the attributes in case this is not the fist resolution" - aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. + self useNewScopeDuring: [ + "We flush the attributes in case this is not the fist resolution" + aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. - aFASTBehaviouralEntity accept: self. - scopes pop. - self assert: scopes isEmpty + aFASTBehaviouralEntity accept: self ]. + + self assert: namesContext isEmpty ] { #category : 'declarations' } -FASTPythonLocalResolverVisitor >> useScope: aScope during: aBlock [ +FASTPythonLocalResolverVisitor >> useNewScopeDuring: aBlock [ - scopes push: aScope. + namesContext push: Dictionary new. - [ aBlock value ] ensure: [ scopes pop ] + [ aBlock value ] ensure: [ namesContext pop ] ] { #category : 'visiting' } @@ -94,7 +117,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ "In Python 3, the comprehension has its own scope. In the future we should also manage python 2 that had no scope and could leek its variables." - self useScope: (FASTPythonLRScope for: aComprehension) during: [ + self useNewScopeDuring: [ self visitFASTPyTSplatExpression: aComprehension. self visitFASTPyExpression: aComprehension. @@ -119,14 +142,12 @@ FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ self ensureDeclarationOf: aFunctionDefinition named: aFunctionDefinition name declaration: aFunctionDefinition. - self - useScope: (FASTPythonLRScope for: aFunctionDefinition) - during: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." - self visitFASTTWithParameters: aFunctionDefinition. - self visitFASTPyTWithTypeParameters: aFunctionDefinition. - self visitFASTPyStatement: aFunctionDefinition. - self visitEntity: aFunctionDefinition returnType. - self visitFASTPyTDefinition: aFunctionDefinition ] + self useNewScopeDuring: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." + self visitFASTTWithParameters: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition ] ] { #category : 'visiting' } From 1f240e54c3e546e9b6587915869de6f9618a64ed Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Aug 2026 19:36:25 +0200 Subject: [PATCH 106/151] SSA: Rename var to be more explicit --- src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index a86ec73..6af431c 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -4,8 +4,8 @@ Class { #traits : 'FASTCFGTVisitor', #classTraits : 'FASTCFGTVisitor classTrait', #instVars : [ - 'variableVersions', - 'newVariablesMap' + 'newVariablesMap', + 'localDeclarations' ], #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', @@ -39,7 +39,7 @@ FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ aFASTEntity localDeclaration activeVersion: newSSA. - variableVersions add: aFASTEntity localDeclaration. + localDeclarations add: aFASTEntity localDeclaration. ^ newSSA ] @@ -47,7 +47,7 @@ FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ { #category : 'accessing' } FASTPythonSSAVisitor >> currentActiveVersions [ - ^ variableVersions collect: #activeVersion + ^ localDeclarations collect: #activeVersion ] { #category : 'actions' } @@ -62,7 +62,7 @@ FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ FASTPythonSSAVisitor >> initialize [ super initialize. - variableVersions := IdentitySet new. + localDeclarations := IdentitySet new. newVariablesMap := IdentityDictionary new ] From c67ebc247127d0bcf52783a37aab5b572e5be10d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 10 Aug 2026 10:38:43 +0200 Subject: [PATCH 107/151] Ensure identifier and attributes do not clash --- .../FASTPythonSSATest.class.st | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 37eb344..eff9cb6 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -167,6 +167,40 @@ print(x.y)'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementOfAttributeDoesNotClashWithIdentifier [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 5 + +y.x = 6 + +x = 7 + +print(y.x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'y.x_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements third left. + self assert: assignedVar3 ssaVersion version equals: 2. + self assert: assignedVar3 ssaName equals: 'x_2'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 1. + + usedVar := model module statements fourth arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ From 70009121cad894931282298058058ca7de3f27e7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 10 Aug 2026 14:45:02 +0200 Subject: [PATCH 108/151] Assignment in assignment --- .../FASTPythonSSATest.class.st | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index eff9cb6..d917fa7 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -17,6 +17,51 @@ FASTPythonSSATest >> parseAndResolve: aString [ FASTPythonSSAVisitor resolve: model module ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementInAssignment [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar1 usedVar2 usedVar3 usedVar4 | + self parseAndResolve: 'x = y = 3 + +print(x) +print(y) + +x = 5 + +print(x) +print(y)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first right left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'y_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 3. + + usedVar1 := model module statements second arguments first. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + usedVar2 := model module statements third arguments first. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion. + + assignedVar3 := model module statements fourth left. + self assert: assignedVar3 ssaVersion version equals: 2. + self assert: assignedVar3 ssaName equals: 'x_2'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar3 := model module statements fifth arguments first. + self assert: usedVar3 ssaVersion identicalTo: assignedVar3 ssaVersion. + + usedVar4 := model module statements sixth arguments first. + self assert: usedVar4 ssaVersion identicalTo: assignedVar2 ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testAssignementInIfInBothBranchesAndUsage [ From 2fe44b8a25e4acbf790c5a11d7af2d1f77e6fae1 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 10 Aug 2026 16:31:34 +0200 Subject: [PATCH 109/151] LR: Support assignment to lists --- .../FASTPythonMetamodelGenerator.class.st | 1 + src/FAST-Python-Model/FASTPyEntity.class.st | 7 ++ src/FAST-Python-Model/FASTPyList.class.st | 7 ++ .../FASTPythonLocalResolverTest.class.st | 81 +++++++++++++++++++ .../FASTPyAttributeAccess.extension.st | 2 +- .../FASTPyEntity.extension.st | 5 +- .../FASTPyIdentifier.extension.st | 2 +- .../FASTPySubscript.extension.st | 2 +- 8 files changed, 102 insertions(+), 5 deletions(-) diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 845b6a6..38fdae3 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -302,6 +302,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ lambda := builder newClassNamed: #Lambda. lambdaParameters := builder newClassNamed: #LambdaParameters. list := builder newClassNamed: #List. + list withTesting. listComprehension := builder newClassNamed: #ListComprehension. literal := builder newAbstractClassNamed: #Literal. matchStatement := builder newClassNamed: #MatchStatement. diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 9c851de..fe8503b 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -106,6 +106,13 @@ FASTPyEntity >> isInvocation [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isList [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isLiteral [ diff --git a/src/FAST-Python-Model/FASTPyList.class.st b/src/FAST-Python-Model/FASTPyList.class.st index 23cce16..1407d41 100644 --- a/src/FAST-Python-Model/FASTPyList.class.st +++ b/src/FAST-Python-Model/FASTPyList.class.st @@ -29,3 +29,10 @@ FASTPyList class >> annotation [ ] + +{ #category : 'testing' } +FASTPyList >> isList [ + + + ^ true +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 764c48d..79a87af 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -17,6 +17,87 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToList [ + + | assignedVariableX assignedVariableY usedVariableX | + self parseAndResolve: '[x, y] = [1, 2] + +print(x)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToListInLists [ + + | assignedVariableX assignedVariableY assignedVariableZ usedVariableX usedVariableY usedVariableZ | + self parseAndResolve: '[x, [y, z]] = [1, [2, 4]] + +print(x) +print(y) +print(z)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second initializers first. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 2. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + + usedVariableY := model module statements third arguments first. + self assert: usedVariableY localDeclaration equals: assignedVariableY. + self assert: usedVariableY equals: assignedVariableY localDeclaration localUses second. + + assignedVariableZ := model module statements first left initializers second initializers second. + self assert: assignedVariableZ localDeclaration equals: assignedVariableZ. + self assert: assignedVariableZ localDeclaration name equals: 'z'. + self assert: assignedVariableZ localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableZ localDeclaration isVariableWriteAccess. + self deny: assignedVariableZ localDeclaration isNonLocalDeclaration. + self assert: assignedVariableZ localDeclaration localUses size equals: 2. + self assert: assignedVariableZ localDeclaration localUses first equals: assignedVariableZ. + + usedVariableZ := model module statements fourth arguments first. + self assert: usedVariableZ localDeclaration equals: assignedVariableZ. + self assert: usedVariableZ equals: assignedVariableZ localDeclaration localUses second +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testAssignementToTuple [ diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index d482673..ca83ba6 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -12,7 +12,7 @@ FASTPyAttributeAccess >> variableDeclarator [ "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - self selfOrTopmostTupleContainer parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. ^ super variableDeclarator ] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 0b5da55..57bd3c0 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -29,7 +29,7 @@ FASTPyEntity >> localResolverKind [ ] { #category : '*FAST-Python-Tools' } -FASTPyEntity >> selfOrTopmostTupleContainer [ +FASTPyEntity >> selfOrTopmostAssignableCollection [ "If I am in a tuple, I return the tuple (this applies recursively, if I am in a tuple in a tuple I return the topmost tuple). Else, return myself." @@ -37,7 +37,8 @@ FASTPyEntity >> selfOrTopmostTupleContainer [ | node | "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" node := self. - [ node collectionInitializer isNotNil and: [ node collectionInitializer isTuple ] ] whileTrue: [ node := node collectionInitializer ]. + [ node collectionInitializer isNotNil and: [ node collectionInitializer isTuple or: [ node collectionInitializer isList ] ] ] whileTrue: [ + node := node collectionInitializer ]. ^ node ] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st index 5d39a58..b6e12ed 100644 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -14,7 +14,7 @@ FASTPyIdentifier >> variableDeclarator [ | assignedNode | "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - assignedNode := self selfOrTopmostTupleContainer. + assignedNode := self selfOrTopmostAssignableCollection. assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. diff --git a/src/FAST-Python-Tools/FASTPySubscript.extension.st b/src/FAST-Python-Tools/FASTPySubscript.extension.st index 99257e8..951f41f 100644 --- a/src/FAST-Python-Tools/FASTPySubscript.extension.st +++ b/src/FAST-Python-Tools/FASTPySubscript.extension.st @@ -11,7 +11,7 @@ FASTPySubscript >> variableDeclarator [ "In the case I represent a write access to a variable, I return the node representing my assignment." "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - self selfOrTopmostTupleContainer parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. ^ super variableDeclarator ] From c9b0fb6bf9323fee7ffacaf7bcb0b60c740ee5fd Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 10 Aug 2026 16:31:54 +0200 Subject: [PATCH 110/151] SSA: Support assignment to lists --- .../FASTPythonSSATest.class.st | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index d917fa7..7583965 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -262,6 +262,30 @@ FASTPythonSSATest >> testForVariableUsed [ self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariablesInListUsed [ + + | assignedVarA assignedVarB usedVarA usedVarB | + self parseAndResolve: 'for [a, b] in data: + print(a, b)'. + + assignedVarA := model module statements first left initializers first. + self assert: assignedVarA ssaVersion version equals: 1. + self assert: assignedVarA ssaName equals: 'a_1'. + self assert: assignedVarA ssaVersion localUses size equals: 2. + + usedVarA := model module statements first statements first arguments first. + self assert: usedVarA ssaVersion identicalTo: assignedVarA ssaVersion. + + assignedVarB := model module statements first left initializers second. + self assert: assignedVarB ssaVersion version equals: 1. + self assert: assignedVarB ssaName equals: 'b_1'. + self assert: assignedVarB ssaVersion localUses size equals: 2. + + usedVarB := model module statements first statements first arguments second. + self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariablesInTupleUsed [ @@ -461,6 +485,40 @@ l(4)'. self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testListAssignement [ + + | assignedVarX assignedVarY | + self parseAndResolve: '[x, y] = [5, 6]'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1' +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testListInListAssignement [ + + | assignedVarX assignedVarY assignedVarZ | + self parseAndResolve: '[x, [y, z]] = [5, [6, 7]]'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second initializers first. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1'. + + assignedVarZ := model module statements first left initializers second initializers second. + self assert: assignedVarZ ssaVersion version equals: 1. + self assert: assignedVarZ ssaName equals: 'z_1' +] + { #category : 'tests - parameters' } FASTPythonSSATest >> testMethodParameterUsed [ From b949b230eb1b4ad7cbef90c13983553715230966 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 10 Aug 2026 17:15:06 +0200 Subject: [PATCH 111/151] =?UTF-8?q?Ignore=20DS=5FSTORE=E2=80=AFfile=20on?= =?UTF-8?q?=20mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 178d87a..07794fa 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ SqueakDebug.log # Metacello-github cache /github-cache github-*.zip + +**/.DS_STORE From b97f421ab10e0640beb215ffcc9d3f97a5570eb9 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 11 Aug 2026 10:12:42 +0200 Subject: [PATCH 112/151] Start to add info on instance variables --- .../BaselineOfFASTPython.class.st | 2 +- .../FASTPythonMetamodelGenerator.class.st | 1 + .../FASTPythonAbstractTestCase.class.st | 23 +++++++++ .../FASTPythonAttributeAccessTest.class.st | 44 +++++++++++++++++ .../FASTPythonMethodDefinitionTest.class.st | 49 +++++++++++++++++++ src/FAST-Python-Model/FASTPyEntity.class.st | 7 +++ .../FASTPyIdentifier.class.st | 7 +++ .../FASTPyMethodDefinition.class.st | 16 ++++++ .../FASTPythonAbstractTestCase.class.st | 15 ------ .../FASTPythonCFGTest.class.st | 3 +- .../FASTPythonLocalResolverTest.class.st | 6 +-- .../FASTPythonSSATest.class.st | 6 +-- .../FASTPyAttributeAccess.extension.st | 19 +++++++ .../FASTPyEntity.extension.st | 6 +++ 14 files changed, 177 insertions(+), 27 deletions(-) create mode 100644 src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st create mode 100644 src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st create mode 100644 src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st delete mode 100644 src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st diff --git a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st index 332dec6..5128a1a 100644 --- a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st +++ b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st @@ -21,7 +21,7 @@ BaselineOfFASTPython >> baseline: spec [ spec package: 'FAST-Python-Model' with: [ spec requires: #( 'FAST' 'TreeSitter' ) ]; package: 'FAST-Python-Model-Generator'; - package: 'FAST-Python-Model-Tests' with: [ spec requires: #( 'FAST-Python-Model' ) ]; + package: 'FAST-Python-Model-Tests' with: [ spec requires: #( 'FAST-Python-Model' 'FAST-Python-Tools' ) ]; package: 'FAST-Python-Tools' with: [ spec requires: #( 'FAST-Python-Model' ) ]; package: 'FAST-Python-Tools-Tests' with: [ spec requires: #( 'FAST-Python-Tools' ) ]. diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 38fdae3..daac685 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -288,6 +288,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ genericType := builder newClassNamed: #GenericType. globalStatement := builder newClassNamed: #GlobalStatement. identifier := builder newClassNamed: #Identifier. + identifier withTesting. ifClause := builder newClassNamed: #IfClause. ifStatement := builder newClassNamed: #IfStatement. import := builder newClassNamed: #Import. diff --git a/src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st new file mode 100644 index 0000000..d7690ee --- /dev/null +++ b/src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st @@ -0,0 +1,23 @@ +Class { + #name : 'FASTPythonAbstractTestCase', + #superclass : 'TestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Model-Tests', + #package : 'FAST-Python-Model-Tests' +} + +{ #category : 'testing' } +FASTPythonAbstractTestCase class >> isAbstract [ + + ^ self = FASTPythonAbstractTestCase +] + +{ #category : 'running' } +FASTPythonAbstractTestCase >> parse: aString [ + + ^ model := FASTPythonImporter new + errorReportBlock: [ :i | i errors ifNotEmpty: [ self fail: 'Errors happened during parsing. Errors: ' , i errors printString ] ]; + parse: aString withPlatformLineEndings +] diff --git a/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st b/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st new file mode 100644 index 0000000..ea8dcc1 --- /dev/null +++ b/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st @@ -0,0 +1,44 @@ +Class { + #name : 'FASTPythonAttributeAccessTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Model-Tests', + #package : 'FAST-Python-Model-Tests' +} + +{ #category : 'tests' } +FASTPythonAttributeAccessTest >> testIsInstanceVariableAccess [ + + | writeAccess writeAccessToObject readAccess | + self parse: 'class Class: + def method(self, author: str, obj): + self.author = author + obj.toto = author + return self.author'. + + writeAccess := model module statements first statements first statements first left. + self assert: writeAccess name equals: 'author'. + self assert: writeAccess isInstanceVariableAccess. + + writeAccessToObject := model module statements first statements first statements second left. + self assert: writeAccessToObject name equals: 'toto'. + self deny: writeAccessToObject isInstanceVariableAccess. + + readAccess := model module statements first statements first statements third expression. + self assert: readAccess name equals: 'author'. + self assert: readAccess isInstanceVariableAccess +] + +{ #category : 'tests' } +FASTPythonAttributeAccessTest >> testMethodDefinition [ + + | method | + self parse: 'class Class: + def method(self, author: str): + self.author = author + return self.author'. + + method := model module statements first statements first. + + self assert: method statements first left methodDefinition equals: method. + self assert: method statements second expression methodDefinition equals: method +] diff --git a/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st b/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st new file mode 100644 index 0000000..ae87797 --- /dev/null +++ b/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st @@ -0,0 +1,49 @@ +Class { + #name : 'FASTPythonMethodDefinitionTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Model-Tests', + #package : 'FAST-Python-Model-Tests' +} + +{ #category : 'tests' } +FASTPythonMethodDefinitionTest >> testIsStatic [ + + | method1 method2 | + self parse: 'class Class: + def method(self, author: str): + self.author = author + return self.author + + @staticmethod + def method2(param): + return param'. + + method1 := model module statements first statements first. + self deny: method1 isStatic. + method2 := model module statements first statements second. + self assert: method2 isStatic +] + +{ #category : 'tests' } +FASTPythonMethodDefinitionTest >> testSelfName [ + + | method1 method2 method3 | + self parse: 'class Class: + def method(self, author: str): + self.author = author + return self.author + + def method2(this): + return this.author + + @staticmethod + def method3(param): + return param'. + + method1 := model module statements first statements first. + self assert: method1 selfName equals: 'self'. + method2 := model module statements first statements second. + self assert: method2 selfName equals: 'this'. + method3 := model module statements first statements third. + self assert: method3 selfName isNil +] diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index fe8503b..0388b48 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -99,6 +99,13 @@ FASTPyEntity >> isExpression [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isIdentifier [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isInvocation [ diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index f781f62..904d710 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -47,3 +47,10 @@ FASTPyIdentifier class >> annotation [ ] + +{ #category : 'testing' } +FASTPyIdentifier >> isIdentifier [ + + + ^ true +] diff --git a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st index a5b34e6..c76aaad 100644 --- a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st @@ -51,6 +51,13 @@ FASTPyMethodDefinition class >> annotation [ ] +{ #category : 'testing' } +FASTPyMethodDefinition >> isStatic [ + "A method is static in python if it has the `@staticmethod` decorator." + + ^ self decorators anySatisfy: [ :decorator | decorator expression isIdentifier and: [ decorator expression name = 'staticmethod' ] ] +] + { #category : 'accessing' } FASTPyMethodDefinition >> returnType [ "Relation named: #returnType type: #FASTPyType opposite: #parentMethodDefinition" @@ -65,3 +72,12 @@ FASTPyMethodDefinition >> returnType: anObject [ returnType := anObject ] + +{ #category : 'accessing' } +FASTPyMethodDefinition >> selfName [ + "Return the name of the parameter corresponding to 'self'. In case of a static method, returns nil since there is none." + + self isStatic ifTrue: [ ^ nil ]. + + ^ self parameters first name +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st deleted file mode 100644 index 07b2367..0000000 --- a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st +++ /dev/null @@ -1,15 +0,0 @@ -Class { - #name : 'FASTPythonAbstractTestCase', - #superclass : 'TestCase', - #category : 'FAST-Python-Tools-Tests-Core', - #package : 'FAST-Python-Tools-Tests', - #tag : 'Core' -} - -{ #category : 'running' } -FASTPythonAbstractTestCase >> parse: aString [ - - ^ FASTPythonImporter new - errorReportBlock: [ :i | i errors ifNotEmpty: [ self fail: 'Errors happened during parsing. Errors: ' , i errors printString ] ]; - parse: aString withPlatformLineEndings -] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index b8be475..bb88754 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -12,7 +12,8 @@ Class { { #category : 'running' } FASTPythonCFGTest >> buildCFGForFunction: aString [ - startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: aString) allFunctionDefinitions first + self parse: aString. + startBlock := FASTPythonCFGVisitor buildCFGOf: model allFunctionDefinitions first ] { #category : 'tests' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 79a87af..804c815 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1,9 +1,6 @@ Class { #name : 'FASTPythonLocalResolverTest', #superclass : 'FASTPythonAbstractTestCase', - #instVars : [ - 'model' - ], #category : 'FAST-Python-Tools-Tests-Algos', #package : 'FAST-Python-Tools-Tests', #tag : 'Algos' @@ -12,8 +9,7 @@ Class { { #category : 'resolving' } FASTPythonLocalResolverTest >> parseAndResolve: aString [ - model := self parse: aString. - + self parse: aString. FASTPythonLocalResolverVisitor resolve: model module ] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 7583965..e146a16 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1,9 +1,6 @@ Class { #name : 'FASTPythonSSATest', #superclass : 'FASTPythonAbstractTestCase', - #instVars : [ - 'model' - ], #category : 'FAST-Python-Tools-Tests-Algos', #package : 'FAST-Python-Tools-Tests', #tag : 'Algos' @@ -12,8 +9,7 @@ Class { { #category : 'parsing' } FASTPythonSSATest >> parseAndResolve: aString [ - model := self parse: aString. - + self parse: aString. FASTPythonSSAVisitor resolve: model module ] diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index ca83ba6..261a6bb 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -1,11 +1,30 @@ Extension { #name : 'FASTPyAttributeAccess' } +{ #category : '*FAST-Python-Tools' } +FASTPyAttributeAccess >> isInstanceVariableAccess [ + + self methodDefinition ifNotNil: [ :method | ^ self value isIdentifier and: [ self value name = method selfName ] ]. + + ^ false +] + { #category : '*FAST-Python-Tools' } FASTPyAttributeAccess >> localDeclarationName [ ^ self sourceCode ] +{ #category : '*FAST-Python-Tools' } +FASTPyAttributeAccess >> methodDefinition [ + "In case I am inside a method definition, return this method." + + ^ (self containersOfType: FASTPyMethodDefinition) + ifNotEmpty: [ :methods | + self assert: methods size = 1. + methods anyOne ] + ifEmpty: [ nil ] +] + { #category : '*FAST-Python-Tools' } FASTPyAttributeAccess >> variableDeclarator [ "In the case I represent a write access to a variable, I return the node representing my assignment." diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 57bd3c0..a74ae83 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -12,6 +12,12 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> isInstanceVariableAccess [ + + ^ false +] + { #category : '*FAST-Python-Tools' } FASTPyEntity >> isVariableWriteAccess [ "I am used in the LR and SSA builder to know if I represent the assignment of a variable." From eee18a2d7b18a8fb780481538b002818c402ce3e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 11 Aug 2026 10:30:41 +0200 Subject: [PATCH 113/151] Allow to know if an ivar is a write or read access --- .../FASTPythonAttributeAccessTest.class.st | 20 +++++++++++++++++++ .../FASTPyAttributeAccess.class.st | 11 ++++++++++ src/FAST-Python-Model/FASTPyEntity.class.st | 17 ++++++++++++++++ .../FASTPyIdentifier.class.st | 17 ++++++++++++++++ .../FASTPyParameter.class.st | 7 +++++++ .../FASTPySubscript.class.st | 10 ++++++++++ .../FASTPyAttributeAccess.extension.st | 11 ---------- .../FASTPyEntity.extension.st | 17 ---------------- .../FASTPyIdentifier.extension.st | 17 ---------------- .../FASTPyParameter.extension.st | 7 ------- .../FASTPySubscript.extension.st | 10 ---------- 11 files changed, 82 insertions(+), 62 deletions(-) diff --git a/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st b/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st index ea8dcc1..07f3a94 100644 --- a/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st +++ b/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st @@ -28,6 +28,26 @@ FASTPythonAttributeAccessTest >> testIsInstanceVariableAccess [ self assert: readAccess isInstanceVariableAccess ] +{ #category : 'tests' } +FASTPythonAttributeAccessTest >> testIsWriteVariableAccess [ + + | writeAccess readAccess | + self parse: 'class Class: + def method(self, author: str, obj): + self.author = author + return self.author'. + + writeAccess := model module statements first statements first statements first left. + self assert: writeAccess name equals: 'author'. + self assert: writeAccess isInstanceVariableAccess. + self assert: writeAccess isVariableWriteAccess. + + readAccess := model module statements first statements first statements second expression. + self assert: readAccess name equals: 'author'. + self assert: readAccess isInstanceVariableAccess. + self deny: readAccess isVariableWriteAccess +] + { #category : 'tests' } FASTPythonAttributeAccessTest >> testMethodDefinition [ diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index 2ab7b18..5d630cb 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -73,3 +73,14 @@ FASTPyAttributeAccess >> value: anObject [ value := anObject ] + +{ #category : 'accessing' } +FASTPyAttributeAccess >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + + self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 0388b48..c9afc60 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -175,3 +175,20 @@ FASTPyEntity >> isVariableEntity [ ^ false ] + +{ #category : 'testing' } +FASTPyEntity >> isVariableWriteAccess [ + "I am used in the LR and SSA builder to know if I represent the assignment of a variable." + + ^ self variableDeclarator isNotNil +] + +{ #category : 'accessing' } +FASTPyEntity >> variableDeclarator [ + "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. + Nodes representing potential variable write access should override me. + + I am used by the LocalResolver and potentially SSA" + + ^ nil +] diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 904d710..1b96fbd 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -54,3 +54,20 @@ FASTPyIdentifier >> isIdentifier [ ^ true ] + +{ #category : 'accessing' } +FASTPyIdentifier >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + | assignedNode | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + assignedNode := self selfOrTopmostAssignableCollection. + + assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. + + assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Model/FASTPyParameter.class.st b/src/FAST-Python-Model/FASTPyParameter.class.st index bef1555..12865a0 100644 --- a/src/FAST-Python-Model/FASTPyParameter.class.st +++ b/src/FAST-Python-Model/FASTPyParameter.class.st @@ -88,3 +88,10 @@ FASTPyParameter >> type: anObject [ type := anObject ] + +{ #category : 'accessing' } +FASTPyParameter >> variableDeclarator [ + "For parameters, they are their own declarator." + + ^ self +] diff --git a/src/FAST-Python-Model/FASTPySubscript.class.st b/src/FAST-Python-Model/FASTPySubscript.class.st index b4c4cfa..0e56153 100644 --- a/src/FAST-Python-Model/FASTPySubscript.class.st +++ b/src/FAST-Python-Model/FASTPySubscript.class.st @@ -86,3 +86,13 @@ FASTPySubscript >> value: anObject [ value := anObject ] + +{ #category : 'accessing' } +FASTPySubscript >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index 261a6bb..d971aba 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -24,14 +24,3 @@ FASTPyAttributeAccess >> methodDefinition [ methods anyOne ] ifEmpty: [ nil ] ] - -{ #category : '*FAST-Python-Tools' } -FASTPyAttributeAccess >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment." - - "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - - self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. - - ^ super variableDeclarator -] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index a74ae83..c23c73e 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -18,13 +18,6 @@ FASTPyEntity >> isInstanceVariableAccess [ ^ false ] -{ #category : '*FAST-Python-Tools' } -FASTPyEntity >> isVariableWriteAccess [ - "I am used in the LR and SSA builder to know if I represent the assignment of a variable." - - ^ self variableDeclarator isNotNil -] - { #category : '*FAST-Python-Tools' } FASTPyEntity >> localResolverKind [ "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. @@ -48,13 +41,3 @@ FASTPyEntity >> selfOrTopmostAssignableCollection [ ^ node ] - -{ #category : '*FAST-Python-Tools' } -FASTPyEntity >> variableDeclarator [ - "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. - Nodes representing potential variable write access should override me. - - I am used by the LocalResolver and potentially SSA" - - ^ nil -] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st index b6e12ed..95c87cd 100644 --- a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -7,20 +7,3 @@ FASTPyIdentifier >> localResolverKind [ self halt "I don't know if it can be something else." ] - -{ #category : '*FAST-Python-Tools' } -FASTPyIdentifier >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment." - - | assignedNode | - "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - assignedNode := self selfOrTopmostAssignableCollection. - - assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. - - assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. - - assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. - - ^ super variableDeclarator -] diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st index dd4443c..e367ebd 100644 --- a/src/FAST-Python-Tools/FASTPyParameter.extension.st +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -6,10 +6,3 @@ FASTPyParameter >> localResolverKind [ ^ #variable ] - -{ #category : '*FAST-Python-Tools' } -FASTPyParameter >> variableDeclarator [ - "For parameters, they are their own declarator." - - ^ self -] diff --git a/src/FAST-Python-Tools/FASTPySubscript.extension.st b/src/FAST-Python-Tools/FASTPySubscript.extension.st index 951f41f..28abb18 100644 --- a/src/FAST-Python-Tools/FASTPySubscript.extension.st +++ b/src/FAST-Python-Tools/FASTPySubscript.extension.st @@ -5,13 +5,3 @@ FASTPySubscript >> localDeclarationName [ ^ self sourceCode ] - -{ #category : '*FAST-Python-Tools' } -FASTPySubscript >> variableDeclarator [ - "In the case I represent a write access to a variable, I return the node representing my assignment." - - "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" - self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. - - ^ super variableDeclarator -] From 2cafff3313026ed36f6a08fe3fea8d2418645bbe Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 11 Aug 2026 19:01:00 +0200 Subject: [PATCH 114/151] Add #isAbstract to methods --- .../FASTPythonMethodDefinitionTest.class.st | 19 +++++++++++++++++++ .../FASTPyMethodDefinition.class.st | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st b/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st index ae87797..727e025 100644 --- a/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st +++ b/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st @@ -5,6 +5,25 @@ Class { #package : 'FAST-Python-Model-Tests' } +{ #category : 'tests' } +FASTPythonMethodDefinitionTest >> testIsAbstract [ + + | method1 method2 | + self parse: 'class Class(ABC): + def method(self, author: str): + self.author = author + return self.author + + @abstractmethod + def method2(param): + pass'. + + method1 := model module statements first statements first. + self deny: method1 isAbstract. + method2 := model module statements first statements second. + self assert: method2 isAbstract +] + { #category : 'tests' } FASTPythonMethodDefinitionTest >> testIsStatic [ diff --git a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st index c76aaad..438f923 100644 --- a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st @@ -51,6 +51,13 @@ FASTPyMethodDefinition class >> annotation [ ] +{ #category : 'testing' } +FASTPyMethodDefinition >> isAbstract [ + "A method is static in python if it has the `@staticmethod` decorator." + + ^ self decorators anySatisfy: [ :decorator | decorator expression isIdentifier and: [ decorator expression name = 'abstractmethod' ] ] +] + { #category : 'testing' } FASTPyMethodDefinition >> isStatic [ "A method is static in python if it has the `@staticmethod` decorator." From e7a70e7759717b229acac51b04466a06a181e979 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 11 Aug 2026 19:02:11 +0200 Subject: [PATCH 115/151] Factorize code --- .../FASTPyMethodDefinition.class.st | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st index 438f923..23e9fdf 100644 --- a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st @@ -52,17 +52,24 @@ FASTPyMethodDefinition class >> annotation [ ] { #category : 'testing' } -FASTPyMethodDefinition >> isAbstract [ +FASTPyMethodDefinition >> hasDecoratorNamed: aString [ "A method is static in python if it has the `@staticmethod` decorator." - ^ self decorators anySatisfy: [ :decorator | decorator expression isIdentifier and: [ decorator expression name = 'abstractmethod' ] ] + ^ self decorators anySatisfy: [ :decorator | decorator expression isIdentifier and: [ decorator expression name = aString ] ] +] + +{ #category : 'testing' } +FASTPyMethodDefinition >> isAbstract [ + "A method is static in python if it has the `@abstractmethod` decorator." + + ^ self hasDecoratorNamed: 'abstractmethod' ] { #category : 'testing' } FASTPyMethodDefinition >> isStatic [ "A method is static in python if it has the `@staticmethod` decorator." - ^ self decorators anySatisfy: [ :decorator | decorator expression isIdentifier and: [ decorator expression name = 'staticmethod' ] ] + ^ self hasDecoratorNamed: 'staticmethod' ] { #category : 'accessing' } From aa080f8aecb6c20a66c16792860162fcacdd6a92 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 12 Aug 2026 10:16:13 +0200 Subject: [PATCH 116/151] Move some methods in the right location + add metadescriptions --- .../FASTPyAttributeAccess.class.st | 19 +++++++++++++++++++ src/FAST-Python-Model/FASTPyEntity.class.st | 6 ++++++ .../FASTPyMethodDefinition.class.st | 12 +++++++++--- .../FASTPyAttributeAccess.extension.st | 19 ------------------- .../FASTPyEntity.extension.st | 6 ------ 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index 5d630cb..3fdd8be 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -58,6 +58,25 @@ FASTPyAttributeAccess class >> annotation [ ] +{ #category : 'testing' } +FASTPyAttributeAccess >> isInstanceVariableAccess [ + + self methodDefinition ifNotNil: [ :method | ^ self value isIdentifier and: [ self value name = method selfName ] ]. + + ^ false +] + +{ #category : 'accessing' } +FASTPyAttributeAccess >> methodDefinition [ + "In case I am inside a method definition, return this method." + + ^ (self containersOfType: FASTPyMethodDefinition) + ifNotEmpty: [ :methods | + self assert: methods size = 1. + methods anyOne ] + ifEmpty: [ nil ] +] + { #category : 'accessing' } FASTPyAttributeAccess >> value [ "Relation named: #value type: #FASTPyExpression opposite: #parentAttributeObject" diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index c9afc60..ac9cc73 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -106,6 +106,12 @@ FASTPyEntity >> isIdentifier [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isInstanceVariableAccess [ + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isInvocation [ diff --git a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st index 23e9fdf..00ccc49 100644 --- a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st @@ -60,15 +60,19 @@ FASTPyMethodDefinition >> hasDecoratorNamed: aString [ { #category : 'testing' } FASTPyMethodDefinition >> isAbstract [ - "A method is static in python if it has the `@abstractmethod` decorator." + + + ^ self hasDecoratorNamed: 'abstractmethod' ] { #category : 'testing' } FASTPyMethodDefinition >> isStatic [ - "A method is static in python if it has the `@staticmethod` decorator." + + + ^ self hasDecoratorNamed: 'staticmethod' ] @@ -89,8 +93,10 @@ FASTPyMethodDefinition >> returnType: anObject [ { #category : 'accessing' } FASTPyMethodDefinition >> selfName [ - "Return the name of the parameter corresponding to 'self'. In case of a static method, returns nil since there is none." + + + self isStatic ifTrue: [ ^ nil ]. ^ self parameters first name diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st index d971aba..6788be4 100644 --- a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -1,26 +1,7 @@ Extension { #name : 'FASTPyAttributeAccess' } -{ #category : '*FAST-Python-Tools' } -FASTPyAttributeAccess >> isInstanceVariableAccess [ - - self methodDefinition ifNotNil: [ :method | ^ self value isIdentifier and: [ self value name = method selfName ] ]. - - ^ false -] - { #category : '*FAST-Python-Tools' } FASTPyAttributeAccess >> localDeclarationName [ ^ self sourceCode ] - -{ #category : '*FAST-Python-Tools' } -FASTPyAttributeAccess >> methodDefinition [ - "In case I am inside a method definition, return this method." - - ^ (self containersOfType: FASTPyMethodDefinition) - ifNotEmpty: [ :methods | - self assert: methods size = 1. - methods anyOne ] - ifEmpty: [ nil ] -] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index c23c73e..4bb55c7 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -12,12 +12,6 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] -{ #category : '*FAST-Python-Tools' } -FASTPyEntity >> isInstanceVariableAccess [ - - ^ false -] - { #category : '*FAST-Python-Tools' } FASTPyEntity >> localResolverKind [ "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. From 2c76e4764e91137f1e8b0bf33efce44470b3f361 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 12 Aug 2026 10:26:21 +0200 Subject: [PATCH 117/151] Add more doc (WIP) --- resources/doc/analysis.md | 212 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 resources/doc/analysis.md diff --git a/resources/doc/analysis.md b/resources/doc/analysis.md new file mode 100644 index 0000000..b85bccf --- /dev/null +++ b/resources/doc/analysis.md @@ -0,0 +1,212 @@ +# Doing analysis on FASTPython + +A general note: When we import an entity, we cannot know if it is a variable, a function, a class... So the analysis works better for entities declared in the file for multiple parts of this documentation. + +> Note: Currently, analysis done with FASTPython are mostly done to analyse variables. So the documentation will be centered on analysis of variables and the algos are mostly tested on variables analysis and not functions, methods, ...ß + +## Local resolution + +FASTPython includes `FASTPythonLocalResolverVisitor`. Its goal is to link each entities to their first declaration. This works for all named entities. +You can link: +- Variables +- Functions +- Methods +- Imports + +During analysis it is recommended to have a resolved FASTPython: + +```smalltalk +FASTPythonLocalResolverVisitor resolve: aModule "could be any behavioral entity of a FASTPython model." +``` + +Once this is done, you can ask any node that can represent a variable for its `#localDeclaration`. It will return the first definition of the entity if it is in the file. If the entity is not declared in the file, it will return a `FASTNonLocalDeclaration`. + +The local declaration knows all the usages of the entity in the model. We can get them by asking `#localUses`. + +## Static Single Assignment (SSA) + +FASTPython includes `FASTPythonSSAVisitor` to build a SSA form of the AST. The goal of the SSA is to know for each use of a variable, the assignation or assignations linked to this usage. + +Two little examples: + +```python +x.y = 4 # x.y_1 +print(x.y) # x.y_1 +x.y = 6 # x.y_2 +print(x.y) # x.y_2 +``` + +Here we have only one variable, but with two assignments. We know that the first printing prints the value assigned in line 1 and the second prints the value in the second assignment. + +```python +x.y = 4 # x.y_1 +print(x.y) # x.y_1 + +if z > 3: + x.y = 3 # x.y_2 + +print(x.y) # Phi(x.y_1, x.y_2) +``` + +In this new case, the second printing can have two different value depending on z. Then, we return a collection of those values. + +You can ask any node representing a variable for its `#ssaVersion`. This version can either be a `FASTVariableVersionSSA` or a `FASTPhiVersionSSA`. It will be a Phi if it can have multiple versions. + +All versions know the local declaration of the variable (which allow to find all usages independently of the assignemnt) and you can use `#localUses` to find all the uses of the variable **for the current SSA version**. + +For example: + +```python +x = 2 # x_1 +print(x) # x_1 + +if z > 3: + x = 3 # x_2 + print(x) # x_2 +else: + x = 4 # x_3 + +print(x) # Phi(x_2, x_3) +``` + +Asking `#ssaVersion` to the `FASTPyVariable` node of `x = 3`, it will return the version number 2. If you ask its local uses, it will return. The one of the assignment (write access), the one of the second printing (read access) and the one of the last printing (read access). + +It is possible to ask to a model or a group for the SSA versions inside it using `#allSSAVersions`. + +## Limitations of local resolver and SSA + +Multiple limitations are present in those two algorithms. Some because it is impossible to do. Some others because we did not take the time to push the implementation further. + +### Attribute accesses + +Attribute accesses globaly work, but not in some specific cases. Here is an example: + +```python +x.y.z = 3 +a = x.y +print(a.z) +``` + +Here the printing of `a.z` should be linked to the declaration `x.y.z = 3` but this is currently not supported. + + +### Subscript content + +Currently to identify a subscript in the local resolver and the SSA, we check the content of the subscript as a string but this is too lax. Here are a few examples of problems with subscripts: + +```python +x = 2 + +y[x] = 3 + +x = 3 + +y[x] +``` + +Here the second subscript will declare the first one as local declaration even if it is a different index in this case. + +```python +x[0:4] + +x[:4] +``` + +Here the two subscripts are the same, byt since we compare strings, it will be seen as different. + +We could improve this by checking the expression instide instead of the souce code. + +### Instance variables + +Instance variables cannot be managed well by a SSA since there are no declaration of instance variables in python and we do not know in which order the methods will be invoked. + +Some API to query instance variables is also available and will be described later in this documentation. + +### Python 2 VS Python 3 + +The local resolver and SSA are currently based on Python 3 behavior and not Python 2. In the future we could support both. + +This has some implications, for example: + +```python +[x for x in coll] +print(x) +``` + +Here, the printing will be linked to an nonlocal declaration because in Python 3, list comprehensions are scoped and x is only declared in the comprehension. In Python 2, x would have leaked the comprehension. + +### Global and Non local statement + +For now the LR does not manage global and non local statements. + +## FAST Python visitor + +FASTPython comes with a visitor either used in the form of a trait to use with `FASTPyTVisitor` or a class to subclass with `FASTPythonVisitor`. + +Be careful, in some usage of the visitor some visit methods need to be overriden to change the visit order. For example, in a visitor I needed to ensure that function parameters are visited before the statements of the function. + +For more information about FASTPython visitor you can read [this blog post on the Moose wiki](https://modularmoose.org/blog/2026-05-20-improving-visitor-generator-copy/). + +## Control Flow Graph (CFG) + +It is possible to get a control flow graph of a behavioral entities in FASTPython. + +I can be used like this: + +```smalltalk +FASTPythonCFGVisitor buildCFGOf: aModel allFunctionDefinitions first. + +"or" + +aModel allFunctionDefinitions first cfg +``` + +I can take one of five different entities to build a CFG: + +• a FASTPyModule +• a FASTPyFunctionDefinition +• a FASTPyMethodDefinition +• a FASTPyLambda +• a FASTPyClassDefinition + +It is also possible to ask for a "full" CFG that returns a dictionary with the CFG on the entity and also the CFGs of all definitions found inside of this entity. + +Once we have the CFG, we can use `FASTCFGTVisitor` to visit it. This visitor will visit all expressions in the CFG and all the next blocks. +It has the nice feature of visiting all blocks inside a conditional node before visiting the next blocks. It visit them branch by branch and allows the user to hook behavior between the branches. + +This visitor and the python visitor are used to build the SSA if you need an example of real usage. + +For more information on FAST CFG you can read this [article on the Moose wiki](https://modularmoose.org/developers/fast-cfg/). + +## FAST utilities + +Some properties and helpers got added to FAST to get more information out of the AST. Here some of them will be described. + +Some general properties got added such as: +- `FASTPyMethodDefinition>>isStatic` to know if a method is static +- `FASTPyMethodDefinition>>isAbstract` to know if a method is abstract +- `FASTPyMethodDefinition>>selfName` to know the name of the self parameter (will be nil for static methods) + +TODO: Document more + +## Examples of analysis + +In this section I'll show how to answer some questions we might have. + +The examples will use `#parseAndResolve:` from the python importer that parse a piece of code and launch the local resolver and SSA resolution. + +For example: + +```smalltalk +code := 'x = 2 +print(x)' withPlatformLineEndings. "Platform line ending are needed because cr line returns are not supported in Python parsers." + +model := FASTPythonImporter parseAndResolve: code. "Import and resolve with local resolver and SSA." +``` + +**Where is a variable defined?** + +TODO + + +TODO: Update README \ No newline at end of file From e8a8c9d9d89954e1f1d408cf5e1ce987f8553166 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 12 Aug 2026 15:55:18 +0200 Subject: [PATCH 118/151] Add utility methods forn parsing and resolving in one step --- .../FASTPythonImporter.class.st | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/FAST-Python-Tools/FASTPythonImporter.class.st b/src/FAST-Python-Tools/FASTPythonImporter.class.st index a3bb245..c95ab63 100644 --- a/src/FAST-Python-Tools/FASTPythonImporter.class.st +++ b/src/FAST-Python-Tools/FASTPythonImporter.class.st @@ -90,6 +90,28 @@ FASTPythonImporter class >> devParseFiles: aCollection [ result inspect ] +{ #category : 'parsing' } +FASTPythonImporter class >> parseAndResolve: aString [ + + | model | + model := self parse: aString. + + FASTPythonSSAVisitor resolve: model module. + + ^ model +] + +{ #category : 'parsing' } +FASTPythonImporter class >> parseFileAndResolve: aFileReference [ + + | model | + model := self parseFile: aFileReference. + + FASTPythonSSAVisitor resolve: model module. + + ^ model +] + { #category : 'accessing' } FASTPythonImporter >> tsLanguage [ From 95f4c13181e72c85790ae087bafd1962907091f7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 12 Aug 2026 16:31:39 +0200 Subject: [PATCH 119/151] Update documentation --- README.md | 67 +++++------------------- resources/doc/analysis.md | 105 +++++++++++++++++++++++++++++++++++++- 2 files changed, 116 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 7864658..f69c3f1 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,7 @@ Famix AST representation for Python based on TreeSitter - [Documentation](#documentation) - [Control flow graph](#control-flow-graph) - [Local resolutions](#local-resolutions) - - [Shadowing](#shadowing) - - [Limitations](#limitations) - - [Separated dotted names](#separated-dotted-names) - - [Access to non local entities](#access-to-non-local-entities) - - [Python 2 management](#python-2-management) + - [Single Static Assignment (SSA)](#single-static-assignment-ssa) - [Moose versions compatibility](#moose-versions-compatibility) - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) - [Python version compatibility](#python-version-compatibility) @@ -67,6 +63,8 @@ Or The best documentation to read about this project is located in Pharo Tree Sitter's repository here: [https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/fast_importer.md](https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/fast_importer.md) and here: [https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/ts_utilities.md](https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/ts_utilities.md) +You can find the documentation on some analysis possible here: [Analysis documentation](resources/doc/analysis.md). + ## Control flow graph @@ -84,6 +82,8 @@ A CFG can be done on a function, method, class, module or lambda. You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` +For more information check the analysis documentation linked above. + ## Local resolutions It is possible to apply a local name resolution on a FAST-Python model by executing this piece of code: @@ -94,63 +94,22 @@ FASTPythonLocalResolverVisitor resolve: model module "Can be any behavioral enti Once this is executed, all nodes resolved will be able to provide a `#localDeclaration` pointing to the declaration/first use of the entity. This local declaration also knows all the `#localUses` of the entity. -The local declaration can be multiple things such as: -- An assignement -- A function/class/method declaration -- An import -- A parameter declaration -- A for loop to declare a variable -- ... - -### Shadowing - -In Python anything named can shadow anything named. For example we can declare a global variable then shadow it with an import, then shadow it with a function... - -In the case of a shadowing, we manage it in two distinct ways: -- If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration -- If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration +For more information check the analysis documentation linked above. -### Limitations +## Single Static Assignment (SSA) -This project has a few limitations. - -#### Separated dotted names - -In case we have a dotted name but we do not use the same way to declare it, we are currently not keeping track of the declaration. For example, ßhis kind of uses are not supported: - -```python -a.b.c = 3 -d = a.b -print(d.c) -``` +It is possible to build the SSA of a FAST-Python model like this: -Here `a.b.c` will have a local declaration, but it will not know that`d.c` is a local use of this declared variable. -#### Access to non local entities +It can be run like this: -If the code has access to entities that we do not know, then we create a `FASTNonLocalDeclaration`. For example: - -```python -import x - -x.y +```smalltalk +FASTPythonSSAVisitor resolve: model module ``` -Here, in the expression `x.y` we will be able to link `x` to its declaration in the import, but we have no declaration for y since this is done in another project. -In that case, we associate it to a non local declaration. - -But, this has the current limit that if you access multiple times this `y` field of `x`, then each of them ill have their own non local declaration. -This is not the way I would like the project to work and this could be improved by having all references point to the same non local declaration object, but we need time for this :) - -See (https://github.com/moosetechnology/FAST-Python/issues/26)[https://github.com/moosetechnology/FAST-Python/issues/26] - -#### Python 2 management - -Currently, the Local resolver is based on Python 3. In the future we should add the support for Python 2 and let the user configure his version of Python. - -This has an influence for example on the scope of comprehensions. In Python 2 comprehensions do not have any scope and the variable declared in it leak while in Python 3 there is a scope and the variable does not leak. +Then we can ask to any node representing a variable access `#ssaVersion`. This version is able to tell us where are the read and write accesses of this particular version of the variable. -See (https://github.com/moosetechnology/FAST-Python/issues/27)[https://github.com/moosetechnology/FAST-Python/issues/27] +For more information check the analysis documentation linked above. ## Moose versions compatibility diff --git a/resources/doc/analysis.md b/resources/doc/analysis.md index b85bccf..ed3cb35 100644 --- a/resources/doc/analysis.md +++ b/resources/doc/analysis.md @@ -4,6 +4,21 @@ A general note: When we import an entity, we cannot know if it is a variable, a > Note: Currently, analysis done with FASTPython are mostly done to analyse variables. So the documentation will be centered on analysis of variables and the algos are mostly tested on variables analysis and not functions, methods, ...ß +- [Doing analysis on FASTPython](#doing-analysis-on-fastpython) + - [Local resolution](#local-resolution) + - [Shadowing](#shadowing) + - [Static Single Assignment (SSA)](#static-single-assignment-ssa) + - [Limitations of local resolver and SSA](#limitations-of-local-resolver-and-ssa) + - [Attribute accesses](#attribute-accesses) + - [Subscript content](#subscript-content) + - [Instance variables](#instance-variables) + - [Python 2 VS Python 3](#python-2-vs-python-3) + - [Global and Non local statement](#global-and-non-local-statement) + - [FAST Python visitor](#fastpython-visitor) + - [Control Flow Graph (CFG)](#control-flow-graph-cfg) + - [FAST utilities](#fast-utilities) + - [Examples of analysis](#examples-of-analysis) + ## Local resolution FASTPython includes `FASTPythonLocalResolverVisitor`. Its goal is to link each entities to their first declaration. This works for all named entities. @@ -23,10 +38,25 @@ Once this is done, you can ask any node that can represent a variable for its `# The local declaration knows all the usages of the entity in the model. We can get them by asking `#localUses`. +### Shadowing + +In Python anything named can shadow anything named. For example we can declare a global variable then shadow it with an import, then shadow it with a function... + +In the case of a shadowing, we manage it in two distinct ways: +- If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration +- If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration + + ## Static Single Assignment (SSA) FASTPython includes `FASTPythonSSAVisitor` to build a SSA form of the AST. The goal of the SSA is to know for each use of a variable, the assignation or assignations linked to this usage. +It can be run like this: + +```smalltalk +FASTPythonSSAVisitor resolve: model module +``` + Two little examples: ```python @@ -204,9 +234,80 @@ print(x)' withPlatformLineEndings. "Platform line ending are needed because cr l model := FASTPythonImporter parseAndResolve: code. "Import and resolve with local resolver and SSA." ``` +Let's use this piece of Python code as example: + +```python +x = 2 + +print(x) + +x = 3 + +if z > 4: + x = 5 + +print(x) +``` + **Where is a variable defined?** -TODO +We can do this: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess ssaVersion. "a FASTVariablePhiVersionSSA ['x_3', 'x_2']" + +lastVariableAccess ssaVersion writeAccesses. "an OrderedCollection(PyVariable(18 - 18) PyVariable(36 - 36))" +``` + +This will return the write accesses that impacted this use of the variable. + +**Where is a variable read?** + +With the same python snippet as before we can do: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess ssaVersion readAccesses "an OrderedCollection(PyIdentifier(50 - 50))" +``` + +This will return every reading of the variable you are checking for the current SSA version. + +**Where is a variable read independently of versions?** + +Let's imagine we want all read access to the variable and not just the ones for the current SSA version. We can do: + +```smalltalk +variable := model module statements first left. "We could get any access to the variable here, not only the first one." + +variable localDeclaration readAccesses. "an OrderedCollection(PyIdentifier(14 - 14) PyIdentifier(50 - 50))" +``` +**Where is a variable writen independently of version?** + +Same as before, we can use the local declaration: + +```smalltalk +variable := model module statements first left. "We could get any access to the variable here, not only the first one." + +variable localDeclaration writeAccesses "an OrderedCollection(PyVariable(1 - 1) PyVariable(18 - 18) PyVariable(36 - 36))" +``` + +> For both local declaration and SSA version it is possible to ask for `localUses` to get read and write accesses in one go. + +**What is the assignment node of the variable I am manipulating?** + +It is possible to get the nodes doing the assignemnts this way: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess ssaVersion writeAccesses collect: [ :access | access variableDeclarator ] "an OrderedCollection(PyAssignment(18 - 22) PyAssignment(36 - 40))" +``` + +The assignemnts nodes can be an assignemnt, a for, an augmented assignment or a for in clause. +Do not forget that an assignemnt can be done to a tuple or list. -TODO: Update README \ No newline at end of file +Also, there can be multiple ones, as shown in the example, in case of a phi version. \ No newline at end of file From 2c7c1d80915bcf7d733006052469e1b313f94c0a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 12 Aug 2026 16:32:36 +0200 Subject: [PATCH 120/151] Add test --- .../FASTPythonSSATest.class.st | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index e146a16..08be2c5 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -532,6 +532,29 @@ FASTPythonSSATest >> testMethodParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - queries' } +FASTPythonSSATest >> testQueryVariableDefinitions [ + + | lastVariableAccess | + self parseAndResolve: 'x = 2 + +x = 3 + +if z > 4: + x = 5 + +print(x)'. + + lastVariableAccess := model module statements last arguments first. + self assert: lastVariableAccess name equals: 'x'. + + self assert: lastVariableAccess ssaVersion isPhi. + + self assert: lastVariableAccess ssaVersion localUses size equals: 3. "2 write and 1 read." + self assert: lastVariableAccess ssaVersion readAccesses size equals: 1. + self assert: lastVariableAccess ssaVersion writeAccesses size equals: 2 +] + { #category : 'tests - for' } FASTPythonSSATest >> testReAssignedVariableInFor [ From 3f92180c02141dbf2da86156c55bd1d9c8de6445 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 13 Aug 2026 10:10:19 +0200 Subject: [PATCH 121/151] Fix shadowing of attribute accesses --- src/FAST-Python-Model/FASTPyAttributeAccess.class.st | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index 3fdd8be..b3f5460 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -66,6 +66,12 @@ FASTPyAttributeAccess >> isInstanceVariableAccess [ ^ false ] +{ #category : 'as yet unclassified' } +FASTPyAttributeAccess >> localResolverKind [ + + ^ #variable +] + { #category : 'accessing' } FASTPyAttributeAccess >> methodDefinition [ "In case I am inside a method definition, return this method." From d6ec1fd39a7b333054ebc67bacccf15818958c42 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 13 Aug 2026 16:42:06 +0200 Subject: [PATCH 122/151] =?UTF-8?q?Add=20test=20on=20new=20query=20API?= =?UTF-8?q?=E2=80=AFof=20FAST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonSSATest.class.st | 23 --- .../FASTPythonVariablesAnalysisTest.class.st | 195 ++++++++++++++++++ 2 files changed, 195 insertions(+), 23 deletions(-) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 08be2c5..e146a16 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -532,29 +532,6 @@ FASTPythonSSATest >> testMethodParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] -{ #category : 'tests - queries' } -FASTPythonSSATest >> testQueryVariableDefinitions [ - - | lastVariableAccess | - self parseAndResolve: 'x = 2 - -x = 3 - -if z > 4: - x = 5 - -print(x)'. - - lastVariableAccess := model module statements last arguments first. - self assert: lastVariableAccess name equals: 'x'. - - self assert: lastVariableAccess ssaVersion isPhi. - - self assert: lastVariableAccess ssaVersion localUses size equals: 3. "2 write and 1 read." - self assert: lastVariableAccess ssaVersion readAccesses size equals: 1. - self assert: lastVariableAccess ssaVersion writeAccesses size equals: 2 -] - { #category : 'tests - for' } FASTPythonSSATest >> testReAssignedVariableInFor [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st new file mode 100644 index 0000000..e0ab66d --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st @@ -0,0 +1,195 @@ +" +I am a test case to test some analysis on variables in Python. +" +Class { + #name : 'FASTPythonVariablesAnalysisTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' +} + +{ #category : 'parsing' } +FASTPythonVariablesAnalysisTest >> parseAndResolve: aString [ + + self parse: aString. + FASTPythonSSAVisitor resolve: model module +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAllAccessesOfIdentifier [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable allAccesses. + self assert: result size equals: 5. + + self assertCollection: model module statements second arguments first allAccesses hasSameElements: result. + self assertCollection: model module statements third left allAccesses hasSameElements: result. + self assertCollection: model module statements fourth thenClause statements first left allAccesses hasSameElements: result. + self assertCollection: model module statements fifth arguments first allAccesses hasSameElements: result +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAllReadAccessesOfIdentifier [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable allReadAccesses. + self assert: result size equals: 2. + self assertCollection: result hasSameElements: { + model module statements second arguments first. + model module statements fifth arguments first }. + + self assertCollection: model module statements second arguments first allReadAccesses hasSameElements: result. + self assertCollection: model module statements third left allReadAccesses hasSameElements: result. + self assertCollection: model module statements fourth thenClause statements first left allReadAccesses hasSameElements: result. + self assertCollection: model module statements fifth arguments first allReadAccesses hasSameElements: result +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAllWriteAccessesOfIdentifier [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable allWriteAccesses. + self assert: result size equals: 3. + self assertCollection: result hasSameElements: { + model module statements first left. + model module statements third left. + model module statements fourth thenClause statements first left }. + + self assertCollection: model module statements second arguments first allWriteAccesses hasSameElements: result. + self assertCollection: model module statements third left allWriteAccesses hasSameElements: result. + self assertCollection: model module statements fourth thenClause statements first left allWriteAccesses hasSameElements: result. + self assertCollection: model module statements fifth arguments first allWriteAccesses hasSameElements: result +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testVersionAccessesOfIdentifier [ + + | variableVersion1 variableVersion2 variableVersion3 variablePhi | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variableVersion1 := model module statements first left. + self assert: variableVersion1 versionAccesses size equals: 2. + self assertCollection: variableVersion1 versionAccesses hasSameElements: { + variableVersion1. + model module statements second arguments first }. + + variableVersion2 := model module statements third left. + self assertCollection: variableVersion2 versionAccesses hasSameElements: { + variableVersion2. + model module statements fifth arguments first }. + + variableVersion3 := model module statements fourth thenClause statements first left. + self assertCollection: variableVersion3 versionAccesses hasSameElements: { + variableVersion3. + model module statements fifth arguments first }. + + variablePhi := model module statements fifth arguments first. + self assertCollection: variablePhi versionAccesses hasSameElements: { + variableVersion2. + variableVersion3. + model module statements fifth arguments first } +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testVersionReadAccessesOfIdentifier [ + + | variableVersion1 variableVersion2 variableVersion3 variablePhi | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variableVersion1 := model module statements first left. + self assertCollection: variableVersion1 versionReadAccesses hasSameElements: { model module statements second arguments first }. + + variableVersion2 := model module statements third left. + self assertCollection: variableVersion2 versionReadAccesses hasSameElements: { model module statements fifth arguments first }. + + variableVersion3 := model module statements fourth thenClause statements first left. + self assertCollection: variableVersion3 versionReadAccesses hasSameElements: { model module statements fifth arguments first }. + + variablePhi := model module statements fifth arguments first. + self assertCollection: variablePhi versionReadAccesses hasSameElements: { model module statements fifth arguments first } +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testVersionWriteAccessesOfIdentifier [ + + | variableVersion1 variableVersion2 variableVersion3 variablePhi | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variableVersion1 := model module statements first left. + self assertCollection: variableVersion1 versionWriteAccesses hasSameElements: { variableVersion1 }. + + variableVersion2 := model module statements third left. + self assertCollection: variableVersion2 versionWriteAccesses hasSameElements: { variableVersion2 }. + + variableVersion3 := model module statements fourth thenClause statements first left. + self assertCollection: variableVersion3 versionWriteAccesses hasSameElements: { variableVersion3 }. + + variablePhi := model module statements fifth arguments first. + self assertCollection: variablePhi versionWriteAccesses hasSameElements: { + variableVersion2. + variableVersion3 } +] From be5642a0245c6c4f8df1f536f3abdce5c510e825 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 13 Aug 2026 16:45:39 +0200 Subject: [PATCH 123/151] Update documentation --- resources/doc/analysis.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/doc/analysis.md b/resources/doc/analysis.md index ed3cb35..153c02d 100644 --- a/resources/doc/analysis.md +++ b/resources/doc/analysis.md @@ -256,12 +256,12 @@ We can do this: ```smalltalk lastVariableAccess := model module statements last arguments first. -lastVariableAccess ssaVersion. "a FASTVariablePhiVersionSSA ['x_3', 'x_2']" +lastVariableAccess ssaVersion. "a FASTVariablePhiVersionSSA ['x_3', 'x_2'] <= We see here that this variable can come from 2 assignments depending on a condition>" -lastVariableAccess ssaVersion writeAccesses. "an OrderedCollection(PyVariable(18 - 18) PyVariable(36 - 36))" +lastVariableAccess versionWriteAccesses. "an OrderedCollection(PyVariable(18 - 18) PyVariable(36 - 36))" ``` -This will return the write accesses that impacted this use of the variable. +This will return the write accesses that impacted this use of the variable. It will ignore the write accesses that cannot have an impact of this variable. **Where is a variable read?** @@ -270,10 +270,10 @@ With the same python snippet as before we can do: ```smalltalk lastVariableAccess := model module statements last arguments first. -lastVariableAccess ssaVersion readAccesses "an OrderedCollection(PyIdentifier(50 - 50))" +lastVariableAccess versionReadAccesses "an OrderedCollection(PyIdentifier(50 - 50))" ``` -This will return every reading of the variable you are checking for the current SSA version. +This will return every reading of the variable you are checking for the current SSA version. It ignores all read accesses that are not for this version of the variable. **Where is a variable read independently of versions?** @@ -282,7 +282,7 @@ Let's imagine we want all read access to the variable and not just the ones for ```smalltalk variable := model module statements first left. "We could get any access to the variable here, not only the first one." -variable localDeclaration readAccesses. "an OrderedCollection(PyIdentifier(14 - 14) PyIdentifier(50 - 50))" +variable allReadAccesses. "an OrderedCollection(PyIdentifier(14 - 14) PyIdentifier(50 - 50))" ``` **Where is a variable writen independently of version?** @@ -291,10 +291,10 @@ Same as before, we can use the local declaration: ```smalltalk variable := model module statements first left. "We could get any access to the variable here, not only the first one." -variable localDeclaration writeAccesses "an OrderedCollection(PyVariable(1 - 1) PyVariable(18 - 18) PyVariable(36 - 36))" +variable allWriteAccesses "an OrderedCollection(PyVariable(1 - 1) PyVariable(18 - 18) PyVariable(36 - 36))" ``` -> For both local declaration and SSA version it is possible to ask for `localUses` to get read and write accesses in one go. +> We can also use `#allAccesses` and `#versionAccesses` to mix read and write accesses. **What is the assignment node of the variable I am manipulating?** From fda11376b5f51a7032d695ccc0c41c2c70005e16 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 13 Aug 2026 17:47:24 +0200 Subject: [PATCH 124/151] Begin to implement the assigned expressions --- .../FASTPyAssignment.class.st | 6 ++++++ src/FAST-Python-Model/FASTPyEntity.class.st | 6 ++++++ .../FASTPyForInClause.class.st | 6 ++++++ .../FASTPyForStatement.class.st | 6 ++++++ .../FASTPythonVariablesAnalysisTest.class.st | 20 +++++++++++++++++++ 5 files changed, 44 insertions(+) diff --git a/src/FAST-Python-Model/FASTPyAssignment.class.st b/src/FAST-Python-Model/FASTPyAssignment.class.st index bbc885c..a4aa481 100644 --- a/src/FAST-Python-Model/FASTPyAssignment.class.st +++ b/src/FAST-Python-Model/FASTPyAssignment.class.st @@ -42,6 +42,12 @@ FASTPyAssignment class >> annotation [ ] +{ #category : 'accessing' } +FASTPyAssignment >> assignedExpressions [ + + ^ { self right } +] + { #category : 'testing' } FASTPyAssignment >> isDeclaration [ diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index ac9cc73..cb25539 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -50,6 +50,12 @@ FASTPyEntity class >> metamodel [ ^ FASTPyModel metamodel ] +{ #category : 'accessing' } +FASTPyEntity >> assignedExpressions [ + + ^ Array empty +] + { #category : 'testing' } FASTPyEntity >> hasImmediateSource [ diff --git a/src/FAST-Python-Model/FASTPyForInClause.class.st b/src/FAST-Python-Model/FASTPyForInClause.class.st index 36f36da..741360b 100644 --- a/src/FAST-Python-Model/FASTPyForInClause.class.st +++ b/src/FAST-Python-Model/FASTPyForInClause.class.st @@ -31,6 +31,12 @@ FASTPyForInClause class >> annotation [ ] +{ #category : 'accessing' } +FASTPyForInClause >> assignedExpressions [ + + ^ { self right } +] + { #category : 'accessing' } FASTPyForInClause >> left [ "Relation named: #left type: #FASTPyExpression opposite: #parentForInClauseLeft" diff --git a/src/FAST-Python-Model/FASTPyForStatement.class.st b/src/FAST-Python-Model/FASTPyForStatement.class.st index 657ccd3..9b38302 100644 --- a/src/FAST-Python-Model/FASTPyForStatement.class.st +++ b/src/FAST-Python-Model/FASTPyForStatement.class.st @@ -49,6 +49,12 @@ FASTPyForStatement class >> annotation [ ] +{ #category : 'accessing' } +FASTPyForStatement >> assignedExpressions [ + + ^ { self right } +] + { #category : 'accessing' } FASTPyForStatement >> left [ "Relation named: #left type: #FASTPyExpression opposite: #parentForStatementLeft" diff --git a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st index e0ab66d..223f72f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st @@ -98,6 +98,26 @@ print(x)'. self assertCollection: model module statements fifth arguments first allWriteAccesses hasSameElements: result ] +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAssignedExpressionsMap [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable assignedExpressionsMap. + self skip "TODO: add assertions." +] + { #category : 'tests' } FASTPythonVariablesAnalysisTest >> testVersionAccessesOfIdentifier [ From 7dcf0f7c43eb659bcad6de2e7cd0550fd622fe96 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 14 Aug 2026 10:19:11 +0200 Subject: [PATCH 125/151] Test assigned expressions map (basic test) --- .../FASTPythonVariablesAnalysisTest.class.st | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st index 223f72f..12bd13b 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st @@ -101,7 +101,7 @@ print(x)'. { #category : 'tests' } FASTPythonVariablesAnalysisTest >> testAssignedExpressionsMap [ - | variable result | + | writenVariable1 writenVariable2 writenVariable3 map | self parseAndResolve: 'x = 1 print(x) @@ -113,9 +113,20 @@ if y > 3: print(x)'. - variable := model module statements first left. - result := variable assignedExpressionsMap. - self skip "TODO: add assertions." + writenVariable1 := model module statements first left. + writenVariable2 := model module statements third left. + writenVariable3 := model module statements fourth thenClause statements first left. + + map := model module statements second arguments first assignedExpressionsMap. + + self assert: map size equals: 1. + self assertCollection: (map at: writenVariable1) hasSameElements: { model module statements first right }. + + map := map := model module statements fifth arguments first assignedExpressionsMap. + + self assert: map size equals: 2. + self assertCollection: (map at: writenVariable2) hasSameElements: { model module statements third right }. + self assertCollection: (map at: writenVariable3) hasSameElements: { model module statements fourth thenClause statements first right } ] { #category : 'tests' } From ece306f76f33bb3d11473c27c204a7f66561d4b9 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 14 Aug 2026 15:03:31 +0200 Subject: [PATCH 126/151] Ensure the assigned variable map works on loops --- .../FASTPythonVariablesAnalysisTest.class.st | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st index 12bd13b..ff0d949 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st @@ -129,6 +129,37 @@ print(x)'. self assertCollection: (map at: writenVariable3) hasSameElements: { model module statements fourth thenClause statements first right } ] +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAssignedExpressionsMapWithLoop [ + + | writenVariable1 writenVariable2 writenVariable3 map | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +for x in coll: + print(x) + +print(x)'. + + writenVariable1 := model module statements first left. + writenVariable2 := model module statements third left. + writenVariable3 := model module statements fourth left. + + map := model module statements second arguments first assignedExpressionsMap. + + self assert: map size equals: 1. + self assertCollection: (map at: writenVariable1) hasSameElements: { model module statements first right }. + + map := map := model module statements fifth arguments first assignedExpressionsMap. + + self assert: map size equals: 2. + self assertCollection: (map at: writenVariable2) hasSameElements: { model module statements third right }. + self assertCollection: (map at: writenVariable3) hasSameElements: { model module statements fourth right } +] + { #category : 'tests' } FASTPythonVariablesAnalysisTest >> testVersionAccessesOfIdentifier [ From 99fe66886238bfea73c7415aea37fc1276b4c493 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 14 Aug 2026 15:36:17 +0200 Subject: [PATCH 127/151] Update documentation --- resources/doc/analysis.md | 115 +++++++++++++++++++++++++++++++++++--- 1 file changed, 108 insertions(+), 7 deletions(-) diff --git a/resources/doc/analysis.md b/resources/doc/analysis.md index 153c02d..5be6183 100644 --- a/resources/doc/analysis.md +++ b/resources/doc/analysis.md @@ -7,7 +7,11 @@ A general note: When we import an entity, we cannot know if it is a variable, a - [Doing analysis on FASTPython](#doing-analysis-on-fastpython) - [Local resolution](#local-resolution) - [Shadowing](#shadowing) + - [Querying local resolver information](#querying-local-resolver-information) - [Static Single Assignment (SSA)](#static-single-assignment-ssa) + - [Building](#building) + - [Exploiting the SSA](#exploiting-the-ssa) + - [Assigned expressions](#assigned-expressions) - [Limitations of local resolver and SSA](#limitations-of-local-resolver-and-ssa) - [Attribute accesses](#attribute-accesses) - [Subscript content](#subscript-content) @@ -46,9 +50,60 @@ In the case of a shadowing, we manage it in two distinct ways: - If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration - If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration +### Querying local resolver information + +It is possible to ask a few things to the nodes once the resolution is done: +- `node localDeclaration` returns the first node that declared the entity we are querying +- `node localDeclaration localUses` returns all uses of the node (declarations and usage) +- `node allAccesses` if the node is a variable, returns all the read and write accesses to the variable +- `node allReadAccesses` if the node is a variable, returns all the read accesses to the variable +- `node allWriteAccesses` if the node is a variable, returns all the write accesses to the variable +- `node variableDeclarator` if the node that is a variable write access, it will return the node assigning the variable (can be an assignment, augmented assignment, for loop or for in clause) +- `node allAssignedExpressionsMap` if the node is a variable, return a map of all expressions used to assigned the variable. The keys of the map are all the write accesses of this variable and the values are the expressions used for the assignment. + +For `#allAssignedExpressionsMap`, be carful, `x = 3` is not the only way to assign a variable. Take those cases into account: + +```python +x = 3 +``` + +For x + +Assigned expression: `3` + +```python +x, (y, z) = (3, (4, 5)) +``` + +Assigned expression: `(3, (4, 5))` + +> Note: in case of tuples or lists, we do not select the right element in the tuple/list. Especially since it can be given via a variable or a call. + +```python +for x in range(0): + print(x) +``` + +Assigned expression: `range(0)` + +```python +[c for c in coll] +``` + +Assigned expression: `coll` + +```python +x += 1 +``` + +Assigned expression: `1` + +Be carful, it does not know with the addition method of `x` will do if it is an object. ## Static Single Assignment (SSA) +### Building + FASTPython includes `FASTPythonSSAVisitor` to build a SSA form of the AST. The goal of the SSA is to know for each use of a variable, the assignation or assignations linked to this usage. It can be run like this: @@ -57,6 +112,15 @@ It can be run like this: FASTPythonSSAVisitor resolve: model module ``` +Another possibility is to import via `FASTPythonImporter` using `#parseAndResolve:` or `parseFileAndResolve:` instead of just parsing. + +```smalltalk +FASTPythonImporter parseAndResolve: 'x = 3 +print(x)' withPlateformLineEndings +``` + +### Exploiting the SSA + Two little examples: ```python @@ -82,7 +146,7 @@ In this new case, the second printing can have two different value depending on You can ask any node representing a variable for its `#ssaVersion`. This version can either be a `FASTVariableVersionSSA` or a `FASTPhiVersionSSA`. It will be a Phi if it can have multiple versions. -All versions know the local declaration of the variable (which allow to find all usages independently of the assignemnt) and you can use `#localUses` to find all the uses of the variable **for the current SSA version**. +All versions know the local declaration of the variable (which allow to find all usages independently of the assignment) and you can use `#localUses` to find all the uses of the variable **for the current SSA version**. For example: @@ -103,6 +167,19 @@ Asking `#ssaVersion` to the `FASTPyVariable` node of `x = 3`, it will return the It is possible to ask to a model or a group for the SSA versions inside it using `#allSSAVersions`. +On top of this, it is possible to get information via the SSA directly with the API of the variables nodes: +- `node versionAccesses` returns all the read and write accesses for this sepcific version of the variable +- `node versionReadAccesses` returns all the real accesses for this specific version of the variable +- `node versionWriteAccesses` returns all the write accesses for this specific version of the variable + +### Assigned expressions + +It is also possible to query what is assigned in variables once the SSA is done: +- `node variableDeclarator` for a node that is a write access to a variable, it will return the node assigning the variable +- `node assignedExpressionsMap` for a variable, return a map of all expressions used to assigned the variable. The keys of the map are the write accesses that can impact the value of this variable. In some cases there will be only one. But if the variable is assigned in a conditional expression, it will get one entry by assignment that can impact the current variable value + +> Note: you can find some warnings on this in the section [Querying local resolver information](#querying-local-resolver-information). They are the same. + ## Limitations of local resolver and SSA Multiple limitations are present in those two algorithms. Some because it is impossible to do. Some others because we did not take the time to push the implementation further. @@ -217,11 +294,15 @@ Some general properties got added such as: - `FASTPyMethodDefinition>>isAbstract` to know if a method is abstract - `FASTPyMethodDefinition>>selfName` to know the name of the self parameter (will be nil for static methods) -TODO: Document more +For nodes representing a write access to a variable (it is possible to find them easily once we resolved our project with the local resolver or the SSA), we can find the expressions used in their writing by using `#assignedExpressions` on the node. + +> Note: you can find some warnings on this in the section [Querying local resolver information](#querying-local-resolver-information). They are the same. + +TODO: Document more ## Examples of analysis -In this section I'll show how to answer some questions we might have. +In this section I'll show how to answer some questions I was asked to answer with FAST-Python. The examples will use `#parseAndResolve:` from the python importer that parse a piece of code and launch the local resolver and SSA resolution. @@ -298,7 +379,7 @@ variable allWriteAccesses "an OrderedCollection(PyVariable(1 - 1) PyVariable(18 **What is the assignment node of the variable I am manipulating?** -It is possible to get the nodes doing the assignemnts this way: +It is possible to get the nodes doing the assignments this way: ```smalltalk lastVariableAccess := model module statements last arguments first. @@ -306,8 +387,28 @@ lastVariableAccess := model module statements last arguments first. lastVariableAccess ssaVersion writeAccesses collect: [ :access | access variableDeclarator ] "an OrderedCollection(PyAssignment(18 - 22) PyAssignment(36 - 40))" ``` -The assignemnts nodes can be an assignemnt, a for, an augmented assignment or a for in clause. +The assignments nodes can be an assignment, a for, an augmented assignment or a for in clause. + +Do not forget that an assignment can be done to a tuple or list. + +Also, there can be multiple ones, as shown in the example, in case of a phi version. + +**What expressions are used to do the assignment?** + +It is possible to know all possible expressions involved in the assignment of a variable like this: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess assignedExpressionsMap + +"a Dictionary( + PyVariable(18 - 18)->#( PyInteger(22 - 22) ) + PyVariable(36 - 36)->#( PyInteger(40 - 40) ) )" +``` + +It returns a dictionary with the possible write accesses as key and the expressions involved in the writing as values. -Do not forget that an assignemnt can be done to a tuple or list. +> Note: you can find some warnings on this in the section [Querying local resolver information](#querying-local-resolver-information). They are the same. -Also, there can be multiple ones, as shown in the example, in case of a phi version. \ No newline at end of file +> Note 2: You can also use `#allAssignedExpressionsMap` if you want to consider all write accesses to a variable and not just the one impacting a specific access. Or you can use `#assignedExpressions` on a specific write access to have information only on this one. \ No newline at end of file From 5b3929af7e4238296826e935a9090efeb8b3928b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 14 Aug 2026 16:34:33 +0200 Subject: [PATCH 128/151] FIxes #142 --- .../FASTPythonLocalResolverTest.class.st | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 804c815..9d849e5 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1002,6 +1002,26 @@ FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ self assert: usedVariable equals: declaration localDeclaration localUses second ] +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testNonLocalAttributesAccessesAreLinked [ + + | usedVariable1 usedVariable2 | + self parseAndResolve: 'import x + +a(x.y) +b(x.y)'. + + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration isNonLocalDeclaration. + self assert: usedVariable1 localDeclaration localUses size equals: 2. + self assert: usedVariable1 equals: usedVariable1 localDeclaration localUses first. + + usedVariable2 := model module statements third arguments first. + self assert: usedVariable2 localDeclaration equals: usedVariable1 localDeclaration. + self assert: usedVariable2 equals: usedVariable1 localDeclaration localUses second +] + { #category : 'tests - non local declarations' } FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ From 783f4f7c95e870ba893cfcfccb2b34347e0c9970 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 14 Aug 2026 17:18:29 +0200 Subject: [PATCH 129/151] Fix bug of impornt shadowing an attribute access global declaration --- .../FASTPyAttributeAccess.class.st | 6 --- .../FASTPyAttributeAccess.extension.st | 7 ++++ .../FASTPythonLocalResolverTest.class.st | 39 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 5 +-- 4 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index b3f5460..3fdd8be 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -66,12 +66,6 @@ FASTPyAttributeAccess >> isInstanceVariableAccess [ ^ false ] -{ #category : 'as yet unclassified' } -FASTPyAttributeAccess >> localResolverKind [ - - ^ #variable -] - { #category : 'accessing' } FASTPyAttributeAccess >> methodDefinition [ "In case I am inside a method definition, return this method." diff --git a/src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st new file mode 100644 index 0000000..1b02491 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyAttributeAccess' } + +{ #category : '*FAST-Python-Tools-Tests' } +FASTPyAttributeAccess >> localResolverKind [ + + ^ #variable +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 9d849e5..29be27b 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -486,6 +486,45 @@ print(y.x)'. self assert: attributeReceiver localDeclaration name equals: 'y' ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalAttributeShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | assignedVariable usedVariable import importedEntity usedImportedEntity | + self parseAndResolve: 'x.y = 1 +print(x.y) + +import x.y + +print(x.y)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'y'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'y'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ "Here we cannot know if the second printing is of a variable." diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index 1b79fc2..fdefd17 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -156,10 +156,7 @@ FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ anImport importedEntities do: [ :entity | entity hasAlias ifTrue: [ self ensureDeclarationOf: entity named: entity alias declaration: anImport ] - ifFalse: [ - entity segments size = 1 - ifTrue: [ self ensureDeclarationOf: entity named: entity segments last declaration: anImport ] - ifFalse: [ self flag: #todo "I don't know yet how to manage this" ] ] ]. + ifFalse: [ self ensureDeclarationOf: entity named: entity sourceCode declaration: anImport ] ]. super visitFASTPyImport: anImport ] From 32b0274dfd3957909693a261f965b3eedc94b2c2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 14 Aug 2026 19:05:17 +0200 Subject: [PATCH 130/151] Fix skipped tests --- .../FASTPythonLocalResolverTest.class.st | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 29be27b..b61c96d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -576,7 +576,6 @@ import a as x print(x)'. - self skip. "We need to update the behavior" assignedVariable := model module statements first left. self assert: assignedVariable localDeclaration equals: assignedVariable. self assert: assignedVariable localDeclaration name equals: 'x'. @@ -590,7 +589,7 @@ print(x)'. self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses second. - self deny: model module statements fourth arguments first hasLocalDeclaration + self deny: model module statements fourth arguments first localDeclaration equals: assignedVariable localDeclaration ] { #category : 'tests - shadowing' } @@ -607,7 +606,6 @@ def f(): print(matplotlib)'. - self skip. "To update and fix" assignedVariable := model module statements first left. self assert: assignedVariable localDeclaration equals: assignedVariable. self assert: assignedVariable localDeclaration name equals: 'matplotlib'. From c3a74781bd4227cee45f41cbbc8fefe88dfb9eaf Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 17 Aug 2026 10:21:30 +0200 Subject: [PATCH 131/151] Finish to test shadowing of attributes --- .../FASTPythonLocalResolverTest.class.st | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index b61c96d..b512ed0 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -525,6 +525,38 @@ print(x.y)'. self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalAttributeShadowedByImportInFunction [ + + | assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'y.x = 3 + +print(y.x) + +def f(): + import y.x + return y.x + +print(y.x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fourth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ "Here we cannot know if the second printing is of a variable." From b482919a409c864b238b76a88b69908a3d0d25e3 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 17 Aug 2026 15:06:07 +0200 Subject: [PATCH 132/151] Manages variables used as call receivers --- .../FASTPythonLocalResolverTest.class.st | 60 +++++++++++++++++++ .../FASTPythonSSATest.class.st | 54 +++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index b512ed0..d9fe1b8 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -204,6 +204,66 @@ x.y'. self assert: value localDeclaration localUses first equals: value ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCallOnGlobal [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x()'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second callee. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCallOnGlobalAttribute [ + + | assignedVariable usedVariable | + self parseAndResolve: 'y.x = 1 +y.x()'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second callee. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCallOnGlobalSlice [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x[1] = 1 +x[1]()'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration value name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second callee. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index e146a16..ca98ed5 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1132,3 +1132,57 @@ FASTPythonSSATest >> testUndeclaredVariable [ undeclared := model module statements first arguments first. self assert: undeclared ssaVersion isNil ] + +{ #category : 'tests - calls' } +FASTPythonSSATest >> testVariableAttributeUsedinACall [ + + | assignedVar usedVar | + self parseAndResolve: 'x.y = z + +x.y()'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x.y_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second callee. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - calls' } +FASTPythonSSATest >> testVariableSliceUsedinACall [ + + | assignedVar usedVar | + self parseAndResolve: 'x[1] = z + +x[1]()'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x[1]_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second callee. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - calls' } +FASTPythonSSATest >> testVariableUsedinACall [ + + | assignedVar usedVar | + self parseAndResolve: 'x = z + +x()'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second callee. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] From 629a4a9f90d3a3ea184f2fe466866685ed345741 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 17 Aug 2026 15:48:10 +0200 Subject: [PATCH 133/151] Test that imports in function do not shadow variables outside of the scope of the function --- .../FASTPythonLocalResolverTest.class.st | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index d9fe1b8..7e02457 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -865,6 +865,40 @@ FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testImportInFunctionDoesNotShadow [ + + | assignedVariable usedVariable import importedEntity | + self parseAndResolve: 'x = 3 + +def f(a): + import x + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + import := model module statements second statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 1. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testImportShadowedByImport [ "Here we cannot know if the second printing is of a variable." From 077a8f4271e238d4ee5155f6e6b5ba0561e167c8 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 17 Aug 2026 16:14:36 +0200 Subject: [PATCH 134/151] Fix bug in shadowing of variables from functions --- .../FASTPythonLocalResolverTest.class.st | 37 +++++++++++++++++++ .../FASTPyFunctionDefinition.extension.st | 7 ++++ 2 files changed, 44 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 7e02457..a47a7f2 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -617,6 +617,43 @@ print(y.x)'. self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third ] +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByFunction [ + + | assignedVariable usedVariable function usedFunction | + self parseAndResolve: 'x = 3 + +print(x) + +def x(): pass + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + function := model module statements third. + self assert: function localDeclaration equals: function. + self assert: function localDeclaration name equals: 'x'. + self deny: function localDeclaration isNonLocalDeclaration. + self assert: function localDeclaration localUses size equals: 2. + self assert: function localDeclaration localUses first equals: function. + + usedFunction := model module statements fourth arguments first. + self assert: usedFunction localDeclaration equals: function. + self assert: usedFunction equals: function localDeclaration localUses second +] + { #category : 'tests - shadowing' } FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ "Here we cannot know if the second printing is of a variable." diff --git a/src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st b/src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st new file mode 100644 index 0000000..6b19c2c --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyFunctionDefinition' } + +{ #category : '*FAST-Python-Tools' } +FASTPyFunctionDefinition >> localResolverKind [ + + ^ #function +] From c91c11276f93f74c73bb47653dd12cb52522f24d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 17 Aug 2026 16:58:16 +0200 Subject: [PATCH 135/151] Add support for shadowing information in the LocalResolver --- src/FAST-Python-Model/FASTPyEntity.class.st | 52 +++++++++++++++++++ .../FASTPythonLocalResolverTest.class.st | 15 ++++-- .../FASTPythonLocalResolverVisitor.class.st | 5 +- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index cb25539..3e6401d 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -195,6 +195,58 @@ FASTPyEntity >> isVariableWriteAccess [ ^ self variableDeclarator isNotNil ] +{ #category : 'accessing' } +FASTPyEntity >> shadowedBy [ + + + + ^ self attributeAt: #shadowedBy ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowedBy: aFASTEntity [ + + | otherSide | + otherSide := self shadowedBy. + + otherSide == aFASTEntity ifTrue: [ ^ aFASTEntity ]. + + aFASTEntity + ifNil: [ + self attributeAt: #shadowedBy put: aFASTEntity. + otherSide shadowing: nil ] + ifNotNil: [ + self attributeAt: #shadowedBy put: aFASTEntity. + aFASTEntity shadowing: self ] +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowing [ + + + + ^ self attributeAt: #shadowing ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowing: aFASTEntity [ + + | otherSide | + otherSide := self shadowing. + + otherSide == aFASTEntity ifTrue: [ ^ aFASTEntity ]. + + aFASTEntity + ifNil: [ + self attributeAt: #shadowing put: aFASTEntity. + otherSide shadowedBy: nil ] + ifNotNil: [ + self attributeAt: #shadowing put: aFASTEntity. + aFASTEntity shadowedBy: self ] +] + { #category : 'accessing' } FASTPyEntity >> variableDeclarator [ "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index a47a7f2..36f0420 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -582,7 +582,10 @@ print(x.y)'. usedImportedEntity := model module statements fourth arguments first. self assert: usedImportedEntity localDeclaration equals: import. - self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + self assert: assignedVariable localDeclaration shadowedBy equals: import. + self assert: importedEntity localDeclaration shadowing equals: assignedVariable ] { #category : 'tests - shadowing' } @@ -651,7 +654,10 @@ print(x)'. usedFunction := model module statements fourth arguments first. self assert: usedFunction localDeclaration equals: function. - self assert: usedFunction equals: function localDeclaration localUses second + self assert: usedFunction equals: function localDeclaration localUses second. + + self assert: assignedVariable localDeclaration shadowedBy equals: function. + self assert: function localDeclaration shadowing equals: assignedVariable ] { #category : 'tests - shadowing' } @@ -690,7 +696,10 @@ print(x)'. usedImportedEntity := model module statements fourth arguments first. self assert: usedImportedEntity localDeclaration equals: import. - self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + self assert: assignedVariable localDeclaration shadowedBy equals: import. + self assert: importedEntity localDeclaration shadowing equals: assignedVariable ] { #category : 'tests - shadowing' } diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index fdefd17..a9ac83b 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -68,7 +68,10 @@ FASTPythonLocalResolverVisitor >> ensureDeclarationOf: aName declaration: aFASTN ifPresent: [ :declaration | declaration localResolverKind = aFASTNode localResolverKind ifTrue: [ ^ declaration ] - ifFalse: [ "If the kind is different, we save a new declaration." + ifFalse: [ + declaration shadowedBy: aFASTNode. + + "If the kind is different, we save a new declaration." aFASTNode ensureLocalUses. scope at: aName put: aFASTNode ] ] ifAbsentPut: [ From daef98bbce7a7922930fc3c778d4ef9760ef446f Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 17 Aug 2026 18:35:25 +0200 Subject: [PATCH 136/151] Manage linking of SSA version even if the variable got shadowed in the middle --- .../FASTPythonSSATest.class.st | 38 +++++++++++++++++++ .../FASTPyEntity.extension.st | 23 +++++++++++ .../FASTPythonSSAVisitor.class.st | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index ca98ed5..f9beceb 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1023,6 +1023,44 @@ print(x)'. assignedVar5 ssaVersion } ] +{ #category : 'tests' } +FASTPythonSSATest >> testSSAVersionFollowPreviouslyShadowedName [ + + | assignedVar1 assignedVar2 usedVar1 usedFunction usedVar2 | + self parseAndResolve: 'x = 3 + +print(x) + +def x(): pass + +print(x) + +x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements second arguments first. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + usedFunction := model module statements fourth arguments first. + self assert: usedFunction ssaVersion isNil. + + assignedVar2 := model module statements fifth left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements sixth arguments first. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testSingleAssignement [ diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 4bb55c7..3316a77 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -12,6 +12,29 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> lastSSAVersion [ + "Return the last active SSA version if there is one. In Python lots of things can shadow each other, so we check if there was not a variable shadowed previously. + + For example: + + x = 3 + + def x(): pass + + x = 4 + + Here the second assignment follow the first one but was interrupted by the function. But we still need to link them in the SSA." + + | entity | + entity := self localDeclaration. + [ + entity := entity shadowing. + entity isNotNil ] whileTrue: [ entity activeVersion ifNotNil: [ :version | ^ version ] ]. + + ^ nil +] + { #category : '*FAST-Python-Tools' } FASTPyEntity >> localResolverKind [ "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st index 6af431c..e0ef531 100644 --- a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -35,7 +35,7 @@ FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ | newSSA | newSSA := FASTVariableVersionSSA for: aFASTEntity. - aFASTEntity localDeclaration activeVersion ifNotNil: [ :lastSSA | newSSA version: lastSSA version ]. + aFASTEntity lastSSAVersion ifNotNil: [ :lastSSA | newSSA version: lastSSA version ]. aFASTEntity localDeclaration activeVersion: newSSA. From 75cdd4b485411182ca8f037905966d6a6a9daf99 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 10:24:02 +0200 Subject: [PATCH 137/151] Add agents file --- AGENTS.md | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..29dda75 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,90 @@ +# AGENTS.md + +Always read and follow the coding conventions in `~/.opencode/AGENTS.md`. + +## What This Is + +A **Pharo Smalltalk** project (not Python) that provides a Famix AST representation for Python code, built on TreeSitter. Part of the [moosetechnology/FAST](https://github.com/moosetechnology/FAST) ecosystem. + +Source code format: **Tonel** (all source in `src/`). + +## Build & Test + +This is a Pharo Smalltalk project. There are no npm/pip/make commands. + +**Install dependencies in a Pharo image:** +```smalltalk +Metacello new + githubUser: 'moosetechnology' project: 'FAST-Python' commitish: 'main' path: 'src'; + baseline: 'FASTPython'; + load +``` + +**CI command (what actually runs):** +```bash +smalltalkci -s Pharo64-13 # or Pharo64-14 +``` +CI is defined in `.github/workflows/tests.yml`. Tests run via `smalltalkci` using the `smalltalk.ston` spec. Coverage is collected in lcov format for `FAST-Python.*` packages. + +There is no local test runner script outside of `smalltalkci`. You need a Pharo image with the project loaded to run tests interactively. + +## Package Structure + +``` +src/ + BaselineOfFASTPython/ -- Metacello baseline (dependency & group definitions) + FAST-Python-Model-Generator/ -- Metamodel generator (Famix code generation) + FAST-Python-Model/ -- Generated model classes (FASTPy*), do NOT edit by hand + FAST-Python-Model-Tests/ -- Model-level tests + FAST-Python-Tools/ -- Importer, CFG, local resolver, SSA, TreeSitter visitor + FAST-Python-Tools-Tests/ -- Tests for tools (importer, CFG, resolver, SSA) +``` + +**Baseline groups:** +- `Core` = Model + Tools +- `Generator` = Model-Generator only +- `Tests` = Model-Tests + Tools-Tests + +**Dependencies** (from baseline): +- `FAST` v3: `github://moosetechnology/FAST:v3/src` (loads `'All'` group) +- `TreeSitter` v2.0.0: `github://Evref-BL/Pharo-Tree-Sitter:v.2.0.0/src` + +## Critical: Model Files Are Generated + +`FAST-Python-Model/` contains ~130 generated class files (`FASTPy*`). These are produced by `FASTPythonMetamodelGenerator` in `FAST-Python-Model-Generator/`. **Do not edit model files directly** -- edit the generator and re-run it. The generator also produces a visitor trait (`FASTPyTVisitor`). + +## Key Entry Points + +| Class | Role | +|-------|------| +| `FASTPythonImporter` | Parse Python source string or file → FAST model. Extends `TSFASTAbstractImporter`. | +| `FASTPythonTreeSitterVisitor` | Walks TreeSitter CST → builds FAST model. 1100+ lines, the core import logic. | +| `FASTPythonCFGVisitor` | Builds control flow graph. Uses `FASTTCFGUtility` trait from FAST. | +| `FASTPythonLocalResolverVisitor` | Links entity usages to their local declarations (scope-aware). | +| `FASTPythonSSAVisitor` | SSA transform. Uses `FASTCFGTVisitor` trait from FAST. Requires local resolution first. | +| `FASTPythonMetamodelGenerator` | Generates the Famix metamodel. Run via `FASTPythonMetamodelGenerator new generate`. | + +**Typical analysis pipeline:** +```smalltalk +model := FASTPythonImporter parseFile: aFile. +FASTPythonLocalResolverVisitor resolve: model module. +model allFunctionDefinitions first cfg. "CFG" +FASTPythonSSAVisitor resolve: model allFunctionDefinitions first. "SSA (after resolution)" +``` + +## Testing + +- **Base test class**: `FASTPythonAbstractTestCase` (in Tools-Tests) -- provides a `parse:` helper that wraps `FASTPythonImporter` with error reporting. +- **Importer tests**: `FASTPythonImporterTest` extends `TSFASTAbstractImporterTest` (from TreeSitter). The test file is ~53k lines -- generated tests for every AST node type. Test generation snippet is in the class comment. +- **CFG/Resolver/SSA tests**: `FASTPythonCFGTest`, `FASTPythonLocalResolverTest`, `FASTPythonSSATest`. + +## Gotchas + +- **TreeSitter python grammar version matters**: After v0.25, expression statements were removed from the tree. If tests fail unexpectedly, check your `tree-sitter-python` version first (see README). +- **Pharo 13 is the primary target**; Pharo 14 is also tested. The baseline references `FAST:v3` which requires Moose 13. +- **The importer uses the master branch** of `TSLibrariesPython` (hardcoded in `FASTPythonTreeSitterVisitor class >> initialize`). +- **`expression --|> statement`**: In Python, expressions can be expression statements. This is reflected in the model hierarchy and affects how the visitor processes nodes. +- **CFG uses `FASTTCFGUtility`** from FAST (the parent project). SSA uses `FASTCFGTVisitor`. These traits define the core graph traversal protocol. +- **Local resolver scope management**: The resolver maintains a `scopes` stack. Shadowing is handled by checking entity kind consistency (same kind = shared declaration, different kind = new declaration). +- **Python 3 only for resolver**: The local resolver is Python 3 scoped. Python 2 comprehension scoping (no scope) is not supported (issue #26). +- **Non-local declarations are not deduplicated**: Each access to an unknown field creates a separate `FASTNonLocalDeclaration` (issue #26 in the repo). From 5a1d46d878040288461166f078f1e5ccb51701f6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 10:49:15 +0200 Subject: [PATCH 138/151] Fix tests --- src/FAST-Python-Tools/FASTPyEntity.extension.st | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index 3316a77..b5b68da 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -28,9 +28,9 @@ FASTPyEntity >> lastSSAVersion [ | entity | entity := self localDeclaration. - [ - entity := entity shadowing. - entity isNotNil ] whileTrue: [ entity activeVersion ifNotNil: [ :version | ^ version ] ]. + [ entity isNotNil ] whileTrue: [ + entity activeVersion ifNotNil: [ :version | ^ version ]. + entity := entity shadowing ]. ^ nil ] From 9625e313cadfa6b981dfa8c84d24a3c6b23e0286 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 16:16:10 +0200 Subject: [PATCH 139/151] LR/SSA: Manage augmented assignments --- .../FASTPythonLocalResolverTest.class.st | 54 ++++++++++++++++++ .../FASTPythonSSATest.class.st | 56 +++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 36f0420..988f6b6 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -204,6 +204,60 @@ x.y'. self assert: value localDeclaration localUses first equals: value ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAugmentedAssignInConditionalLinksToExistingDeclaration [ + + | assignedVariable augmentedVariable usedVariable | + self parseAndResolve: 'x = 3 + +if a: + x += 1 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + augmentedVariable := model module statements second thenClause statements first left. + self assert: augmentedVariable localDeclaration equals: assignedVariable. + self assert: augmentedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAugmentedAssignLinksToExistingDeclaration [ + + | assignedVariable augmentedVariable usedVariable | + self parseAndResolve: 'x = 3 + +x += 1 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + augmentedVariable := model module statements second left. + self assert: augmentedVariable localDeclaration equals: assignedVariable. + self assert: augmentedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testCallOnGlobal [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index f9beceb..40c030f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -242,6 +242,62 @@ print(y.x)'. self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion ] +{ #category : 'tests - augmented assignments' } +FASTPythonSSATest >> testAugmentedAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +x += 1 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - augmented assignments' } +FASTPythonSSATest >> testAugmentedAssignInConditional [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if a: + x += 1 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ From 609152bdf1a21ec4fb6d06402471e20d03c0dfbe Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 16:32:49 +0200 Subject: [PATCH 140/151] LR/SSA: Test else clause in for loop --- .../FASTPythonLocalResolverTest.class.st | 27 ++++++++++++++++++ .../FASTPythonSSATest.class.st | 28 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 988f6b6..43778c8 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -357,6 +357,33 @@ x'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testForElseAssignLinks [ + + | forVariable elseVariable usedVariable | + self parseAndResolve: 'for x in range(5): + pass +else: + x = 10 + +print(x)'. + + forVariable := model module statements first left. + self assert: forVariable localDeclaration equals: forVariable. + self assert: forVariable localDeclaration name equals: 'x'. + self assert: forVariable localDeclaration isVariableWriteAccess. + self deny: forVariable localDeclaration isNonLocalDeclaration. + self assert: forVariable localDeclaration localUses size equals: 3. + + elseVariable := model module statements first elseClause statements first left. + self assert: elseVariable localDeclaration equals: forVariable. + self assert: elseVariable equals: forVariable localDeclaration localUses second. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: forVariable. + self assert: usedVariable equals: forVariable localDeclaration localUses third +] + { #category : 'tests - imports' } FASTPythonLocalResolverTest >> testFromImportedEntity [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 40c030f..d7df6d9 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -298,6 +298,34 @@ print(x)'. assignedVar2 ssaVersion } ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testForElseAndUsage [ + + | assignedVar usedVar assignedVar2 | + self parseAndResolve: 'for x in range(5): + pass +else: + x = 10 + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elseClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ From 73a52230b711f7f22289fe7f5c53e0cd34fe764b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 17:17:54 +0200 Subject: [PATCH 141/151] Ensure nested for loops are working --- .../FASTPythonSSATest.class.st | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index d7df6d9..e30859c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -616,6 +616,36 @@ FASTPythonSSATest >> testMethodParameterUsed [ self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testNestedForLoop [ + + | assignedVarX1 assignedVarX2 usedVar | + self parseAndResolve: 'x = 1 + +for i in range(5): + for j in range(5): + x = i + j + +print(x)'. + + assignedVarX1 := model module statements first left. + self assert: assignedVarX1 ssaVersion version equals: 1. + self assert: assignedVarX1 ssaName equals: 'x_1'. + self assert: assignedVarX1 ssaVersion localUses size equals: 2. + + assignedVarX2 := model module statements second statements first statements first left. + self assert: assignedVarX2 ssaVersion version equals: 2. + self assert: assignedVarX2 ssaName equals: 'x_2'. + self assert: assignedVarX2 ssaVersion localDeclaration equals: assignedVarX1 ssaVersion localDeclaration. + self assert: assignedVarX2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVarX1 ssaVersion. + assignedVarX2 ssaVersion } +] + { #category : 'tests - for' } FASTPythonSSATest >> testReAssignedVariableInFor [ From 91076bb19c4db46cb683305791c8483478bf17ae Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 17:30:31 +0200 Subject: [PATCH 142/151] =?UTF-8?q?LR/SSA:=E2=80=AFTest=20reassignemnts=20?= =?UTF-8?q?in=20while=20loop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonLocalResolverTest.class.st | 27 +++++++++++++++++ .../FASTPythonSSATest.class.st | 29 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 43778c8..f44896b 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1712,6 +1712,33 @@ FASTPythonLocalResolverTest >> testVariableOfForWithTuple [ self assert: usedVariableB equals: declaredB localDeclaration localUses second ] +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testVariableOfWhileReassignVariable [ + + | assignedVariable reAssignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +while a: + x = 4 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + reAssignedVariable := model module statements second statements first left. + self assert: reAssignedVariable localDeclaration equals: assignedVariable. + self assert: reAssignedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index e30859c..dc3fd8f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1338,3 +1338,32 @@ x()'. usedVar := model module statements second callee. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] + +{ #category : 'tests - while' } +FASTPythonSSATest >> testWhileLoopReAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +while a: + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] From c69b5ba196aca63fadf78d88acc600481b9ddabc Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 17:40:10 +0200 Subject: [PATCH 143/151] LR/SSA: Fix bug when a while has an else block --- .../FASTPythonLocalResolverTest.class.st | 27 +++++++++++++++++ .../FASTPythonSSATest.class.st | 30 +++++++++++++++++++ .../FASTPythonLocalResolverVisitor.class.st | 10 +++++++ 3 files changed, 67 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index f44896b..1d010e4 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1766,3 +1766,30 @@ print(glob)'. self assert: usedVariable localDeclaration equals: assignedVariable. self assert: usedVariable equals: assignedVariable localDeclaration localUses third ] + +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testWhileElseAssign [ + + | whileVariable elseVariable usedVariable | + self parseAndResolve: 'while a: + x = 1 +else: + x = 2 + +print(x)'. + + whileVariable := model module statements first statements first left. + self assert: whileVariable localDeclaration equals: whileVariable. + self assert: whileVariable localDeclaration name equals: 'x'. + self assert: whileVariable localDeclaration isVariableWriteAccess. + self deny: whileVariable localDeclaration isNonLocalDeclaration. + self assert: whileVariable localDeclaration localUses size equals: 3. + + elseVariable := model module statements first elseClause statements first left. + self assert: elseVariable localDeclaration equals: whileVariable. + self assert: elseVariable equals: whileVariable localDeclaration localUses second. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: whileVariable. + self assert: usedVariable equals: whileVariable localDeclaration localUses third +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index dc3fd8f..8a88855 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1339,6 +1339,36 @@ x()'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - while' } +FASTPythonSSATest >> testWhileElseAndUsage [ + + | assignedVar1 usedVar assignedVar2 | + self parseAndResolve: 'while a: + x = 1 +else: + x = 2 + +print(x)'. + + assignedVar1 := model module statements first statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elseClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - while' } FASTPythonSSATest >> testWhileLoopReAssignAndUsage [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index a9ac83b..ebe183f 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -189,3 +189,13 @@ FASTPythonLocalResolverVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ super visitFASTPyTCanBeVariable: aTCanBeVariable ] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyWhileStatement: aWhileStatement [ + + "Else block should be visited after the other ones." + self visitFASTTConditionalStatement: aWhileStatement. + self visitFASTTStatementBlock: aWhileStatement. + self visitFASTPyStatement: aWhileStatement. + self visitFASTPyTWithElseClause: aWhileStatement +] From a663972d253e84ecad1db357f6b9c556b02a76d2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 17:51:27 +0200 Subject: [PATCH 144/151] SSA: Test redefinition of var in a for loop (should produce a phi version) --- .../FASTPythonSSATest.class.st | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 8a88855..cb22d48 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -326,6 +326,35 @@ print(x)'. assignedVar2 ssaVersion } ] +{ #category : 'tests - for' } +FASTPythonSSATest >> testForLoopReAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +for i in range(5): + x = i + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - for' } FASTPythonSSATest >> testForVariableUsed [ From e1a516b2ecf527cbed00bf410c0229a13c7881c4 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 20 Aug 2026 17:59:08 +0200 Subject: [PATCH 145/151] LR/SSA: Fix bug in nested ifs + add tests --- .../FASTPythonLocalResolverTest.class.st | 62 +++++++++++++ .../FASTPythonSSATest.class.st | 90 ++++++++++++++++--- .../FASTPythonLocalResolverVisitor.class.st | 12 +++ 3 files changed, 153 insertions(+), 11 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 1d010e4..38daec8 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1292,6 +1292,68 @@ FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ self assert: usedVariable equals: declaration localDeclaration localUses second ] +{ #category : 'tests - if' } +FASTPythonLocalResolverTest >> testNestedIfAssignInner [ + + | assignedOuter assignedInner usedVariable | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + +print(x)'. + + assignedOuter := model module statements first left. + self assert: assignedOuter localDeclaration equals: assignedOuter. + self assert: assignedOuter localDeclaration name equals: 'x'. + self assert: assignedOuter localDeclaration isVariableWriteAccess. + self deny: assignedOuter localDeclaration isNonLocalDeclaration. + self assert: assignedOuter localDeclaration localUses size equals: 3. + + assignedInner := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedInner localDeclaration equals: assignedOuter. + self assert: assignedInner equals: assignedOuter localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedOuter. + self assert: usedVariable equals: assignedOuter localDeclaration localUses third +] + +{ #category : 'tests - if' } +FASTPythonLocalResolverTest >> testNestedIfBothBranchesAssign [ + + | assignedOuter assignedInnerThen assignedInnerElse usedVariable | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + else: + x = 3 + +print(x)'. + + assignedOuter := model module statements first left. + self assert: assignedOuter localDeclaration equals: assignedOuter. + self assert: assignedOuter localDeclaration name equals: 'x'. + self assert: assignedOuter localDeclaration isVariableWriteAccess. + self deny: assignedOuter localDeclaration isNonLocalDeclaration. + self assert: assignedOuter localDeclaration localUses size equals: 4. + + assignedInnerThen := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedInnerThen localDeclaration equals: assignedOuter. + self assert: assignedInnerThen equals: assignedOuter localDeclaration localUses second. + + assignedInnerElse := model module statements second thenClause statements first elseClause statements first left. + self assert: assignedInnerElse localDeclaration equals: assignedOuter. + self assert: assignedInnerElse equals: assignedOuter localDeclaration localUses third. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedOuter. + self assert: usedVariable equals: assignedOuter localDeclaration localUses fourth +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testNonLocalAttributesAccessesAreLinked [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index cb22d48..6dec824 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -58,7 +58,7 @@ print(y)'. self assert: usedVar4 ssaVersion identicalTo: assignedVar2 ssaVersion ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testAssignementInIfInBothBranchesAndUsage [ | assignedVar1 assignedVar2 usedVar | @@ -89,7 +89,7 @@ print(x)'. assignedVar2 ssaVersion } ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testAssignementInIfInThenAndUsage [ | assignedVar2 usedVar | @@ -109,7 +109,7 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testAssignementInIfInThenAndUsage2 [ | assignedVar2 usedVar | @@ -131,7 +131,7 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage [ | assignedVar usedVar | @@ -155,7 +155,7 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage2 [ | assignedVar usedVar | @@ -786,7 +786,46 @@ print(x)'. self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInBothBranchesOfNestedIf [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + else: + x = 3 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second thenClause statements first elseClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - if' } FASTPythonSSATest >> testReAssignementInIf [ | assignedVar1 assignedVar2 | @@ -809,7 +848,7 @@ if y < 2: self assert: assignedVar2 ssaVersion localUses size equals: 1 ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testReAssignementInIfInBothBranchesAndUsage [ | assignedVar1 assignedVar2 assignedVar3 usedVar | @@ -849,7 +888,7 @@ print(x)'. assignedVar3 ssaVersion } ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testReAssignementInIfInThenAndUsage [ | assignedVar1 assignedVar2 usedVar | @@ -880,7 +919,7 @@ print(x)'. assignedVar2 ssaVersion } ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testReAssignementInIfInThenAndUsage2 [ | assignedVar1 assignedVar2 assignedVar3 usedVar | @@ -1049,7 +1088,7 @@ print(x)'. assignedVar3 ssaVersion } ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage [ | assignedVar1 assignedVar2 assignedVar3 usedVar1 usedVar2 | @@ -1099,7 +1138,7 @@ print(x)'. assignedVar3 ssaVersion } ] -{ #category : 'tests - assignments' } +{ #category : 'tests - if' } FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage2 [ | assignedVar1 assignedVar2 assignedVar3 assignedVar4 assignedVar5 usedVar1 usedVar2 | @@ -1166,6 +1205,35 @@ print(x)'. assignedVar5 ssaVersion } ] +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInNestedIf [ + + | assignedVar1 usedVar assignedVar2 | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests' } FASTPythonSSATest >> testSSAVersionFollowPreviouslyShadowedName [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st index ebe183f..0c4f902 100644 --- a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -153,6 +153,18 @@ FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefini self visitFASTPyTDefinition: aFunctionDefinition ] ] +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyIfStatement: anIfStatement [ + "Visit then - elif(s) -> else " + + self visitFASTTConditionalStatement: anIfStatement. + self visitFASTPyStatement: anIfStatement. + + self visitEntity: anIfStatement thenClause. + self visitCollection: anIfStatement elifClauses. + self visitFASTPyTWithElseClause: anIfStatement +] + { #category : 'visiting' } FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ From 34422bc93474ad99eecac9105ff0a8ed9572aacf Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 21 Aug 2026 10:27:49 +0200 Subject: [PATCH 146/151] Importer: Fix list splat in left side of assignment + test --- .../FASTPythonImporterTest.class.st | 84 +++++++++++++++++++ .../FASTPythonTreeSitterVisitor.class.st | 9 +- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index 4be1b1e..538a68a 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -1863,6 +1863,90 @@ FASTPythonImporterTest >> testAssignmentToList [ self assert: self topEntity name equals: 'remote' ] +{ #category : 'tests - assignments' } +FASTPythonImporterTest >> testAssignmentToListSplatInTuple [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testAssignmentToListSplatInTuple " + + self parse: 'a, *b = [1, 2, 3]'. + + self assert: (fast allWithType: FASTPyAssignment) size equals: 1. + self assert: (fast allWithType: FASTPyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTPyInteger) size equals: 3. + self assert: (fast allWithType: FASTPyList) size equals: 1. + self assert: (fast allWithType: FASTPyModule) size equals: 1. + self assert: (fast allWithType: FASTPySplat) size equals: 1. + self assert: (fast allWithType: FASTPyTuple) size equals: 1. + self assert: (fast allWithType: FASTPyVariable) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'a, *b = [1, 2, 3]'. + self assert: (self topEntity isOfType: FASTPyAssignment). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'a, *b'. + self assert: (self topEntity isOfType: FASTPyTuple). + + "Testing value of multivalued relation initializers" + self assert: self topEntity initializers size equals: 2. + + stack push: (stack top initializers at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. + stack pop. + + stack push: (stack top initializers at: 2). + self assert: self topEntity sourceCode equals: '*b'. + self assert: (self topEntity isOfType: FASTPySplat). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTPyVariable). + self assert: (self topEntity isOfType: FASTTVariableEntity). + self assert: self topEntity name equals: 'b'. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '[1, 2, 3]'. + self assert: (self topEntity isOfType: FASTPyList). + + "Testing value of multivalued relation initializers" + self assert: self topEntity initializers size equals: 3. + + stack push: (stack top initializers at: 1). + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTPyInteger). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTNumericalLiteral). + stack pop. + + stack push: (stack top initializers at: 2). + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTPyInteger). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTNumericalLiteral). + stack pop. + + stack push: (stack top initializers at: 3). + self assert: self topEntity sourceCode equals: '3'. + self assert: (self topEntity isOfType: FASTPyInteger). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTNumericalLiteral) +] + { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToList_comprehension [ diff --git a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index cdea4a5..1660d42 100644 --- a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -59,11 +59,15 @@ FASTPythonTreeSitterVisitor >> initialize [ FASTPythonTreeSitterVisitor >> isIdentifierAVariableInTheCurrentContext [ "I am sure that an identifier is a variable in some cases: - It is directly in the left side of an assignation + - It is in a splat used as assignment target (e.g. extended unpacking `a, *b = ...`) - It's in a global statement - It's in a non local statement" (context top field = #left and: [ context top isOfFASTType: FASTPyAssignment ]) ifTrue: [ ^ true ]. + ((context top isOfFASTType: FASTPySplat) and: [ context anySatisfy: [ :entry | entry field = #left and: [ entry isOfFASTType: FASTPyAssignment ] ] ]) ifTrue: [ + ^ true ]. + ^ (context top isOfFASTType: FASTPyGlobalStatement) or: [ context top isOfFASTType: FASTPyNonlocalStatement ] ] @@ -776,7 +780,8 @@ FASTPythonTreeSitterVisitor >> visitListSplat: aTSNode [ { #category : 'visiting - alias' } FASTPythonTreeSitterVisitor >> visitListSplatPattern: aTSNode [ - "In case we are a parameter we skip the children because it always is an identifier" + "In case we are a parameter we skip the children because it always is an identifier. + In any other pattern context (e.g. the left side of an assignment) we visit the node as a classic splat." (self isInParameter: aTSNode) ifTrue: [ | fastEntity | @@ -785,7 +790,7 @@ FASTPythonTreeSitterVisitor >> visitListSplatPattern: aTSNode [ fastEntity name: (self sourceCodeOf: aTSNode collectNamedChild anyOne). ^ fastEntity ]. - ^ self handleNode: aTSNode + ^ self visitListSplat: aTSNode ] { #category : 'visiting' } From 4500e8bdbfa971ec1854ce01d28cd820a5771d27 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 21 Aug 2026 11:05:54 +0200 Subject: [PATCH 147/151] =?UTF-8?q?LR/SSA:=20Add=20tests=20on=20elif=20(I?= =?UTF-8?q?=E2=80=AFmostly=20did=20if/then/else=20until=20now)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonLocalResolverTest.class.st | 31 ++++++++ .../FASTPythonSSATest.class.st | 79 +++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 38daec8..354eeab 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -13,6 +13,37 @@ FASTPythonLocalResolverTest >> parseAndResolve: aString [ FASTPythonLocalResolverVisitor resolve: model module ] +{ #category : 'tests - if' } +FASTPythonLocalResolverTest >> testAssignInElif [ + + | assignedVariable1 assignedVariable2 usedVariable | + self parseAndResolve: 'if a: + x = 1 +elif b: + x = 2 +else: + function() + +print(x)'. + + assignedVariable1 := model module statements first thenClause statements first left. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'x'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 3. + self assert: assignedVariable1 localDeclaration localUses first equals: assignedVariable1. + + assignedVariable2 := model module statements first elifClauses first statements first left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable1. + self assert: assignedVariable2 equals: assignedVariable1 localDeclaration localUses second. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable1. + self deny: usedVariable localDeclaration isNonLocalDeclaration. + self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testAssignementToList [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 6dec824..2d0420a 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -242,6 +242,85 @@ print(y.x)'. self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion ] +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignmentInIfWithMultipleElif [ + + | assignedVar1 assignedVar2 assignedVar3 assignedVar4 usedVar | + self parseAndResolve: 'x = 0 + +if a: + x = 1 +elif b: + x = 2 +elif c: + x = 3 +else: + function() + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + + assignedVar3 := model module statements second elifClauses first statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + + assignedVar4 := model module statements second elifClauses second statements first left. + self assert: assignedVar4 ssaVersion version equals: 4. + self assert: assignedVar4 ssaName equals: 'x_4'. + self assert: assignedVar4 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion. + assignedVar3 ssaVersion. + assignedVar4 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignmentInOneElif [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'if a: + x = 1 +elif b: + x = 2 +else: + function() + +print(x)'. + + assignedVar1 := model module statements first thenClause statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elifClauses first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + { #category : 'tests - augmented assignments' } FASTPythonSSATest >> testAugmentedAssignAndUsage [ From 9c1828080c597637d24333e728da29361c718b36 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 21 Aug 2026 17:14:11 +0200 Subject: [PATCH 148/151] LR/SSA: Begin to manage ternary epressions but it's a WIP Walrus are not supported yet --- .../FASTPythonLocalResolverTest.class.st | 20 ++++++++ .../FASTPythonSSATest.class.st | 46 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 354eeab..59e7097 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1474,6 +1474,26 @@ print(x[3])'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testTernaryExpressionAssign [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 if a else 2 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 2d0420a..4f2814d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -321,6 +321,52 @@ print(x)'. assignedVar2 ssaVersion } ] +{ #category : 'tests - ternary' } +FASTPythonSSATest >> testAssignmentInTernaryExpressionAndUsage [ + + | assignedVar1 usedVar assignedVar2 | + self parseAndResolve: 'x = 3 + +(x := 1) if a else 2 + +print(x)'. + self skip. + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenExpression. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - ternary' } +FASTPythonSSATest >> testAssignmentToTernaryExpressionAndUsage [ + + | assignedVar1 usedVar | + self parseAndResolve: 'x = 1 if a else 2 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + self assert: assignedVar1 ssaVersion localUses first equals: assignedVar1. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar1 ssaVersion. + self assert: usedVar equals: assignedVar1 ssaVersion localUses second +] + { #category : 'tests - augmented assignments' } FASTPythonSSATest >> testAugmentedAssignAndUsage [ From fae596c2f6a305c4b1477b23d0e903878f553ab4 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 21 Aug 2026 17:56:21 +0200 Subject: [PATCH 149/151] LR/SSA: Tests assignemnts in try/catch --- .../FASTPythonLocalResolverTest.class.st | 24 +++++++++++++++++++ .../FASTPythonSSATest.class.st | 21 ++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 59e7097..67c75fb 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1494,6 +1494,30 @@ print(x)'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - try' } +FASTPythonLocalResolverTest >> testTryAssign [ + + | assignedVariable usedVariable | + self parseAndResolve: 'try: + x = 1 +except: + function() + +print(x)'. + + assignedVariable := model module statements first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 4f2814d..e74ac44 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1463,6 +1463,27 @@ print(x[3])'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - try' } +FASTPythonSSATest >> testTryAssignAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'try: + x = 1 +except: + function() + +print(x)'. + + assignedVar := model module statements first statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testTupleAssignement [ From c999cbd0ec6be7556e54aef36740760ee69749bf Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 21 Aug 2026 18:01:24 +0200 Subject: [PATCH 150/151] LR/SSA: Manage except in try --- .../FASTPythonLocalResolverTest.class.st | 24 +++++++++ .../FASTPythonSSATest.class.st | 50 +++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index 67c75fb..a38d008 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -1518,6 +1518,30 @@ print(x)'. self assert: usedVariable equals: assignedVariable localDeclaration localUses second ] +{ #category : 'tests - try' } +FASTPythonLocalResolverTest >> testTryExceptAssign [ + + | assignedVariable usedVariable | + self parseAndResolve: 'try: + function() +except: + x = 1 + +print(x)'. + + assignedVariable := model module statements first excepts first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + { #category : 'tests' } FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index e74ac44..0dd6b2d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -1484,6 +1484,56 @@ print(x)'. self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion ] +{ #category : 'tests - try' } +FASTPythonSSATest >> testTryExceptAssignAndUsage [ + + | assignedVar1 usedVar | + self parseAndResolve: 'try: + function() +except: + x = 1 + +print(x)'. + + assignedVar1 := model module statements first excepts first statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar1 ssaVersion +] + +{ #category : 'tests - try' } +FASTPythonSSATest >> testTryExceptReAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +try: + function() +except: + x = 1 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second excepts first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + { #category : 'tests - assignments' } FASTPythonSSATest >> testTupleAssignement [ From b3ab0beca0da32bec5673f51aa545bed21e15681 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 21 Aug 2026 18:18:55 +0200 Subject: [PATCH 151/151] LR/SSA: Fix problem with assignemnt to an unpacking --- .../FASTPythonLocalResolverTest.class.st | 23 +++++++++++++++++++ .../FASTPythonSSATest.class.st | 21 +++++++++++++++++ .../FASTPyEntity.extension.st | 5 +++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st index a38d008..78b5900 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -44,6 +44,29 @@ print(x)'. self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third ] +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignUnpacking [ + + | assignedVariable1 assignedVariable2 | + self parseAndResolve: 'a, *b = [1, 2, 3]'. + + assignedVariable1 := model module statements first left initializers first. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'a'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 1. + self assert: assignedVariable1 localDeclaration variableDeclarator equals: model module statements first. + + assignedVariable2 := model module statements first left initializers second expression. + self assert: assignedVariable2 localDeclaration equals: assignedVariable2. + self assert: assignedVariable2 localDeclaration name equals: 'b'. + self assert: assignedVariable2 localDeclaration isVariableWriteAccess. + self deny: assignedVariable2 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable2 localDeclaration localUses size equals: 1. + self assert: assignedVariable2 localDeclaration variableDeclarator equals: model module statements first +] + { #category : 'tests - globals' } FASTPythonLocalResolverTest >> testAssignementToList [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st index 0dd6b2d..c8d56ec 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -242,6 +242,27 @@ print(y.x)'. self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion ] +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementToUnpackingAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'a, *b = [1, 2, 3] + +print(a)'. + + assignedVar1 := model module statements first left initializers first. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'a_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first left initializers second expression. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'b_1'. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar1 ssaVersion +] + { #category : 'tests - if' } FASTPythonSSATest >> testAssignmentInIfWithMultipleElif [ diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index b5b68da..f8c0f30 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -46,7 +46,8 @@ FASTPyEntity >> localResolverKind [ { #category : '*FAST-Python-Tools' } FASTPyEntity >> selfOrTopmostAssignableCollection [ - "If I am in a tuple, I return the tuple (this applies recursively, if I am in a tuple in a tuple I return the topmost tuple). + "If I am in a tuple, I return the tuple (this applies recursively, if I am in a tuple in a tuple I return the topmost tuple). + If I am in a splat used as assignment target (e.g. `a, *b = ...`), I also go through the splat. Else, return myself." @@ -56,5 +57,7 @@ FASTPyEntity >> selfOrTopmostAssignableCollection [ [ node collectionInitializer isNotNil and: [ node collectionInitializer isTuple or: [ node collectionInitializer isList ] ] ] whileTrue: [ node := node collectionInitializer ]. + node parentSplat ifNotNil: [ :splat | ^ splat selfOrTopmostAssignableCollection ]. + ^ node ]