Skip to content

Commit

Permalink
Merge ee00fe1
Browse files Browse the repository at this point in the history
  • Loading branch information
IkiAde committed Jun 25, 2024
2 parents d2f2c95 + ee00fe1 commit 1cb06d8
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 437 deletions.
7 changes: 3 additions & 4 deletions src/Fame-ImportExport/FMJSONPrinter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ FMJSONPrinter >> referenceNumber: index [
{ #category : #parsing }
FMJSONPrinter >> serial: index [
stream
stream
nextPutAll: '"id":';
print: index;
nextPut: $,
print: index
]
18 changes: 11 additions & 7 deletions src/Fame-ImportExport/FMModelExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,19 @@ FMModelExporter >> export: aCollectionOfElements [

{ #category : #exporting }
FMModelExporter >> exportEntity: each [

| meta |
meta := model metaDescriptionOf: each.
printer
inEntity: meta fullName
do: [ printer serial: (self indexOf: each).
((self sortedPropertiesOf: meta)
select: [ :property | self shouldExportProperty: property for: each ])
do: [ :property | self exportProperty: property for: each ]
separatedBy: [ printer printPropertySeparator ] ].
printer inEntity: meta fullName do: [
| sortedProperties |
printer serial: (self indexOf: each).
sortedProperties := (self sortedPropertiesOf: meta) select: [
:property |
self shouldExportProperty: property for: each ].
sortedProperties ifNotEmpty: [ printer printPropertySeparator ].
sortedProperties
do: [ :property | self exportProperty: property for: each ]
separatedBy: [ printer printPropertySeparator ] ].
self incrementProgressBar
]

Expand Down
65 changes: 38 additions & 27 deletions src/Fame-Tests/FMDebugImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,51 @@ Class {
#traits : 'FMTImportExportStructure',
#classTraits : 'FMTImportExportStructure classTrait',
#instVars : [
'a'
'tokens'
],
#category : #'Fame-Tests'
}

{ #category : #parsing }
FMDebugImporter >> beginDocument [
a := a copyWith: (Array with: #beginDocument)

tokens := tokens copyWith: (Array with: #beginDocument)
]

{ #category : #parsing }
FMDebugImporter >> beginEntity: name [
a := a copyWith: (Array with: #beginEntity: with: name)
FMDebugImporter >> beginEntity: name [

tokens := tokens copyWith: (Array with: #beginEntity: with: name)
]

{ #category : #parsing }
FMDebugImporter >> beginProperty: name [
a := a copyWith: (Array with: #beginProperty: with: name )
FMDebugImporter >> beginProperty: name [

tokens := tokens copyWith: (Array with: #beginProperty: with: name)
]

{ #category : #accessing }
FMDebugImporter >> contents [
^ a

^ tokens
]

{ #category : #parsing }
FMDebugImporter >> endDocument [
a := a copyWith: (Array with: #endDocument)

tokens := tokens copyWith: (Array with: #endDocument)
]

{ #category : #parsing }
FMDebugImporter >> endEntity: name [
a := a copyWith: (Array with: #endEntity: with: name)
FMDebugImporter >> endEntity: name [

tokens := tokens copyWith: (Array with: #endEntity: with: name)
]

{ #category : #parsing }
FMDebugImporter >> endProperty: name [
a := a copyWith: (Array with: #endProperty: with: name)
FMDebugImporter >> endProperty: name [

tokens := tokens copyWith: (Array with: #endProperty: with: name)
]

{ #category : #accessing }
Expand Down Expand Up @@ -71,35 +78,39 @@ FMDebugImporter >> initialize [
]

{ #category : #parsing }
FMDebugImporter >> primitive: value [
a := a copyWith: (Array with: #primitive: with: value )
FMDebugImporter >> primitive: value [

tokens := tokens copyWith: (Array with: #primitive: with: value)
]

{ #category : #parsing }
FMDebugImporter >> referenceName: name [
a := a copyWith: (Array with: #referenceName: with: name)
FMDebugImporter >> referenceName: name [

tokens := tokens copyWith: (Array with: #referenceName: with: name)
]

{ #category : #parsing }
FMDebugImporter >> referenceNumber: index [
a := a copyWith: (Array with: #referenceNumber: with: index )
FMDebugImporter >> referenceNumber: index [

tokens := tokens copyWith:
(Array with: #referenceNumber: with: index)
]

{ #category : #accessing }
FMDebugImporter >> replayOn: aParseClient [

a do: [ :each |
aParseClient
perform: each first
withArguments: each allButFirst ].
FMDebugImporter >> replayOn: aParseClient [

tokens do: [ :each |
aParseClient perform: each first withArguments: each allButFirst ]
]

{ #category : #initialization }
FMDebugImporter >> reset [
a := #()

tokens := #( )
]

{ #category : #parsing }
FMDebugImporter >> serial: index [
a := a copyWith: (Array with: #serial: with: index )
FMDebugImporter >> serial: index [

tokens := tokens copyWith: (Array with: #serial: with: index)
]
Loading

0 comments on commit 1cb06d8

Please sign in to comment.