Skip to content

Commit

Permalink
FMMSEParserTest refactoring.
Browse files Browse the repository at this point in the history
Mostly improve readability
  • Loading branch information
ClotildeToullec committed May 21, 2024
1 parent 1d7ba56 commit 0a1717c
Show file tree
Hide file tree
Showing 2 changed files with 499 additions and 426 deletions.
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 0a1717c

Please sign in to comment.