Skip to content

Commit

Permalink
Merge 7496acc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed May 17, 2024
2 parents 713cb5e + 7496acc commit 74c9ca2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
14 changes: 13 additions & 1 deletion src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ FamixValue2PharoVisitor >> ensureVisited: value [
ifAbsentPut: [
node := value accept: self.
value referenceCount > 1
ifTrue: [ self varNameFor: value ]
ifTrue: [
| name |
name := self varNameFor: value.
node := RBAssignmentNode
variable: (RBVariableNode named: name)
value: node.
name ]
ifFalse: [ nil ] ].
^ node
]
Expand All @@ -43,6 +49,12 @@ FamixValue2PharoVisitor >> statementBlock [
^ statementBlock ifNil: [ statementBlock := RBSequenceNode new ]
]

{ #category : #visiting }
FamixValue2PharoVisitor >> visitClassReference: aFamixValueOfClassReference [

^ RBVariableNode named: aFamixValueOfClassReference value name
]

{ #category : #visiting }
FamixValue2PharoVisitor >> visitCollection: collection [

Expand Down
26 changes: 14 additions & 12 deletions src/Famix-Value-Importer/Dictionary.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ Dictionary >> asPharoJacksonValueOn: importer [

^ (self removeKey: importer typeKey ifAbsent: nil)
ifNotNil: [ :className | "object of an unloaded class"
importer
importObject: self
of: (importer loadTypeNamed: className) ]
ifNil: [ "species of dictionary"
(self removeKey: importer refKey ifAbsent: nil)
ifNotNil: [ :refId | "if @ref"
importer
getObjectFromIdentity: refId
ifAbsent: [ Error signal: 'unknown id' ] ]
ifNil: [ "if Dictionary there only is @id"
className = 'Class'
ifTrue: [
importer
importDictionary: self
of: (importer loadTypeNamed: self className) ] ]
importClassReference: self
of: (importer loadTypeNamed: className) ]
ifFalse: [
importer
importObject: self
of: (importer loadTypeNamed: className) ] ]
ifNil: [ "species of dictionary"
(self removeKey: importer refKey ifAbsent: nil) ifNotNil: [
:refId | "if @ref"
importer
getObjectFromIdentity: refId
ifAbsent: [ Error signal: 'unknown id' ] ] ]
]

{ #category : #'*Famix-Value-Importer' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ FamixValuePharoJacksonImporter >> importClassReference: rawValue of: type [
The raw value contains the fully qualified name of the referenced class."

^ self model newOfClassReference
value: (self loadTypeNamed: rawValue);
value: (self loadTypeNamed: (rawValue at: 'name'));
type: type
]

Expand Down

0 comments on commit 74c9ca2

Please sign in to comment.