Skip to content

Commit

Permalink
Merge pull request moosetechnology#11 from Gabriel-Darbord/10-Typo-in…
Browse files Browse the repository at this point in the history
…-Assignement

Fix moosetechnology#10
  • Loading branch information
badetitou committed Apr 27, 2023
2 parents c83aeb2 + ae2cfb3 commit 64664af
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CRFBindingBuildMyClassTest >> testAStringIsCorrectlyBind [

self
assert:
(self fastModel allWithType: FASTJavaAssignementExpression) anyOne
(self fastModel allWithType: FASTJavaAssignmentExpression) anyOne
famixVariable
equals:
((self famixModel allWithType: FamixJavaAttribute) detect: [ :att |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ CRFBindingTestTest >> testHelloUsages [
]

{ #category : #tests }
CRFBindingTestTest >> testNewInnerAssignement [
CRFBindingTestTest >> testNewInnerAssignment [
self
assert: (self famixModel allLocalVariables select: [ :localVariable | localVariable name = 'innertButton' ]) anyOne fastDeclaration anyOne
equals: ((self fastModel allWithType: FASTJavaVariableDeclarator) select: [:variableDeclarator | variableDeclarator variable name = 'innertButton' ]) anyOne.
Expand Down Expand Up @@ -152,9 +152,9 @@ CRFBindingTestTest >> testTypeAccessTest [
{ #category : #tests }
CRFBindingTestTest >> testVariableDeclarator [
self
assert: (self famixModel allAttributes select: [ :attribute | attribute name = 'hello' ]) first fastAssignement first
equals: (self fastModel allWithType: FASTJavaAssignementExpression) first.
assert: (self famixModel allAttributes select: [ :attribute | attribute name = 'hello' ]) first fastAssignment first
equals: (self fastModel allWithType: FASTJavaAssignmentExpression) first.
self
assert: (self famixModel allAttributes select: [ :attribute | attribute name = 'hello' ]) first
equals: (self fastModel allWithType: FASTJavaAssignementExpression) first famixVariable
equals: (self fastModel allWithType: FASTJavaAssignmentExpression) first famixVariable
]
10 changes: 5 additions & 5 deletions src/Carrefour-FastAndBindingGenerator/CRFBinderVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ CRFBinderVisitor >> visitFASTEntity: aFASTEntity [
]

{ #category : #visitor }
CRFBinderVisitor >> visitFASTJavaAssignementExpression: aFASTJavaAssignementExpression [
(self determineAttributeWithName: aFASTJavaAssignementExpression variable name from: aFASTJavaAssignementExpression)
CRFBinderVisitor >> visitFASTJavaAssignmentExpression: aFASTJavaAssignmentExpression [
(self determineAttributeWithName: aFASTJavaAssignmentExpression variable name from: aFASTJavaAssignmentExpression)
ifNotNil:
[ :structuralEntity | structuralEntity fastAssignement add: aFASTJavaAssignementExpression ].
[ :structuralEntity | structuralEntity fastAssignment add: aFASTJavaAssignmentExpression ].

super visitFASTJavaAssignementExpression: aFASTJavaAssignementExpression.
super visitFASTJavaAssignmentExpression: aFASTJavaAssignmentExpression.
]

{ #category : #visitor }
Expand Down Expand Up @@ -213,7 +213,7 @@ CRFBinderVisitor >> visitFASTJavaFieldAccess: aFASTJavaFieldAccess [
ifNotNil:
[ :structuralEntity | structuralEntity fastAccesses add: aFASTJavaFieldAccess ].

super visitFASTJavaAssignementExpression: aFASTJavaFieldAccess.
super visitFASTJavaAssignmentExpression: aFASTJavaFieldAccess.
]

{ #category : #visitor }
Expand Down
8 changes: 4 additions & 4 deletions src/Carrefour-Model-Generator/CRFMetamodelGenerator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Class {
'famixMethod',
'fastJavaMethodEntity',
'famixStructuralEntity',
'fastJavaAssignementExpression',
'fastJavaVariableDeclarator',
'fastJavaClassProperty',
'famixType',
Expand All @@ -22,7 +21,8 @@ Class {
'fastEntity',
'fastJavaClassDeclaration',
'fastJavaInterfaceDeclaration',
'fastJavaTypeParameter'
'fastJavaTypeParameter',
'fastJavaAssignmentExpression'
],
#category : #'Carrefour-Model-Generator'
}
Expand Down Expand Up @@ -56,7 +56,7 @@ CRFMetamodelGenerator >> defineClasses [
fastJavaMethodInvocation := self remoteEntity: #MethodInvocation withPrefix: #FASTJava.
fastJavaNew := self remoteEntity: #NewExpression withPrefix: #FASTJava.
famixStructuralEntity := self remoteTrait: #TStructuralEntity withPrefix: #'Famix'.
fastJavaAssignementExpression := self remoteEntity: #AssignementExpression withPrefix: #FASTJava.
fastJavaAssignmentExpression := self remoteEntity: #AssignmentExpression withPrefix: #FASTJava.
fastJavaVariableDeclarator := self remoteEntity: #VariableDeclarator withPrefix: #FASTJava.
fastJavaClassProperty := self remoteEntity: #ClassProperty withPrefix: #FASTJava.
fastJavaTypeParameter := self remoteEntity: #TypeParameterExpression withPrefix: #FASTJava.
Expand All @@ -83,7 +83,7 @@ CRFMetamodelGenerator >> defineRelations [
super defineRelations.
(famixInvocation property: #fast) - (fastExpression property: #famixInvocation).
(famixMethod property: #fast) - (fastEntity property: #famixMethod).
(famixStructuralEntity property: #fastAssignement) -* (fastJavaAssignementExpression property: #famixVariable).
(famixStructuralEntity property: #fastAssignment) -* (fastJavaAssignmentExpression property: #famixVariable).
(famixStructuralEntity property: #fastDeclaration) -* (fastJavaVariableDeclarator property: #famixVariable).

(famixStructuralEntity property: #fastAccesses) -* (fastExpression property: #famixVariable).
Expand Down
6 changes: 0 additions & 6 deletions src/Carrefour-Model/CRFModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@ CRFModel class >> annotation [
<package: #'Carrefour-Model'>
<generated>
]

{ #category : #testing }
CRFModel class >> canBeImportedFromFile [
<generated>
^true
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Extension { #name : #FASTJavaAssignementExpression }
Extension { #name : #FASTJavaAssignmentExpression }

{ #category : #'*Carrefour-Model-accessing' }
FASTJavaAssignementExpression >> famixVariable [
"Relation named: #famixVariable type: #FamixTStructuralEntity opposite: #fastAssignement"
FASTJavaAssignmentExpression >> famixVariable [
"Relation named: #famixVariable type: #FamixTStructuralEntity opposite: #fastAssignment"

<generated>
<FMProperty: #famixVariable type: #FamixTStructuralEntity opposite: #fastAssignement>
<FMProperty: #famixVariable type: #FamixTStructuralEntity opposite: #fastAssignment>
<package: #'Carrefour-Model'>
^ self attributeAt: #famixVariable ifAbsent: [ nil ]
]

{ #category : #'*Carrefour-Model-accessing' }
FASTJavaAssignementExpression >> famixVariable: anObject [
FASTJavaAssignmentExpression >> famixVariable: anObject [

<generated>
self attributeAt: #famixVariable put: (FMMultivalueLink on: self update: #fastAssignement from: self famixVariable to: anObject).
self attributeAt: #famixVariable put: (FMMultivalueLink on: self update: #fastAssignment from: self famixVariable to: anObject).
]
12 changes: 6 additions & 6 deletions src/Carrefour-Model/FamixTStructuralEntity.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ FamixTStructuralEntity >> fastAccesses: anObject [
]

{ #category : #'*Carrefour-Model-accessing' }
FamixTStructuralEntity >> fastAssignement [
"Relation named: #fastAssignement type: #FASTJavaAssignementExpression opposite: #famixVariable"
FamixTStructuralEntity >> fastAssignment [
"Relation named: #fastAssignment type: #FASTJavaAssignmentExpression opposite: #famixVariable"

<generated>
<derived>
<FMProperty: #fastAssignement type: #FASTJavaAssignementExpression opposite: #famixVariable>
<FMProperty: #fastAssignment type: #FASTJavaAssignmentExpression opposite: #famixVariable>
<package: #'Carrefour-Model'>
^ self attributeAt: #fastAssignement ifAbsentPut: [ FMMultivalueLink on: self opposite: #famixVariable: ]
^ self attributeAt: #fastAssignment ifAbsentPut: [ FMMultivalueLink on: self opposite: #famixVariable: ]
]

{ #category : #'*Carrefour-Model-accessing' }
FamixTStructuralEntity >> fastAssignement: anObject [
FamixTStructuralEntity >> fastAssignment: anObject [

<generated>
self fastAssignement value: anObject
self fastAssignment value: anObject
]

{ #category : #'*Carrefour-Model-accessing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ CRFRemoveReferencesTestTest >> testFromFASTRemoveStructuralEntityBinding [
"we check the value at the beginning to avoid breaking the tests"
self assert: (structuralEntities flatCollect: #fastDeclaration) size equals: 4.
self assert: (structuralEntities flatCollect: #fastAccesses) size equals: 16.
self assert: (structuralEntities flatCollect: #fastAssignement) size equals: 2.
self assert: (structuralEntities flatCollect: #fastAssignment) size equals: 2.
self fastTestMethod removeBinding.
self assert: (structuralEntities flatCollect: #fastAccesses) size equals: 0.
self assert: (structuralEntities flatCollect: #fastDeclaration) size equals: 0.
self assert: (structuralEntities flatCollect: #fastAssignement) size equals: 0.
self assert: (structuralEntities flatCollect: #fastAssignment) size equals: 0.
]

{ #category : #running }
Expand Down
6 changes: 3 additions & 3 deletions src/Carrefour-RemoveBinding/CRFBindingCleaner.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ CRFBindingCleaner >> fullClean: anEntity [
]

{ #category : #generated }
CRFBindingCleaner >> visitFASTJavaAssignementExpression: aFASTJavaAssignementExpression [
aFASTJavaAssignementExpression famixVariable: nil.
^ super visitFASTJavaAssignementExpression: aFASTJavaAssignementExpression
CRFBindingCleaner >> visitFASTJavaAssignmentExpression: aFASTJavaAssignmentExpression [
aFASTJavaAssignmentExpression famixVariable: nil.
^ super visitFASTJavaAssignmentExpression: aFASTJavaAssignmentExpression
]

{ #category : #generated }
Expand Down

0 comments on commit 64664af

Please sign in to comment.