diff --git a/repository/STON-Core.package/Bag.extension/class/fromSton..st b/repository/STON-Core.package/Bag.extension/class/fromSton..st index 42d76b7..4627fa0 100644 --- a/repository/STON-Core.package/Bag.extension/class/fromSton..st +++ b/repository/STON-Core.package/Bag.extension/class/fromSton..st @@ -1,6 +1,6 @@ *STON-Core fromSton: stonReader - "Read a map representation containing element/occurences pairs" + "Read a map representation containing element/occurrences pairs" | bag | bag := self new. diff --git a/repository/STON-Core.package/Bag.extension/instance/stonOn..st b/repository/STON-Core.package/Bag.extension/instance/stonOn..st index c09abb0..e2bf13c 100644 --- a/repository/STON-Core.package/Bag.extension/instance/stonOn..st +++ b/repository/STON-Core.package/Bag.extension/instance/stonOn..st @@ -1,6 +1,6 @@ *STON-Core stonOn: stonWriter - "Use a map with element-occurences pairs as representation" + "Use a map with element-occurrences pairs as representation" stonWriter writeObject: self diff --git a/repository/STON-Core.package/FileReference.extension/instance/stonContainSubObjects.st b/repository/STON-Core.package/FileReference.extension/instance/stonContainSubObjects.st new file mode 100644 index 0000000..4ac8e50 --- /dev/null +++ b/repository/STON-Core.package/FileReference.extension/instance/stonContainSubObjects.st @@ -0,0 +1,3 @@ +*ston-core +stonContainSubObjects + ^ false \ No newline at end of file diff --git a/repository/STON-Core.package/STON.class/README.md b/repository/STON-Core.package/STON.class/README.md index 90ce5e0..17aa391 100644 --- a/repository/STON-Core.package/STON.class/README.md +++ b/repository/STON-Core.package/STON.class/README.md @@ -29,7 +29,7 @@ STON is more or less a superset of JSON and is backwards compatible with JSON wh - class information (except for lists (Array) and maps (Dictionary)) - proper handling of shared and circular references - - more Smalltalk like syntax (Symbols with #, single qouted Strings, nil instead of null) + - more Smalltalk like syntax (Symbols with #, single quoted Strings, nil instead of null) - more defined special types (Date, Time, DataAndTime, ByteArray, Point) Parsing JSON is done using #fromString: or #fromStream: with the results being composed of Arrays and Dictionaries. @@ -45,7 +45,7 @@ For a much more sophisticated JSON parser/writer implementation, have a look at Like JSON, STON does not allow for comments. However, a preprocessor option can skip C style comments before parsing. -I also define some contants used in the implementation: the class used as list, map and association, as well as the optional class name key (used when reading objects using an unknown class). +I also define some constants used in the implementation: the class used as list, map and association, as well as the optional class name key (used when reading objects using an unknown class). I m p l e m e n t a t i o n diff --git a/repository/STON-Core.package/STON.class/properties.json b/repository/STON-Core.package/STON.class/properties.json index 8531d71..fa7119f 100644 --- a/repository/STON-Core.package/STON.class/properties.json +++ b/repository/STON-Core.package/STON.class/properties.json @@ -1,5 +1,5 @@ { - "commentStamp" : "SvenVanCaekenberghe 10/9/2018 21:14", + "commentStamp" : "", "super" : "Object", "category" : "STON-Core-Facade", "classinstvars" : [ ], diff --git a/repository/STON-Core.package/STONJSON.class/README.md b/repository/STON-Core.package/STONJSON.class/README.md index 8993e63..3b61b6e 100644 --- a/repository/STON-Core.package/STONJSON.class/README.md +++ b/repository/STON-Core.package/STONJSON.class/README.md @@ -4,7 +4,7 @@ STON is more or less a superset of JSON and is backwards compatible with JSON wh - class information (except for lists (Array) and maps (Dictionary)) - proper handling of shared and circular references - - more Smalltalk like syntax (Symbols with #, single qouted Strings, nil instead of null) + - more Smalltalk like syntax (Symbols with #, single quoted Strings, nil instead of null) - more defined special types (Date, Time, DataAndTime, ByteArray, Point) Parsing JSON is done using diff --git a/repository/STON-Core.package/STONReader.class/instance/convertNewLines..st b/repository/STON-Core.package/STONReader.class/instance/convertNewLines..st index 62208d8..9a5cf57 100644 --- a/repository/STON-Core.package/STONReader.class/instance/convertNewLines..st +++ b/repository/STON-Core.package/STONReader.class/instance/convertNewLines..st @@ -2,6 +2,6 @@ initialize-release convertNewLines: boolean "When true, any newline CR, LF or CRLF read unescaped inside strings or symbols will be converted to the newline convention chosen, see #newLine: - The default is false, not doing any convertions." + The default is false, not doing any conversions." convertNewLines := boolean \ No newline at end of file diff --git a/repository/STON-Core.package/ZnMimeType.extension/instance/stonContainSubObjects.st b/repository/STON-Core.package/ZnMimeType.extension/instance/stonContainSubObjects.st new file mode 100644 index 0000000..4ac8e50 --- /dev/null +++ b/repository/STON-Core.package/ZnMimeType.extension/instance/stonContainSubObjects.st @@ -0,0 +1,3 @@ +*ston-core +stonContainSubObjects + ^ false \ No newline at end of file diff --git a/repository/STON-Core.package/ZnUrl.extension/instance/stonContainSubObjects.st b/repository/STON-Core.package/ZnUrl.extension/instance/stonContainSubObjects.st new file mode 100644 index 0000000..4ac8e50 --- /dev/null +++ b/repository/STON-Core.package/ZnUrl.extension/instance/stonContainSubObjects.st @@ -0,0 +1,3 @@ +*ston-core +stonContainSubObjects + ^ false \ No newline at end of file diff --git a/repository/STON-Tests.package/STONJSONTest.class/instance/testOrderedDictionary.st b/repository/STON-Tests.package/STONJSONTest.class/instance/testOrderedDictionary.st index ab8e4df..48873e8 100644 --- a/repository/STON-Tests.package/STONJSONTest.class/instance/testOrderedDictionary.st +++ b/repository/STON-Tests.package/STONJSONTest.class/instance/testOrderedDictionary.st @@ -1,26 +1,23 @@ tests testOrderedDictionary | odictClass odict json dict | - odictClass := self environment at: #OrderedDictionary ifAbsent: [ ^ self skip ]. - - odict := odictClass newFrom: { - 'a' -> 42 . 'b' -> 1. 'aa' -> 4. 'c' -> 23 - }. - - "assert that the order is not equal in the dictionary hash table". - self + + odict := odictClass newFrom: {('a' -> 42) . ('b' -> 1) . ('aa' -> 4) . ('c' -> 23)}. + + "assert that the order is not equal in the dictionary hash table" + self assertCollection: odict asArray hasSameElements: odict dictionary asArray; deny: odict asArray equals: odict dictionary asArray. - + "ordered presevered when encoding:" json := STONJSON toString: odict. self assert: json equals: '{"a":42,"b":1,"aa":4,"c":23}'. - + "lost when decoding" dict := STONJSON fromString: json. - self + self assertCollection: dict asArray hasSameElements: odict asArray; assert: dict equals: odict dictionary; - deny: dict asArray equals: odict asArray + deny: dict asArray equals: odict asArray \ No newline at end of file diff --git a/repository/STON-Tests.package/STONLargeWriteReadTest.class/instance/materialize..st b/repository/STON-Tests.package/STONLargeWriteReadTest.class/instance/materialize..st new file mode 100644 index 0000000..2263565 --- /dev/null +++ b/repository/STON-Tests.package/STONLargeWriteReadTest.class/instance/materialize..st @@ -0,0 +1,6 @@ +private +materialize: string + ^ STON reader + on: string readStream; + optimizeForLargeStructures; + next \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testAssociation.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testAssociation.st index 6b967bb..09132ad 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testAssociation.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testAssociation.st @@ -1,13 +1,13 @@ tests testAssociation - self assert: (self materialize: '''foo'':1') equals: ('foo' -> 1). - self assert: (self materialize: '#bar:2') equals: (#bar -> 2). - self assert: (self materialize: '''foo bar'':#ok') equals: ('foo bar' -> #ok). - self assert: (self materialize: '123:456') equals: (123 -> 456). - - self assert: (self materialize: '''foo'' : 1') equals: ('foo' -> 1). - self assert: (self materialize: '#bar : 2') equals: (#bar -> 2). - self assert: (self materialize: '''foo bar'' : #ok') equals: ('foo bar' -> #ok). - self assert: (self materialize: '123 : -456') equals: (123 -> -456). - - self assert: (self materialize: '#foo : 1 : 2') equals: (#foo -> (1 -> 2)) + self assert: (self materialize: '''foo'':1') equals: 'foo' -> 1. + self assert: (self materialize: '#bar:2') equals: #bar -> 2. + self assert: (self materialize: '''foo bar'':#ok') equals: 'foo bar' -> #ok. + self assert: (self materialize: '123:456') equals: 123 -> 456. + + self assert: (self materialize: '''foo'' : 1') equals: 'foo' -> 1. + self assert: (self materialize: '#bar : 2') equals: #bar -> 2. + self assert: (self materialize: '''foo bar'' : #ok') equals: 'foo bar' -> #ok. + self assert: (self materialize: '123 : -456') equals: 123 -> -456. + + self assert: (self materialize: '#foo : 1 : 2') equals: #foo -> (1 -> 2) \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testByteArray.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testByteArray.st index ae70e33..92c35cd 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testByteArray.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testByteArray.st @@ -1,3 +1,3 @@ tests testByteArray - self assert: (self materialize: 'ByteArray[''010203'']') equals: #(1 2 3) asByteArray + self assert: (self materialize: 'ByteArray[''010203'']') equals: #(1 2 3) asByteArray \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testCharacter.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testCharacter.st index ef8d735..536f9fc 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testCharacter.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testCharacter.st @@ -1,3 +1,3 @@ tests testCharacter - self assert: (self materialize: 'Character[''A'']') identicalTo: $A. \ No newline at end of file + self assert: (self materialize: 'Character[''A'']') identicalTo: $A \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testDateAndTime.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testDateAndTime.st index f407d58..1ab6c86 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testDateAndTime.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testDateAndTime.st @@ -1,5 +1,12 @@ tests testDateAndTime | dateAndTime | - dateAndTime := DateAndTime year: 2012 month: 1 day: 1 hour: 6 minute: 30 second: 15 offset: 1 hour. + dateAndTime := DateAndTime + year: 2012 + month: 1 + day: 1 + hour: 6 + minute: 30 + second: 15 + offset: 1 hour. self assert: (self materialize: 'DateAndTime[''2012-01-01T06:30:15+01:00'']') equals: dateAndTime \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionary.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionary.st index 79f5fc5..4efa353 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionary.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionary.st @@ -1,6 +1,9 @@ tests testDictionary | collection | - collection := STON mapClass new at: 1 put: 1; at: 2 put: 2; yourself. + collection := STON mapClass new + at: 1 put: 1; + at: 2 put: 2; + yourself. self assert: (self materialize: '{1:1,2:2}') equals: collection. - self assert: (self materialize: '{}') equals: STON mapClass new. + self assert: (self materialize: '{}') equals: STON mapClass new \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionaryWithComplexKeys.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionaryWithComplexKeys.st index 2764f8d..4237239 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionaryWithComplexKeys.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testDictionaryWithComplexKeys.st @@ -1,7 +1,10 @@ tests testDictionaryWithComplexKeys | collection reader | - collection := STON mapClass new at: true put: 1; at: #(foo) put: 2; yourself. + collection := STON mapClass new + at: true put: 1; + at: #(foo) put: 2; + yourself. "allowing complex map keys used to be optional, now it is always the default" reader := STONReader on: '{true:1,[#foo]:2}' readStream. self assert: reader next equals: collection \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testIdentityDictionary.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testIdentityDictionary.st index 1ad51d1..7e4a2de 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testIdentityDictionary.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testIdentityDictionary.st @@ -1,6 +1,9 @@ tests testIdentityDictionary | collection | - collection := IdentityDictionary new at: 1 put: 1; at: 2 put: 2; yourself. + collection := IdentityDictionary new + at: 1 put: 1; + at: 2 put: 2; + yourself. self assert: (self materialize: 'IdentityDictionary{1:1,2:2}') equals: collection. - self assert: (self materialize: 'IdentityDictionary{}') equals: IdentityDictionary new. + self assert: (self materialize: 'IdentityDictionary{}') equals: IdentityDictionary new \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testJsonString.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testJsonString.st index 6cadefb..85caf5c 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testJsonString.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testJsonString.st @@ -1,11 +1,10 @@ tests testJsonString "Allow double quotes for backwards JSON compatibility" - + | string | self assert: (self materialize: '"foo"') equals: 'foo'. self assert: (self materialize: '"FOO"') equals: 'FOO'. self assert: (self materialize: '"\u00E9l\u00E8ve en Fran\u00E7ais"') equals: 'élève en Français'. - string := String withAll: { - $". $'. $\. Character tab. Character cr. Character lf. Character newPage. Character backspace }. - self assert: (self materialize: '"\"\''\\\t\r\n\f\b"') equals: string. + string := String withAll: {$" . $' . $\ . Character tab . Character cr . Character lf . Character newPage . Character backspace}. + self assert: (self materialize: '"\"\''\\\t\r\n\f\b"') equals: string \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testMap.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testMap.st index fd2893c..f833d26 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testMap.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testMap.st @@ -1,4 +1,9 @@ tests testMap - self assert: (self materialize: '{#foo:1}') equals: (STON mapClass new at: #foo put: 1; yourself). + self + assert: (self materialize: '{#foo:1}') + equals: + (STON mapClass new + at: #foo put: 1; + yourself). self assert: (self materialize: '{}') equals: STON mapClass new \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testObject.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testObject.st index 0519239..7a9bfa5 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testObject.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testObject.st @@ -1,4 +1,4 @@ tests testObject - self assert: (self materialize: 'Point[1,2]') equals: (1@2). - self assert: (self materialize: 'Point[1.5,-0.5]') equals: (1.5 @ -0.5). \ No newline at end of file + self assert: (self materialize: 'Point[1,2]') equals: 1 @ 2. + self assert: (self materialize: 'Point[1.5,-0.5]') equals: 1.5 @ -0.5 \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testOrderedCollection.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testOrderedCollection.st index fdaaf2b..9ae71fa 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testOrderedCollection.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testOrderedCollection.st @@ -3,4 +3,4 @@ testOrderedCollection | collection | collection := OrderedCollection with: 1 with: 2 with: 3. self assert: (self materialize: 'OrderedCollection[1,2,3]') equals: collection. - self assert: (self materialize: 'OrderedCollection[]') equals: OrderedCollection new. \ No newline at end of file + self assert: (self materialize: 'OrderedCollection[]') equals: OrderedCollection new \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testPoint.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testPoint.st index ee9b9cd..aded6c6 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testPoint.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testPoint.st @@ -1,3 +1,3 @@ tests testPoint - self assert: (self materialize: 'Point[1,2]') equals: (1@2) \ No newline at end of file + self assert: (self materialize: 'Point[1,2]') equals: 1 @ 2 \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceCycle.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceCycle.st index ee7b511..b7063f7 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceCycle.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceCycle.st @@ -1,7 +1,7 @@ tests testReferenceCycle | array | - array := (self materialize: '[1,@1]'). + array := self materialize: '[1,@1]'. self assert: array class equals: STON listClass. self assert: array size equals: 2. self assert: array first equals: 1. diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceSharing.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceSharing.st index 9efa3a0..ae19c5d 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceSharing.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceSharing.st @@ -1,8 +1,8 @@ tests testReferenceSharing | one array | - one := { #one }. - array := (self materialize: '[[#one],@2,@2]'). - self assert: array = (STON listClass with: one with: one with: one). + one := {#one}. + array := self materialize: '[[#one],@2,@2]'. + self assert: array equals: (STON listClass with: one with: one with: one). self assert: array first identicalTo: array second. self assert: array first identicalTo: array third \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testString.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testString.st index a075b13..43c425f 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testString.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testString.st @@ -4,6 +4,5 @@ testString self assert: (self materialize: '''foo''') equals: 'foo'. self assert: (self materialize: '''FOO''') equals: 'FOO'. self assert: (self materialize: '''\u00E9l\u00E8ve en Fran\u00E7ais''') equals: 'élève en Français'. - string := String withAll: { - $". $'. $\. $/. Character tab. Character cr. Character lf. Character newPage. Character backspace }. - self assert: (self materialize: '''\"\''\\\/\t\r\n\f\b''') equals: string. + string := String withAll: {$" . $' . $\ . $/ . Character tab . Character cr . Character lf . Character newPage . Character backspace}. + self assert: (self materialize: '''\"\''\\\/\t\r\n\f\b''') equals: string \ No newline at end of file diff --git a/repository/STON-Tests.package/STONReaderTest.class/instance/testWhitespace.st b/repository/STON-Tests.package/STONReaderTest.class/instance/testWhitespace.st index ec25be0..6ada142 100644 --- a/repository/STON-Tests.package/STONReaderTest.class/instance/testWhitespace.st +++ b/repository/STON-Tests.package/STONReaderTest.class/instance/testWhitespace.st @@ -1,6 +1,5 @@ tests testWhitespace | whitespace | - whitespace := { Character space. Character tab. Character cr. Character lf }. - self assert: (self materialize: whitespace, '123') equals: 123 - \ No newline at end of file + whitespace := {Character space . Character tab . Character cr . Character lf}. + self assert: (self materialize: whitespace , '123') equals: 123 \ No newline at end of file diff --git a/repository/STON-Tests.package/STONTest.class/instance/testFromString.st b/repository/STON-Tests.package/STONTest.class/instance/testFromString.st index febcec7..91d366a 100644 --- a/repository/STON-Tests.package/STONTest.class/instance/testFromString.st +++ b/repository/STON-Tests.package/STONTest.class/instance/testFromString.st @@ -1,5 +1,5 @@ tests testFromString | object | - object := STON listClass withAll: { 1. 0. -1. true. false. nil }. + object := STON listClass withAll: {1 . 0 . -1 . true . false . nil}. self assert: (STON fromString: '[1,0,-1,true,false,nil]') equals: object \ No newline at end of file diff --git a/repository/STON-Tests.package/STONTest.class/instance/testRoomExitCycles.st b/repository/STON-Tests.package/STONTest.class/instance/testRoomExitCycles.st index d89e8c7..61f7d5e 100644 --- a/repository/STON-Tests.package/STONTest.class/instance/testRoomExitCycles.st +++ b/repository/STON-Tests.package/STONTest.class/instance/testRoomExitCycles.st @@ -25,5 +25,5 @@ testRoomExitCycles self assert: ((object first at: #exit) at: #destination) identicalTo: object second. self assert: ((object second at: #exit) at: #origin) identicalTo: object second. self assert: ((object second at: #exit) at: #destination) identicalTo: object first. - "Try writing again the parse model" + "Try writing again the parse model" self assert: (STON toString: object) equals: ston \ No newline at end of file diff --git a/repository/STON-Tests.package/STONTest.class/instance/testToString.st b/repository/STON-Tests.package/STONTest.class/instance/testToString.st index 00cc9a2..c9c8c4f 100644 --- a/repository/STON-Tests.package/STONTest.class/instance/testToString.st +++ b/repository/STON-Tests.package/STONTest.class/instance/testToString.st @@ -1,5 +1,5 @@ tests testToString | object | - object := STON listClass withAll: { 1. 0. -1. true. false. nil }. + object := STON listClass withAll: {1 . 0 . -1 . true . false . nil}. self assert: (STON toString: object) equals: '[1,0,-1,true,false,nil]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONTestKnownObject.class/class/addKnownObject..st b/repository/STON-Tests.package/STONTestKnownObject.class/class/addKnownObject..st index e0dd6eb..09f7087 100644 --- a/repository/STON-Tests.package/STONTestKnownObject.class/class/addKnownObject..st +++ b/repository/STON-Tests.package/STONTestKnownObject.class/class/addKnownObject..st @@ -1,3 +1,3 @@ -acccessing +accessing addKnownObject: object ^ self knownObjects addIfNotPresent: object \ No newline at end of file diff --git a/repository/STON-Tests.package/STONTestKnownObject.class/class/fromId..st b/repository/STON-Tests.package/STONTestKnownObject.class/class/fromId..st index 97e0b46..deffb25 100644 --- a/repository/STON-Tests.package/STONTestKnownObject.class/class/fromId..st +++ b/repository/STON-Tests.package/STONTestKnownObject.class/class/fromId..st @@ -1,6 +1,6 @@ instance creation fromId: idString - "Given id, return a matching instance of me, either by returning an existing known instance or by creating a new one (that is automtically added to the known instances)" + "Given id, return a matching instance of me, either by returning an existing known instance or by creating a new one (that is automatically added to the known instances)" | uuid | uuid := UUID fromString: idString. diff --git a/repository/STON-Tests.package/STONTestKnownObject.class/class/knownObjects.st b/repository/STON-Tests.package/STONTestKnownObject.class/class/knownObjects.st index 2250837..094ead7 100644 --- a/repository/STON-Tests.package/STONTestKnownObject.class/class/knownObjects.st +++ b/repository/STON-Tests.package/STONTestKnownObject.class/class/knownObjects.st @@ -1,3 +1,3 @@ -acccessing +accessing knownObjects ^ KnownObjects ifNil: [ KnownObjects := OrderedCollection new ] \ No newline at end of file diff --git a/repository/STON-Tests.package/STONTestKnownObject.class/class/resetKnownObjects.st b/repository/STON-Tests.package/STONTestKnownObject.class/class/resetKnownObjects.st index 01d4b95..f481d87 100644 --- a/repository/STON-Tests.package/STONTestKnownObject.class/class/resetKnownObjects.st +++ b/repository/STON-Tests.package/STONTestKnownObject.class/class/resetKnownObjects.st @@ -1,3 +1,3 @@ -acccessing +accessing resetKnownObjects KnownObjects ifNotNil: [ :collection | collection removeAll ] \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriteReadCommentsTest.class/instance/materialize..st b/repository/STON-Tests.package/STONWriteReadCommentsTest.class/instance/materialize..st new file mode 100644 index 0000000..e4741a5 --- /dev/null +++ b/repository/STON-Tests.package/STONWriteReadCommentsTest.class/instance/materialize..st @@ -0,0 +1,6 @@ +private +materialize: string + ^ STON reader + on: (STONCStyleCommentsSkipStream on: string readStream); + optimizeForLargeStructures; + next \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriteReadTest.class/instance/materialize..st b/repository/STON-Tests.package/STONWriteReadTest.class/instance/materialize..st index fa24525..2c69dd5 100644 --- a/repository/STON-Tests.package/STONWriteReadTest.class/instance/materialize..st +++ b/repository/STON-Tests.package/STONWriteReadTest.class/instance/materialize..st @@ -1,3 +1,5 @@ private materialize: string - ^ (self reader: string) next \ No newline at end of file + ^ STON reader + on: string readStream; + next \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriteReadTest.class/instance/testKnownObjects.st b/repository/STON-Tests.package/STONWriteReadTest.class/instance/testKnownObjects.st index a3e9bbb..f208777 100644 --- a/repository/STON-Tests.package/STONWriteReadTest.class/instance/testKnownObjects.st +++ b/repository/STON-Tests.package/STONWriteReadTest.class/instance/testKnownObjects.st @@ -13,5 +13,5 @@ testKnownObjects self assert: object identicalTo: knownObject. "not just the id is equal, but the rest of the object too" self assert: object description equals: knownObject description. - - STONTestKnownObject resetKnownObjects. \ No newline at end of file + + STONTestKnownObject resetKnownObjects \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriteReadTest.class/properties.json b/repository/STON-Tests.package/STONWriteReadTest.class/properties.json index de3a7c9..09c8f93 100644 --- a/repository/STON-Tests.package/STONWriteReadTest.class/properties.json +++ b/repository/STON-Tests.package/STONWriteReadTest.class/properties.json @@ -1,5 +1,5 @@ { - "commentStamp" : "SvenVanCaekenberghe 10/8/2018 16:52", + "commentStamp" : "", "super" : "TestCase", "category" : "STON-Tests-Write-Read", "classinstvars" : [ ], diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testAssociation.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testAssociation.st index 36d7088..dd380fb 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testAssociation.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testAssociation.st @@ -3,4 +3,4 @@ testAssociation self assert: (self serialize: 'foo' -> 1) equals: '''foo'':1'. self assert: (self serialize: #bar -> 2) equals: '#bar:2'. self assert: (self serialize: 'foo bar' -> #ok) equals: '''foo bar'':#ok'. - self assert: (self serialize: 123 -> 456) equals: '123:456' + self assert: (self serialize: 123 -> 456) equals: '123:456' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testByteArray.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testByteArray.st index a613c65..b5a10fb 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testByteArray.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testByteArray.st @@ -1,3 +1,3 @@ tests testByteArray - self assert: (self serialize: #(1 2 3) asByteArray) equals: 'ByteArray[''010203'']' + self assert: (self serialize: #(1 2 3) asByteArray) equals: 'ByteArray[''010203'']' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testDateAndTime.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testDateAndTime.st index 90bf99a..b690ed0 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testDateAndTime.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testDateAndTime.st @@ -1,5 +1,12 @@ tests testDateAndTime | dateAndTime | - dateAndTime := DateAndTime year: 2012 month: 1 day: 1 hour: 6 minute: 30 second: 15 offset: 1 hour. + dateAndTime := DateAndTime + year: 2012 + month: 1 + day: 1 + hour: 6 + minute: 30 + second: 15 + offset: 1 hour. self assert: (self serialize: dateAndTime) equals: 'DateAndTime[''2012-01-01T06:30:15+01:00'']' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testDictionary.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testDictionary.st index e7d026f..6aeb632 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testDictionary.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testDictionary.st @@ -1,6 +1,9 @@ tests testDictionary | collection | - collection := STON mapClass new at: 1 put: 1; at: 2 put: 2; yourself. + collection := STON mapClass new + at: 1 put: 1; + at: 2 put: 2; + yourself. self assert: (self serialize: collection) equals: '{1:1,2:2}'. - self assert: (self serialize: STON mapClass new) equals: '{}'. \ No newline at end of file + self assert: (self serialize: STON mapClass new) equals: '{}' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testDoubleQuotedString.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testDoubleQuotedString.st index 28a80be..19e0ff1 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testDoubleQuotedString.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testDoubleQuotedString.st @@ -4,7 +4,6 @@ testDoubleQuotedString self assert: (self serializeJson: 'foo') equals: '"foo"'. self assert: (self serializeJson: 'FOO') equals: '"FOO"'. self assert: (self serializeJson: 'élève en Français') equals: '"élève en Français"'. - string := String withAll: { - $". $'. $\. $/. Character tab. Character cr. Character lf. Character newPage. Character backspace }. + string := String withAll: {$" . $' . $\ . $/ . Character tab . Character cr . Character lf . Character newPage . Character backspace}. "Note that in JSON mode, double quotes get escaped, and single quotes not" - self assert: (self serializeJson: string) equals: '"\"''\\/\t\r\n\f\b"'. + self assert: (self serializeJson: string) equals: '"\"''\\/\t\r\n\f\b"' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testFloat.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testFloat.st index 2611c5c..da81fe5 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testFloat.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testFloat.st @@ -3,8 +3,8 @@ testFloat self assert: (self serialize: 1.5) equals: '1.5'. self assert: (self serialize: 0.0) equals: '0.0'. self assert: (self serialize: -1.5) equals: '-1.5'. - self assert: ((self serialize: Float pi) beginsWith: '3.14159'). - self assert: ((self serialize: (1/3) asFloat) beginsWith: '0.333'). + self assert: ((self serialize: Float pi) beginsWith: '3.14159'). + self assert: ((self serialize: (1 / 3) asFloat) beginsWith: '0.333'). self assert: (self serialize: (10 raisedTo: 100) asFloat) equals: '1.0e100'. self assert: (self serialize: (10 raisedTo: -50) asFloat) equals: '1.0e-50'. - self assert: (self serialize: (10 raisedTo: -50) asFloat negated) equals: '-1.0e-50'. \ No newline at end of file + self assert: (self serialize: (10 raisedTo: -50) asFloat negated) equals: '-1.0e-50' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testIdentityDictionary.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testIdentityDictionary.st index ae095aa..a00c224 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testIdentityDictionary.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testIdentityDictionary.st @@ -1,6 +1,9 @@ tests testIdentityDictionary | collection | - collection := IdentityDictionary new at: 1 put: 1; at: 2 put: 2; yourself. + collection := IdentityDictionary new + at: 1 put: 1; + at: 2 put: 2; + yourself. self assert: (self serialize: collection) equals: 'IdentityDictionary{1:1,2:2}'. - self assert: (self serialize: IdentityDictionary new) equals: 'IdentityDictionary{}'. \ No newline at end of file + self assert: (self serialize: IdentityDictionary new) equals: 'IdentityDictionary{}' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testList.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testList.st index 7e72d0d..29459c2 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testList.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testList.st @@ -2,6 +2,4 @@ tests testList self assert: (self serialize: (STON listClass withAll: #(1 2 3))) equals: '[1,2,3]'. self assert: (self serialize: STON listClass new) equals: '[]'. - self - assert: (self serialize: (STON listClass withAll: { 1. -1. 0. #foo. 'a b c'. true. false. nil })) - equals: '[1,-1,0,#foo,''a b c'',true,false,nil]' \ No newline at end of file + self assert: (self serialize: (STON listClass withAll: {1 . -1 . 0 . #foo . 'a b c' . true . false . nil})) equals: '[1,-1,0,#foo,''a b c'',true,false,nil]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testMap.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testMap.st index f47bd70..d218574 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testMap.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testMap.st @@ -11,4 +11,4 @@ testMap self assert: (self serialize: map) equals: '{''foo bar'':#ok}'. map removeAll. map at: 123 put: 456. - self assert: (self serialize: map) equals: '{123:456}'. \ No newline at end of file + self assert: (self serialize: map) equals: '{123:456}' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testOrderedCollection.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testOrderedCollection.st index 5f5764b..119b73e 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testOrderedCollection.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testOrderedCollection.st @@ -3,4 +3,4 @@ testOrderedCollection | collection | collection := OrderedCollection with: 1 with: 2 with: 3. self assert: (self serialize: collection) equals: 'OrderedCollection[1,2,3]'. - self assert: (self serialize: OrderedCollection new) equals: 'OrderedCollection[]'. \ No newline at end of file + self assert: (self serialize: OrderedCollection new) equals: 'OrderedCollection[]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testPoint.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testPoint.st index 575da04..fdc0a5c 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testPoint.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testPoint.st @@ -1,3 +1,3 @@ tests testPoint - self assert: (self serialize: 1@2) equals: 'Point[1,2]' \ No newline at end of file + self assert: (self serialize: 1 @ 2) equals: 'Point[1,2]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceCycle.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceCycle.st index 0bedc29..7aa250e 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceCycle.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceCycle.st @@ -3,4 +3,4 @@ testReferenceCycle | array | array := STON listClass with: 1 with: nil. array at: 2 put: array. - self assert: (self serialize: array) equals: '[1,@1]'. \ No newline at end of file + self assert: (self serialize: array) equals: '[1,@1]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharing.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharing.st index 90b21ab..7cc7e53 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharing.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharing.st @@ -1,6 +1,6 @@ tests testReferenceSharing | array one | - one := { #one }. + one := {#one}. array := STON listClass with: one with: one with: one. - self assert: (self serialize: array) equals: '[[#one],@2,@2]'. \ No newline at end of file + self assert: (self serialize: array) equals: '[[#one],@2,@2]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharingIgnore.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharingIgnore.st index 9b126c7..cab75ac 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharingIgnore.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testReferenceSharingIgnore.st @@ -2,11 +2,12 @@ tests testReferenceSharingIgnore | serializer array one | serializer := [ :object | - String streamContents: [ :stream | - STON writer + String + streamContents: [ :stream | + STON writer on: stream; - referencePolicy: #ignore; + referencePolicy: #ignore; nextPut: object ] ]. - one := { #one }. + one := {#one}. array := STON listClass with: one with: one with: one. - self assert: (serializer value: array) equals: '[[#one],[#one],[#one]]'. \ No newline at end of file + self assert: (serializer value: array) equals: '[[#one],[#one],[#one]]' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testString.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testString.st index 0aa691a..e9d2c0f 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testString.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testString.st @@ -5,6 +5,5 @@ testString self assert: (self serialize: 'FOO') equals: '''FOO'''. self assert: (self serializeAsciiOnly: 'élève en Français') equals: '''\u00E9l\u00E8ve en Fran\u00E7ais'''. self assert: (self serialize: 'élève en Français') equals: '''élève en Français'''. - string := String withAll: { - $". $'. $\. $/. Character tab. Character cr. Character lf. Character newPage. Character backspace }. - self assert: (self serialize: string) equals: '''"\''\\/\t\r\n\f\b'''. + string := String withAll: {$" . $' . $\ . $/ . Character tab . Character cr . Character lf . Character newPage . Character backspace}. + self assert: (self serialize: string) equals: '''"\''\\/\t\r\n\f\b''' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbol.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbol.st index 07b5aad..0639ff3 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbol.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbol.st @@ -5,7 +5,7 @@ testSymbol self assert: (self serialize: #bytes) equals: '#bytes'. self assert: (self serialize: #'foo.bar') equals: '#foo.bar'. self assert: (self serialize: #'foo-bar') equals: '#foo-bar'. - self assert: (self serialize: #'foo_bar') equals: '#foo_bar'. + self assert: (self serialize: #foo_bar) equals: '#foo_bar'. self assert: (self serialize: #'foo/bar') equals: '#foo/bar'. self assert: (self serialize: #'foo bar') equals: '#''foo bar'''. - self assert: (self serialize: #foo123) equals: '#foo123'. \ No newline at end of file + self assert: (self serialize: #foo123) equals: '#foo123' \ No newline at end of file diff --git a/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbolAsString.st b/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbolAsString.st index f3b41b5..b0c997e 100644 --- a/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbolAsString.st +++ b/repository/STON-Tests.package/STONWriterTest.class/instance/testSymbolAsString.st @@ -1,4 +1,4 @@ tests testSymbolAsString self assert: (self serializeJson: #foo) equals: '"foo"'. - self assert: (self serializeJson: #'FOO') equals: '"FOO"'. + self assert: (self serializeJson: #FOO) equals: '"FOO"' \ No newline at end of file