Skip to content

Commit

Permalink
The result of ReMethodSourceCleaner clean (spaces in source code)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Van Caekenberghe committed Feb 17, 2023
1 parent 89c7e59 commit 747f140
Show file tree
Hide file tree
Showing 245 changed files with 511 additions and 511 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*STON-Core
fromSton: stonReader
"Read a map representation containing element/occurrences pairs"

| bag |
bag := self new.
stonReader parseMapDo: [ :key :value |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
stonOn: stonWriter
"Use a map with element-occurrences pairs as representation"

stonWriter
writeObject: self
stonWriter
writeObject: self
do: [ stonWriter encodeMap: contents ]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*STON-Core
stonContainSubObjects
stonContainSubObjects
^ false
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*STON-Core
fromSton: stonReader
"Use a hex representation"

^ self readHexFrom: stonReader parseListSingleton
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*STON-Core
stonContainSubObjects
stonContainSubObjects
^ false
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*STON-Core
stonOn: stonWriter
"Use a hex representation"

stonWriter writeObject: self listSingleton: self hex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*STON-Core
stonOn: stonWriter
stonWriter
writeObject: self
stonWriter
writeObject: self
listSingleton: self name asSymbol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fromSton: stonReader
"For collections we chose to instanciate based a list of elements using #add:
This is not the best or most correct solution for all subclasses though,
so some will revert to standard object behavior or chose another solution."

| collection |
collection := self new.
stonReader parseListDo: [ :each |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ stonOn: stonWriter
"For collections we chose to write a list of elements as delivered by #do:
This is not the best or most correct solution for all subclasses though,
so some will revert to standard object behavior or chose another solution"

stonWriter writeObject: self do: [
stonWriter encodeList: self ]
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ fromSton: stonReader
"Read a ISO YYYY-MM-DD format.
Since my current implementation is time zone offset sensitive, the offset has to be taken into account.
A missing offset results in the local timezone offset to be used"

| readStream date |
readStream := stonReader parseListSingleton readStream.
date := self readFrom: readStream.
readStream atEnd
ifFalse: [ | offset |
offset := DateAndTime readTimezoneOffsetFrom: readStream.
offset = date offset
offset = date offset
ifFalse: [ date start: (date start translateTo: offset) ] ].
^ date
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*STON-Core
stonContainSubObjects
stonContainSubObjects
^ false
12 changes: 6 additions & 6 deletions repository/STON-Core.package/Date.extension/instance/stonOn..st
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ stonOn: stonWriter

| representation |
representation := self offset isZero
ifTrue: [
String new: 11 streamContents: [ :out |
ifTrue: [
String new: 11 streamContents: [ :out |
self printOn: out format: #(3 2 1 $- 1 1 2).
out nextPut: $Z ] ]
ifFalse: [
String new: 32 streamContents: [ :out |
ifFalse: [
String new: 32 streamContents: [ :out |
self printOn: out format: #(3 2 1 $- 1 1 2).
out nextPut: (self offset positive ifTrue: [ $+ ] ifFalse: [ $- ]).
self offset hours abs printOn: out base: 10 length: 2 padded: true.
out nextPut: $:.
self offset minutes abs printOn: out base: 10 length: 2 padded: true.
self offset seconds = 0
ifFalse:[
self offset seconds = 0
ifFalse:[
out nextPut: $:; print: self offset seconds abs truncated ] ] ].
stonWriter writeObject: self listSingleton: representation
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*STON-Core
stonContainSubObjects
stonContainSubObjects
^ false
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*STON-Core
stonOn: stonWriter
"Use an ISO representation with all details YYYY-MM-DDTHH:MM:SS.N+TZ (with optional nanoseconds and timezone offset)"
stonWriter writeObject: self listSingleton:

stonWriter writeObject: self listSingleton:
(String streamContents: [ :stream |
self printOn: stream withLeadingSpace: false ])
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
fromSton: stonReader
"Instances of STON mapClass will be read directly and won't arrive here.
Other (sub)classes will use this method."

| dictionary |
dictionary := self new.
stonReader parseMapDo: [ :key :value |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
stonOn: stonWriter
"Instances of STON mapClass will be encoded directly, without a class tag.
Other (sub)classes will be encoded with a class tag and will use a map representation. "

self class == STON mapClass
ifTrue: [
ifTrue: [
stonWriter writeMap: self ]
ifFalse: [
stonWriter
writeObject: self
ifFalse: [
stonWriter
writeObject: self
do: [ stonWriter encodeMap: self ] ]
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
stonPostReferenceResolution
"When references were resolved in me, the hash of my keys might have changed.
Check if I am still healthy and rehash me if not."

self isHealthy ifFalse: [ self rehash ]
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ stonOn: stonWriter
diskFilePath := path isWorkingDirectory
ifTrue: [ '.' ]
ifFalse: [ path pathString ].
stonWriter
writeObject: self
named: STONFileReference stonName
stonWriter
writeObject: self
named: STONFileReference stonName
listSingleton: diskFilePath ]
ifFalse: [
ifFalse: [
super stonOn: stonWriter ]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*STON-Core
fromSton: stonReader
"Overwritten to get back the standard object behavior"

^ self new
fromSton: stonReader;
yourself
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*STON-Core
fromSton: stonReader
"Overwritten to get back the standard object behavior"

stonReader parseNamedInstVarsFor: self
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*STON-Core
stonOn: stonWriter
stonWriter
writeObject: self
writeObject: self
listSingleton: self instanceSide name asSymbol
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*STON-Core
stonContainSubObjects
stonContainSubObjects
^ false
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
fromSton: stonReader
"Create a new instance and delegate decoding to instance side.
Override only when new instance should be created directly (see implementors). "

^ self new
fromSton: stonReader;
yourself
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*STON-Core
stonAllInstVarNames
"Override to encode my instances using a custom set of instance variables or to define their order."

^ self allInstVarNames
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
stonName
"Override to encode my instances using a different class name.
Use symbols as class name/tag."

"Class names are expected to conform
to first STONReader>>#isClassStartChar: then STONReader>>#isClassChar:"

^ self name
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
fromSton: stonReader
"Decode non-variable classes from a map of their instance variables and values.
Override to customize and add a matching #toSton: (see implementors)."
self class isVariable

self class isVariable
ifTrue: [
stonReader error: 'custom #fromSton: implementation needed for variable/indexable class' ]
ifFalse: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
stonContainSubObjects
"Return true if I contain subObjects that should be processed, false otherwise.
Overwrite when necessary. See also #stonProcessSubObjects:"

^ true
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ stonOn: stonWriter
"Encode non-variable classes with a map of their instance variable and values.
Override to customize and add a matching #fromSton: (see implementors)."

self class isVariable
self class isVariable
ifTrue: [
stonWriter error: 'custom #stonOn: implementation needed for variable/indexable class' ]
ifFalse: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ stonProcessSubObjects: block
"Execute block to (potentially) change each of my subObjects.
In general, all instance and indexable variables are processed.
Overwrite when necessary. Not used when #stonContainSubObjects returns false."

1 to: self class instSize do: [ :each |
self instVarAt: each put: (block value: (self instVarAt: each)) ].
(self class isVariable and: [ self class isBytes not ])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*STON-Core
stonShouldWriteNilInstVars
"Return true if my instance variables that are nil should be written out,
"Return true if my instance variables that are nil should be written out,
false otherwise. Overwrite when necessary. By default, return false."

^ false
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*STON-Core
fromSton: stonReader
"My instances are stored as maps."

| dictionary |
dictionary := self new.
stonReader parseMapDo: [ :key :value |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*STON-Core
stonOn: stonWriter
"I store my instances as maps. When in JSON mode,
"I store my instances as maps. When in JSON mode,
encode me directly, without a class tag, keeping the order."
stonWriter jsonMode
ifTrue: [
stonWriter encodeMap: self ]
ifFalse: [
stonWriter
writeObject: self

stonWriter jsonMode
ifTrue: [
stonWriter encodeMap: self ]
ifFalse: [
stonWriter
writeObject: self
do: [ stonWriter encodeMap: self ] ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*STON-Core
stonOn: stonWriter
stonWriter
writeObject: self
streamShortList: [ :listWriter |
stonWriter
writeObject: self
streamShortList: [ :listWriter |
self do: [ :each | listWriter add: each ] ]
6 changes: 3 additions & 3 deletions repository/STON-Core.package/STON.class/class/classNameKey.st
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
accessing
classNameKey
"Return the key that will be used to add a property with the class name
"Return the key that will be used to add a property with the class name
when an unknown class is read and the option STONReader>>#acceptUnknownClasses: is true,
by default #className. Such unknown classes are returned as generic maps."

"((STON reader acceptUnknownClasses: true; on: 'FooBarBaz { #foo : 100 }' readStream; next) at: STON classNameKey) >>> #FooBarBaz"

^ #className
6 changes: 3 additions & 3 deletions repository/STON-Core.package/STON.class/class/fromStream..st
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
convencience
fromStream: readStream
"Parse and materialize the STON representation in the character readStream"

"(STON fromStream: 'Point[1,2]' readStream) >>> (1@2)"
"FileLocator temp / ('{1}.ston' format: { Time millisecondClockValue }) in: [ :file |

"FileLocator temp / ('{1}.ston' format: { Time millisecondClockValue }) in: [ :file |
file writeStreamDo: [ :out | STON put: 1@2 onStream: out ].
file readStreamDo: [ :in | STON fromStream: in ] ]"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ convencience
fromStreamWithComments: readStream
"Parse and materialize the STON representation in the character readStream,
skipping C-style comments"

"(STON fromStreamWithComments: 'Point[1,/*comment*/2]' readStream) >>> (1@2)"

^ (self reader on: (STONCStyleCommentsSkipStream on: readStream)) next
4 changes: 2 additions & 2 deletions repository/STON-Core.package/STON.class/class/fromString..st
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
convencience
fromString: string
"Parse and materialize the STON representation in string"

"(STON fromString: 'Point[1,2]') >>> (1@2)"

^ self fromStream: string readStream
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ convencience
fromStringWithComments: string
"Parse and materialize the STON representation in string,
skipping C-style comments"

"(STON fromStringWithComments: 'Point[1,/*comment*/2]') >>> (1@2)"

^ self fromStreamWithComments: string readStream
Loading

0 comments on commit 747f140

Please sign in to comment.