Skip to content

Commit

Permalink
Merge pull request #167 from SeasideSt/slime-renovation
Browse files Browse the repository at this point in the history
Slime renovation
  • Loading branch information
Johan Brichau authored Jan 14, 2024
2 parents b0307c4 + 4e5cec2 commit 59b1042
Show file tree
Hide file tree
Showing 200 changed files with 1,235 additions and 74 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalkCI-source: 'jbrichau/smalltalkCI'
smalltalkCI-branch: 'fix-issue-623'
smalltalk-image: ${{ matrix.smalltalk }}
- name: Run tests
run: smalltalkci -s ${{ matrix.smalltalk }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
baselines
baselineCommon: spec

spec
for: #common
do: [ spec blessing: #baseline.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
baselines
baselineGemStone: spec

spec
for: #'gemstone'
do: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ baselinePharo: spec
requires: #('Grease-Pharo100-Core');
includes: #('Grease-Tests-Pharo-Core') ];
package: 'Grease-Pharo100-Core' with: [ spec requires: #('Grease-Core') ];
package: 'Grease-Pharo90-Slime' with: [ spec requires: #('Grease-Core') ];
package: 'Grease-Tests-Slime' with: [ spec requires: #('Grease-Pharo90-Slime') ].
package: 'Grease-Pharo110-Slime' with: [ spec requires: #('Grease-Core') ];
package: 'Grease-Tests-Pharo-Slime' with: [ spec requires: #('Grease-Pharo110-Slime') ].

spec
group: 'Slime' with: #('Grease-Pharo90-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Slime') ]
group: 'Slime' with: #('Grease-Pharo110-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Pharo-Slime') ]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
self packageOrganizer ensurePackage: #BaselineOfGrease withTags: #('Manifest')!
SystemOrganization addCategory: #BaselineOfGrease!
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ version info
version
"Answer the Grease version"

^ (GRVersion major: 1 minor: 12 revision: 2)
^ (GRVersion major: 1 minor: 15 revision: 0)
yourself
5 changes: 5 additions & 0 deletions repository/Grease-Pharo110-Slime.package/.filetree
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
initialization
initialize

super initialize.
self
replace: '``@expr1 and: [ | `@temp2 | ``@expr2 ] and: [ | `@temp3 | ``@expr3 ]'
with: '``@expr1 and: [ | `@temp2 | ``@expr2 and: [ | `@temp3 | ``@expr3 ] ]';
replace: '``@expr1 and: [ | `@temp2 | ``@expr2 ] and: [ | `@temp3 | ``@expr3 ] and: [ | `@temp4 | ``@expr4 ]'
with: '``@expr1 and: [ | `@temp2 | ``@expr2 and: [ | `@temp3 | ``@expr3 and: [ | `@temp4 | ``@expr4 ] ] ]';
replace: '``@expr1 and: [ | `@temp2 | ``@expr2 ] and: [ | `@temp3 | ``@expr3 ] and: [ | `@temp4 | ``@expr4 ] and: [ | `@temp5 | ``@expr5 ]'
with: '``@expr1 and: [ | `@temp2 | ``@expr2 and: [ | `@temp3 | ``@expr3 and: [ | `@temp4 | ``@expr4 and: [ | `@temp5 | ``@expr5 ] ] ] ]';
replace: '``@expr1 or: [ | `@temp2 | ``@expr2 ] or: [ | `@temp3 | ``@expr3 ]'
with: '``@expr1 or: [ | `@temp2 | ``@expr2 or: [ | `@temp3 | ``@expr3 ] ]';
replace: '``@expr1 or: [ | `@temp2 | ``@expr2 ] or: [ | `@temp3 | ``@expr3 ] or: [ | `@temp4 | ``@expr4 ]'
with: '``@expr1 or: [ | `@temp2 | ``@expr2 or: [ | `@temp3 | ``@expr3 or: [ | `@temp4 | ``@expr4 ] ] ]';
replace: '``@expr1 or: [ | `@temp2 | ``@expr2 ] or: [ | `@temp3 | ``@expr3 ] or: [ | `@temp4 | ``@expr4 ] or: [ | `@temp5 | ``@expr5 ]'
with: '``@expr1 or: [ | `@temp2 | ``@expr2 or: [ | `@temp3 | ``@expr3 or: [ | `@temp4 | ``@expr4 or: [ | `@temp5 | ``@expr5 ] ] ] ]';
replace: '``@expr1 or: [ | `@temp2 | ``@expr2 ] or: [ | `@temp3 | ``@expr3 ] or: [ | `@temp4 | ``@expr4 ] or: [ | `@temp5 | ``@expr5 ] or: [ | `@temp6 | ``@expr6 ]'
with: '``@expr1 or: [ | `@temp2 | ``@expr2 or: [ | `@temp3 | ``@expr3 or: [ | `@temp4 | ``@expr4 or: [ | `@temp5 | ``@expr5 or: [ | `@temp6 | ``@expr6 ] ] ] ] ]'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Booleans'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ '#and:and: and #or:or: are not ANSI compatible.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiBooleansRule",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
initialization
initialize

super initialize.
self
replace: 'Character value: ``@expr'
with: 'Character codePoint: ``@expr'.
self
replace: '`#source to: `#target'
byEvaluating: [ :node |
(node receiver value isCharacter and: [
node arguments first value isCharacter ])
ifTrue: [
RBLiteralNode value: (String streamContents: [ :stream |
node receiver value codePoint to: node arguments first value codePoint do: [ :code | stream nextPut: (Character codePoint: code) ] ]) ]
ifFalse: [ node ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Characters'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ 'Character value: 64 and $a to: $b is not ANSI compatible.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiCharactersRule",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
initialization
initialize
super initialize.
self
replace: '``@collection withIndexDo: [ :`each :`index | | `@temps | ``@.body ]'
with: '``@collection keysAndValuesDo: [ :`index :`each | | `@temps | ``@.body ]';
replace: '``@collection doWithIndex: [ :`each :`index | | `@temps | ``@.body ]'
with: '``@collection keysAndValuesDo: [ :`index :`each | | `@temps | ``@.body ]';
replace: '``@collection collect: ``@block1 thenDo: ``@block2'
with: '(``@collection collect: ``@block1) do: ``@block2';
replace: '``@collection collect: ``@block1 thenSelect: ``@block2'
with: '(``@collection collect: ``@block1) select: ``@block2';
replace: '``@collection pairsDo: [ :`t1 :`t2 | ``@.statements ]'
with: '1 to: ``@collection size by: 2 do: [ :index | | `t1 `t2 | `t1 := ``@collection at: index. `t2 := ``@collection at: index + 1. ``@.statements ]';
replace: '``@collection reject: ``@block1 thenDo: ``@block2'
with: '(``@collection reject: ``@block1) do: ``@block2';
replace: '``@collection select: ``@block1 thenCollect: ``@block2'
with: '(``@collection select: ``@block1) collect: ``@block2';
replace: '``@collection select: ``@block1 thenDo: ``@block2'
with: '(``@collection select: ``@block1) do: ``@block2';
replace: '``@collection detectSum: [ :`t1 | ``@.statements. `.last ]'
with: '``@collection inject: 0 into: [ :sum :`t1 | ``@.statements. sum + (`.last) ]';
replace: '``@collection valuesDo: ``@block'
with: '``@collection do: ``@block';
replace: '``@collection reversed'
with: '``@collection reverse';
replace: '``@dictionary keysSortedSafely'
with: '``@dictionary keys asSortedCollection';
replace: '``@collectionClass new: ``@size withAll: ``@character'
with: '(``@collectionClass new: ``@size) atAllPut: ``@character'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Collections'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ 'Some collection methods are not ANSI compatible: #pairsDo:, #collect:thenDo:, #reject:thenDo:, #detectSum:, #valuesDo:, #keysSortedSafely, #new:withAll:, etc.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiCollectionsRule",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
initialization
initialize

super initialize.
self
replace: '``@boolean ifNotNilDo: ``@block'
with: '``@boolean ifNotNil: ``@block';
replace: '``@boolean ifNotNilDo: ``@block1 ifNil: ``@block2'
with: '``@boolean ifNotNil: ``@block1 ifNil: ``@block2';
replace: '``@boolean ifNil: ``@block1 ifNotNilDo: ``@block2'
with: '``@boolean ifNil: ``@block1 ifNotNil: ``@block2';
replace: '``@boolean ifNotNil: [ | `@temps | ``@.body ]'
with: '``@boolean ifNotNil: [ :arg | | `@temps | ``@.body ]';
replace: '``@boolean ifNotNil: [ | `@temps | ``@.body ] ifNil: ``@block '
with: '``@boolean ifNotNil: [ :arg | | `@temps | ``@.body ] ifNil: ``@block';
replace: '``@boolean ifNil: ``@block ifNotNil: [ | `@temps | ``@.body ]'
with: '``@boolean ifNil: ``@block ifNotNil: [ :arg | | `@temps | ``@.body ]'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Conditionals'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ 'Conditionals like #ifNotNilDo: are not ANSI compatible.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiConditionalsRule",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialization
initialize

super initialize.
self
replace: '``@object asString' with: '``@object greaseString';
replace: '``@object asInteger' with: '``@object greaseInteger'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Convertors'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ 'The ANSI standard does not support #asInteger and #asString on Object.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiConvertorRule",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialization
initialize

super initialize.
self
replace: '``@block on: `class do: [ | `@temps | ``@.body ]'
with: '``@block on: `class do: [ :err | | `@temps | ``@.body ]'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Exceptions'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ 'Exception handlers expect exactly one argument in ANSI.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiExceptionsRule",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
group

^ 'ANSI Compatibility'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
initialization
initialize

super initialize.
self
replace: '`{ :node :context | node isVariable and: [ (Smalltalk includesKey: node name asSymbol) not and: [ context at: ''`receiver'' ifAbsentPut: [ node ]. true ] ] } cr'
with: '`{ :context | context at: ''`receiver'' } nextPut: Character cr';
replace: '`{ :node :context | node isVariable and: [ (Smalltalk includesKey: node name asSymbol) not and: [ context at: ''`receiver'' ifAbsentPut: [ node ]. true ] ] } lf'
with: '`{ :context | context at: ''`receiver'' } nextPut: Character lf';
replace: '``@stream nextPut: Character cr; nextPut: Character lf'
with: '``@stream crlf';
replace: '``@collection writeStream'
with: 'WriteStream on: ``@collection'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name

^ 'Streams'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rationale

^ '#cr and #lf are not part of the ANSI stream protocol.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "GRSlimeTransformationRule",
"category" : "Grease-Pharo110-Slime",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "GRAnsiStreamsRule",
"type" : "normal"
}
Empty file.
Loading

0 comments on commit 59b1042

Please sign in to comment.