diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..524009c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +**/*.st linguist-language=Smalltalk \ No newline at end of file diff --git a/.github/scripts/preLoading.st b/.github/scripts/preLoading.st new file mode 100644 index 0000000..a608429 --- /dev/null +++ b/.github/scripts/preLoading.st @@ -0,0 +1,2 @@ +"Remove Hermes from system (so I can reload it)" +(RPackageOrganizer default packages select: [:package | package name beginsWith: 'Hermes']) do: [:package | package removeFromSystem ]. \ No newline at end of file diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml new file mode 100644 index 0000000..7e4962e --- /dev/null +++ b/.github/workflows/continuous.yml @@ -0,0 +1,21 @@ +name: CI + +on: [ push, pull_request ] + +jobs: + build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + strategy: + matrix: + smalltalk: [ Pharo64-10, Pharo64-11, Pharo64-12 ] + name: ${{ matrix.smalltalk }} + steps: + - uses: actions/checkout@v3 + - uses: hpi-swa/setup-smalltalkCI@v1 + with: + smalltalk-version: ${{ matrix.smalltalk }} + - run: smalltalkci -s ${{ matrix.smalltalk }} + shell: bash + timeout-minutes: 15 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..be1ab9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# changes file +*.changes + +# system image +*.image + +# Pharo Smalltalk Debug log file +PharoDebug.log + +# Squeak Smalltalk Debug log file +SqueakDebug.log + +# Monticello package cache +/package-cache + +# playground cache +/play-cache +/play-stash + +# Metacello-github cache +/github-cache +github-*.zip + +**/.DS_STORE \ No newline at end of file diff --git a/.project b/.project index 5e7754f..81083cc 100644 --- a/.project +++ b/.project @@ -1,3 +1,3 @@ { - 'srcDirectory' : '' + 'srcDirectory' : 'src' } \ No newline at end of file diff --git a/.smalltalk.ston b/.smalltalk.ston new file mode 100644 index 0000000..af6e717 --- /dev/null +++ b/.smalltalk.ston @@ -0,0 +1,9 @@ +SmalltalkCISpec { + #preLoading : '.github/scripts/preLoading.st', + #loading : [ + SCIMetacelloLoadSpec { + #baseline : 'Hermes', + #directory : 'src' + } + ] +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3d31578..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: c - -addons: - apt: - packages: - - libasound2:i386 - - libz1:i386 - - libbz2-1.0:i386 - - libssl1.0.0:i386 - - libfreetype6:i386 - -install: - - ./scripts/download.sh - - ./scripts/disable-deprecation-warning.sh - - ./scripts/install-packages.sh Hermes hermes - -script: - - ./pharo hermes.image test --no-xterm --fail-on-failure "Hermes-Tests" diff --git a/BaselineOfHermes/BaselineOfHermes.class.st b/BaselineOfHermes/BaselineOfHermes.class.st deleted file mode 100644 index 6cc46ac..0000000 --- a/BaselineOfHermes/BaselineOfHermes.class.st +++ /dev/null @@ -1,30 +0,0 @@ -Class { - #name : #BaselineOfHermes, - #superclass : #BaselineOf, - #category : #BaselineOfHermes -} - -{ #category : #baselines } -BaselineOfHermes >> baseline: spec [ - - spec for: #common do: [ spec - - package: 'Hermes'; - package: 'Hermes-Exporter' with: [ spec requires: #('Hermes') ]; - package: 'Hermes-Extensions' with: [ spec requires: #('Hermes') ]; - - package: 'Hermes-Ring2' with: [ spec requires: #('Hermes-Exporter') ]; - - package: 'Hermes-Tests-Classes'; - package: 'Hermes-Tests-External-Package'; - package: 'Hermes-Tests' with: [ spec requires: #('core' 'Hermes-Tests-Classes' 'Hermes-Tests-External-Package') ]; - package: 'Hermes-Tests-Ring' with: [ spec requires: #('core' 'Hermes-Tests-External-Package') ]; - - group: 'core' - with: #(Hermes 'Hermes-Exporter' 'Hermes-Extensions' 'Hermes-Ring2'); - group: 'minimal' - with: #(Hermes); - group: 'test' - with: #('Hermes-Tests' 'Hermes-Tests-Classes' 'Hermes-Tests-External-Package') - ] -] diff --git a/Hermes-Exporter/Array.extension.st b/Hermes-Exporter/Array.extension.st deleted file mode 100644 index f6d0f84..0000000 --- a/Hermes-Exporter/Array.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Array } - -{ #category : #'*Hermes-Exporter' } -Array >> asExportedLiteral [ - ^ HEArray for:self. -] diff --git a/Hermes-Exporter/Association.extension.st b/Hermes-Exporter/Association.extension.st deleted file mode 100644 index ed49bb0..0000000 --- a/Hermes-Exporter/Association.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Association } - -{ #category : #'*Hermes-Exporter' } -Association >> asExportedLiteral [ - ^ HEAssociation for:self. -] diff --git a/Hermes-Exporter/Boolean.extension.st b/Hermes-Exporter/Boolean.extension.st deleted file mode 100644 index d17544b..0000000 --- a/Hermes-Exporter/Boolean.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Boolean } - -{ #category : #'*Hermes-Exporter' } -Boolean >> asExportedLiteral [ - ^ HEBoolean for: self -] diff --git a/Hermes-Exporter/ByteArray.extension.st b/Hermes-Exporter/ByteArray.extension.st deleted file mode 100644 index 8689f7d..0000000 --- a/Hermes-Exporter/ByteArray.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #ByteArray } - -{ #category : #'*Hermes-Exporter' } -ByteArray >> asExportedLiteral [ - ^ HEByteArray for:self. -] diff --git a/Hermes-Exporter/ByteString.extension.st b/Hermes-Exporter/ByteString.extension.st deleted file mode 100644 index 2dc7fe3..0000000 --- a/Hermes-Exporter/ByteString.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #ByteString } - -{ #category : #'*Hermes-Exporter' } -ByteString >> asExportedLiteral [ - ^ HEByteString for:self. -] diff --git a/Hermes-Exporter/ByteSymbol.extension.st b/Hermes-Exporter/ByteSymbol.extension.st deleted file mode 100644 index 7d5b8bc..0000000 --- a/Hermes-Exporter/ByteSymbol.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #ByteSymbol } - -{ #category : #'*Hermes-Exporter' } -ByteSymbol >> asExportedLiteral [ - ^ HESymbol for: self. -] diff --git a/Hermes-Exporter/Character.extension.st b/Hermes-Exporter/Character.extension.st deleted file mode 100644 index 3051146..0000000 --- a/Hermes-Exporter/Character.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Character } - -{ #category : #'*Hermes-Exporter' } -Character >> asExportedLiteral [ - ^ HECharacter for: self -] diff --git a/Hermes-Exporter/ClassVariable.extension.st b/Hermes-Exporter/ClassVariable.extension.st deleted file mode 100644 index 21825c7..0000000 --- a/Hermes-Exporter/ClassVariable.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #ClassVariable } - -{ #category : #'*Hermes-Exporter' } -ClassVariable >> asExportedLiteral [ - ^ HEClassVariable for: self -] diff --git a/Hermes-Exporter/CompiledBlock.extension.st b/Hermes-Exporter/CompiledBlock.extension.st deleted file mode 100644 index 30b5071..0000000 --- a/Hermes-Exporter/CompiledBlock.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #CompiledBlock } - -{ #category : #'*Hermes-Exporter' } -CompiledBlock >> asExportedLiteral [ - ^ HECompiledBlock for:self. -] diff --git a/Hermes-Exporter/CompiledMethod.extension.st b/Hermes-Exporter/CompiledMethod.extension.st deleted file mode 100644 index 9db249a..0000000 --- a/Hermes-Exporter/CompiledMethod.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #CompiledMethod } - -{ #category : #'*Hermes-Exporter' } -CompiledMethod >> asExportedLiteral [ - ^ HEMethodLiteral for:self. -] diff --git a/Hermes-Exporter/Float.extension.st b/Hermes-Exporter/Float.extension.st deleted file mode 100644 index 9c8c6d5..0000000 --- a/Hermes-Exporter/Float.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Float } - -{ #category : #'*Hermes-Exporter' } -Float >> asExportedLiteral [ - ^ HEFloat for: self -] diff --git a/Hermes-Exporter/Fraction.extension.st b/Hermes-Exporter/Fraction.extension.st deleted file mode 100644 index 4c49b7d..0000000 --- a/Hermes-Exporter/Fraction.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Fraction } - -{ #category : #'*Hermes-Exporter' } -Fraction >> asExportedLiteral [ - ^ HEFraction for: self. -] diff --git a/Hermes-Exporter/GlobalVariable.extension.st b/Hermes-Exporter/GlobalVariable.extension.st deleted file mode 100644 index 6d31aa2..0000000 --- a/Hermes-Exporter/GlobalVariable.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #GlobalVariable } - -{ #category : #'*Hermes-Exporter' } -GlobalVariable >> asExportedLiteral [ - ^ HEGlobalVariable for:self. -] diff --git a/Hermes-Exporter/HEUndefinedObject.extension.st b/Hermes-Exporter/HEUndefinedObject.extension.st deleted file mode 100644 index 4f1eb1d..0000000 --- a/Hermes-Exporter/HEUndefinedObject.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #HEUndefinedObject } - -{ #category : #'*Hermes-Exporter' } -HEUndefinedObject >> doWriteInto: aWriter [ - -] diff --git a/Hermes-Exporter/Integer.extension.st b/Hermes-Exporter/Integer.extension.st deleted file mode 100644 index e1096fd..0000000 --- a/Hermes-Exporter/Integer.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Integer } - -{ #category : #'*Hermes-Exporter' } -Integer >> asExportedLiteral [ - ^ HEInteger for: self -] diff --git a/Hermes-Exporter/MetaclassForTraits.extension.st b/Hermes-Exporter/MetaclassForTraits.extension.st deleted file mode 100644 index 350ef61..0000000 --- a/Hermes-Exporter/MetaclassForTraits.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #MetaclassForTraits } - -{ #category : #'*Hermes-Exporter' } -MetaclassForTraits >> asExportedLiteral [ - ^ HEClassTrait for: self -] diff --git a/Hermes-Exporter/Pragma.extension.st b/Hermes-Exporter/Pragma.extension.st deleted file mode 100644 index dbc6c2e..0000000 --- a/Hermes-Exporter/Pragma.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Pragma } - -{ #category : #'*Hermes-Exporter' } -Pragma >> asExportedLiteral [ - ^ HEPragma for: self. -] diff --git a/Hermes-Exporter/ScaledDecimal.extension.st b/Hermes-Exporter/ScaledDecimal.extension.st deleted file mode 100644 index b738759..0000000 --- a/Hermes-Exporter/ScaledDecimal.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #ScaledDecimal } - -{ #category : #'*Hermes-Exporter' } -ScaledDecimal >> asExportedLiteral [ - ^ HEScaledDecimal for: self. -] diff --git a/Hermes-Exporter/Trait.extension.st b/Hermes-Exporter/Trait.extension.st deleted file mode 100644 index 0abc861..0000000 --- a/Hermes-Exporter/Trait.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Trait } - -{ #category : #'*Hermes-Exporter' } -Trait >> asExportedLiteral [ - ^ HETraitLiteral for: self. -] diff --git a/Hermes-Exporter/UndeclaredVariable.extension.st b/Hermes-Exporter/UndeclaredVariable.extension.st deleted file mode 100644 index e2c88ce..0000000 --- a/Hermes-Exporter/UndeclaredVariable.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #UndeclaredVariable } - -{ #category : #'*Hermes-Exporter' } -UndeclaredVariable >> asExportedLiteral [ - ^ HEGlobalVariable for:self. -] diff --git a/Hermes-Exporter/UndefinedObject.extension.st b/Hermes-Exporter/UndefinedObject.extension.st deleted file mode 100644 index c1c6b22..0000000 --- a/Hermes-Exporter/UndefinedObject.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #UndefinedObject } - -{ #category : #'*Hermes-Exporter' } -UndefinedObject >> asExportedLiteral [ - ^ HEUndefinedObject for:self. -] diff --git a/Hermes-Exporter/WideString.extension.st b/Hermes-Exporter/WideString.extension.st deleted file mode 100644 index a7c4978..0000000 --- a/Hermes-Exporter/WideString.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #WideString } - -{ #category : #'*Hermes-Exporter' } -WideString >> asExportedLiteral [ - ^ HEWideString for:self. -] diff --git a/Hermes-Exporter/package.st b/Hermes-Exporter/package.st deleted file mode 100644 index cbe8d44..0000000 --- a/Hermes-Exporter/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Hermes-Exporter' } diff --git a/Hermes-Ring2/RGEnvironment.extension.st b/Hermes-Ring2/RGEnvironment.extension.st deleted file mode 100644 index 6aa6d21..0000000 --- a/Hermes-Ring2/RGEnvironment.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : #RGEnvironment } - -{ #category : #'*Hermes-Ring2' } -RGEnvironment >> packages [ - - ^ self ask packages -] diff --git a/Hermes-Ring2/RGLayout.extension.st b/Hermes-Ring2/RGLayout.extension.st deleted file mode 100644 index e9a1e64..0000000 --- a/Hermes-Ring2/RGLayout.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : #RGLayout } - -{ #category : #'*Hermes-Ring2' } -RGLayout >> slots [ - - ^ { } -] diff --git a/Hermes-Ring2/package.st b/Hermes-Ring2/package.st deleted file mode 100644 index 6ef30c4..0000000 --- a/Hermes-Ring2/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Hermes-Ring2' } diff --git a/Hermes-Tests/package.st b/Hermes-Tests/package.st deleted file mode 100644 index 67f4818..0000000 --- a/Hermes-Tests/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Hermes-Tests' } diff --git a/Hermes/package.st b/Hermes/package.st deleted file mode 100644 index 39e2898..0000000 --- a/Hermes/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #Hermes } diff --git a/scripts/disable-deprecation-warning.sh b/scripts/disable-deprecation-warning.sh deleted file mode 100755 index e4988ef..0000000 --- a/scripts/disable-deprecation-warning.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -ex - -./pharo Pharo.image eval --save " -Deprecation showWarning: false. -Deprecation raiseWarning: false. -" - diff --git a/scripts/download.sh b/scripts/download.sh deleted file mode 100755 index e14a04d..0000000 --- a/scripts/download.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -ex - -wget -O - get.pharo.org/70+vm | bash diff --git a/scripts/install-packages.sh b/scripts/install-packages.sh deleted file mode 100755 index 00fced3..0000000 --- a/scripts/install-packages.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# -# This script installs the baseline and saves the image as the name idicated: -# -# Parameters -# ---------- -# -# 1) Baseline Name -# 2) New image name -# 3) MC directory (Optional, if it is not informed '.' is used). - -BASELINE_NAME=$1 -NEW_IMAGENAME=$2 - -if [ $# -lt 3 ] ; then - MC=. -else - MC=$3 -fi - -set -ex - -./pharo Pharo.image eval " -Metacello new - baseline: '$BASELINE_NAME'; - repository: 'tonel://$MC'; - load. - -Smalltalk saveAs:'$NEW_IMAGENAME'. -" - diff --git a/.properties b/src/.properties similarity index 100% rename from .properties rename to src/.properties diff --git a/src/BaselineOfHermes/BaselineOfHermes.class.st b/src/BaselineOfHermes/BaselineOfHermes.class.st new file mode 100644 index 0000000..de32a7e --- /dev/null +++ b/src/BaselineOfHermes/BaselineOfHermes.class.st @@ -0,0 +1,38 @@ +Class { + #name : #BaselineOfHermes, + #superclass : #BaselineOf, + #category : #BaselineOfHermes +} + +{ #category : #baselines } +BaselineOfHermes >> baseline: spec [ + + spec for: #common do: [ + + spec + package: 'Hermes'; + package: 'Hermes-Exporter' with: [ spec requires: #('Hermes') ]; + package: 'Hermes-Extensions' with: [ spec requires: #('Hermes') ]; + + package: 'Hermes-Ring2' with: [ spec requires: #('Hermes-Exporter') ]; + + package: 'Hermes-Tests-Classes'; + package: 'Hermes-Tests-External-Package'; + package: 'Hermes-Tests' with: [ spec requires: #('core' 'Hermes-Tests-Classes' 'Hermes-Tests-External-Package') ]; + package: 'Hermes-Tests-Ring' with: [ spec requires: #('core' 'Hermes-Tests-External-Package') ]; + + group: 'core' with: #('Hermes' 'Hermes-Exporter' 'Hermes-Extensions' 'Hermes-Ring2'); + group: 'minimal' with: #('Hermes'); + group: 'test' with: #('Hermes-Tests' 'Hermes-Tests-Classes' 'Hermes-Tests-External-Package') + ]. + + spec for: (self pharoVersionsFrom: 11) do: [ + spec + package: 'Hermes-Exporter' with: [ spec includes: #( 'Hermes-Exporter-Pharo11' ) ]; + package: 'Hermes-Exporter-Pharo11' ] +] + +{ #category : #baselines } +BaselineOfHermes >> pharoVersionsFrom: aVersion [ + ^ (aVersion to: SystemVersion current major) collect: [ :v | ('pharo' , v asString , '.x') asSymbol ] +] diff --git a/BaselineOfHermes/package.st b/src/BaselineOfHermes/package.st similarity index 100% rename from BaselineOfHermes/package.st rename to src/BaselineOfHermes/package.st diff --git a/Hermes-Changes-Collector/HEChangeSet.class.st b/src/Hermes-Changes-Collector/HEChangeSet.class.st similarity index 100% rename from Hermes-Changes-Collector/HEChangeSet.class.st rename to src/Hermes-Changes-Collector/HEChangeSet.class.st diff --git a/Hermes-Changes-Collector/HEChangesCollector.class.st b/src/Hermes-Changes-Collector/HEChangesCollector.class.st similarity index 100% rename from Hermes-Changes-Collector/HEChangesCollector.class.st rename to src/Hermes-Changes-Collector/HEChangesCollector.class.st diff --git a/Hermes-Changes-Collector/package.st b/src/Hermes-Changes-Collector/package.st similarity index 100% rename from Hermes-Changes-Collector/package.st rename to src/Hermes-Changes-Collector/package.st diff --git a/Hermes-Exporter/ConstantBlockClosure.extension.st b/src/Hermes-Exporter-Pharo11/ConstantBlockClosure.extension.st similarity index 73% rename from Hermes-Exporter/ConstantBlockClosure.extension.st rename to src/Hermes-Exporter-Pharo11/ConstantBlockClosure.extension.st index 75d65e4..86a5b29 100644 --- a/Hermes-Exporter/ConstantBlockClosure.extension.st +++ b/src/Hermes-Exporter-Pharo11/ConstantBlockClosure.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ConstantBlockClosure } -{ #category : #'*Hermes-Exporter' } +{ #category : #'*Hermes-Exporter-Pharo11' } ConstantBlockClosure >> asExportedLiteral [ ^ HEConstantBlock for: self diff --git a/src/Hermes-Exporter-Pharo11/ManifestHermesExporterPharo11.class.st b/src/Hermes-Exporter-Pharo11/ManifestHermesExporterPharo11.class.st new file mode 100644 index 0000000..77bdc15 --- /dev/null +++ b/src/Hermes-Exporter-Pharo11/ManifestHermesExporterPharo11.class.st @@ -0,0 +1,12 @@ +" +I am a package adding compatibility for Pharo version > 11 like support for constant blocks. + +Once this project will have Pharo 11 as minimal version we can merge me in Hermes-Exporter + + +" +Class { + #name : #ManifestHermesExporterPharo11, + #superclass : #PackageManifest, + #category : #'Hermes-Exporter-Pharo11-Manifest' +} diff --git a/src/Hermes-Exporter-Pharo11/package.st b/src/Hermes-Exporter-Pharo11/package.st new file mode 100644 index 0000000..7bfc7a4 --- /dev/null +++ b/src/Hermes-Exporter-Pharo11/package.st @@ -0,0 +1 @@ +Package { #name : #'Hermes-Exporter-Pharo11' } diff --git a/Hermes-Exporter/AdditionalMethodState.extension.st b/src/Hermes-Exporter/AdditionalMethodState.extension.st similarity index 51% rename from Hermes-Exporter/AdditionalMethodState.extension.st rename to src/Hermes-Exporter/AdditionalMethodState.extension.st index 5b43544..f1b5ca4 100644 --- a/Hermes-Exporter/AdditionalMethodState.extension.st +++ b/src/Hermes-Exporter/AdditionalMethodState.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #AdditionalMethodState } +Extension { #name : 'AdditionalMethodState' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } AdditionalMethodState >> asExportedLiteral [ ^ HEAdditionalMethodState for:self. ] diff --git a/src/Hermes-Exporter/Array.extension.st b/src/Hermes-Exporter/Array.extension.st new file mode 100644 index 0000000..32f0741 --- /dev/null +++ b/src/Hermes-Exporter/Array.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Array' } + +{ #category : '*Hermes-Exporter' } +Array >> asExportedLiteral [ + ^ HEArray for:self. +] diff --git a/src/Hermes-Exporter/Association.extension.st b/src/Hermes-Exporter/Association.extension.st new file mode 100644 index 0000000..12ca31d --- /dev/null +++ b/src/Hermes-Exporter/Association.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Association' } + +{ #category : '*Hermes-Exporter' } +Association >> asExportedLiteral [ + ^ HEAssociation for:self. +] diff --git a/src/Hermes-Exporter/Boolean.extension.st b/src/Hermes-Exporter/Boolean.extension.st new file mode 100644 index 0000000..967f75a --- /dev/null +++ b/src/Hermes-Exporter/Boolean.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Boolean' } + +{ #category : '*Hermes-Exporter' } +Boolean >> asExportedLiteral [ + ^ HEBoolean for: self +] diff --git a/src/Hermes-Exporter/ByteArray.extension.st b/src/Hermes-Exporter/ByteArray.extension.st new file mode 100644 index 0000000..c88b556 --- /dev/null +++ b/src/Hermes-Exporter/ByteArray.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'ByteArray' } + +{ #category : '*Hermes-Exporter' } +ByteArray >> asExportedLiteral [ + ^ HEByteArray for:self. +] diff --git a/src/Hermes-Exporter/ByteString.extension.st b/src/Hermes-Exporter/ByteString.extension.st new file mode 100644 index 0000000..919b3fb --- /dev/null +++ b/src/Hermes-Exporter/ByteString.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'ByteString' } + +{ #category : '*Hermes-Exporter' } +ByteString >> asExportedLiteral [ + ^ HEByteString for:self. +] diff --git a/src/Hermes-Exporter/ByteSymbol.extension.st b/src/Hermes-Exporter/ByteSymbol.extension.st new file mode 100644 index 0000000..5246da7 --- /dev/null +++ b/src/Hermes-Exporter/ByteSymbol.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'ByteSymbol' } + +{ #category : '*Hermes-Exporter' } +ByteSymbol >> asExportedLiteral [ + ^ HESymbol for: self. +] diff --git a/src/Hermes-Exporter/Character.extension.st b/src/Hermes-Exporter/Character.extension.st new file mode 100644 index 0000000..e4deba7 --- /dev/null +++ b/src/Hermes-Exporter/Character.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Character' } + +{ #category : '*Hermes-Exporter' } +Character >> asExportedLiteral [ + ^ HECharacter for: self +] diff --git a/src/Hermes-Exporter/ClassVariable.extension.st b/src/Hermes-Exporter/ClassVariable.extension.st new file mode 100644 index 0000000..0108ba5 --- /dev/null +++ b/src/Hermes-Exporter/ClassVariable.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'ClassVariable' } + +{ #category : '*Hermes-Exporter' } +ClassVariable >> asExportedLiteral [ + ^ HEClassVariable for: self +] diff --git a/src/Hermes-Exporter/CompiledBlock.extension.st b/src/Hermes-Exporter/CompiledBlock.extension.st new file mode 100644 index 0000000..05990d6 --- /dev/null +++ b/src/Hermes-Exporter/CompiledBlock.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'CompiledBlock' } + +{ #category : '*Hermes-Exporter' } +CompiledBlock >> asExportedLiteral [ + ^ HECompiledBlock for:self. +] diff --git a/src/Hermes-Exporter/CompiledMethod.extension.st b/src/Hermes-Exporter/CompiledMethod.extension.st new file mode 100644 index 0000000..d8082c6 --- /dev/null +++ b/src/Hermes-Exporter/CompiledMethod.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'CompiledMethod' } + +{ #category : '*Hermes-Exporter' } +CompiledMethod >> asExportedLiteral [ + ^ HEMethodLiteral for:self. +] diff --git a/src/Hermes-Exporter/Float.extension.st b/src/Hermes-Exporter/Float.extension.st new file mode 100644 index 0000000..e447437 --- /dev/null +++ b/src/Hermes-Exporter/Float.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Float' } + +{ #category : '*Hermes-Exporter' } +Float >> asExportedLiteral [ + ^ HEFloat for: self +] diff --git a/src/Hermes-Exporter/Fraction.extension.st b/src/Hermes-Exporter/Fraction.extension.st new file mode 100644 index 0000000..bc68f56 --- /dev/null +++ b/src/Hermes-Exporter/Fraction.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Fraction' } + +{ #category : '*Hermes-Exporter' } +Fraction >> asExportedLiteral [ + ^ HEFraction for: self. +] diff --git a/src/Hermes-Exporter/GlobalVariable.extension.st b/src/Hermes-Exporter/GlobalVariable.extension.st new file mode 100644 index 0000000..406085c --- /dev/null +++ b/src/Hermes-Exporter/GlobalVariable.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'GlobalVariable' } + +{ #category : '*Hermes-Exporter' } +GlobalVariable >> asExportedLiteral [ + ^ HEGlobalVariable for:self. +] diff --git a/Hermes-Exporter/HEAbstractExported.extension.st b/src/Hermes-Exporter/HEAbstractExported.extension.st similarity index 83% rename from Hermes-Exporter/HEAbstractExported.extension.st rename to src/Hermes-Exporter/HEAbstractExported.extension.st index bcde7e2..966c0db 100644 --- a/Hermes-Exporter/HEAbstractExported.extension.st +++ b/src/Hermes-Exporter/HEAbstractExported.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEAbstractExported } +Extension { #name : 'HEAbstractExported' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEAbstractExported >> encoderClassName: aMethod [ "When a method is exported the name of the encoder class used is stored with it. The name stored is the name of the target class. diff --git a/Hermes-Exporter/HEAdditionalMethodState.extension.st b/src/Hermes-Exporter/HEAdditionalMethodState.extension.st similarity index 62% rename from Hermes-Exporter/HEAdditionalMethodState.extension.st rename to src/Hermes-Exporter/HEAdditionalMethodState.extension.st index be77c23..09e0891 100644 --- a/Hermes-Exporter/HEAdditionalMethodState.extension.st +++ b/src/Hermes-Exporter/HEAdditionalMethodState.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEAdditionalMethodState } +Extension { #name : 'HEAdditionalMethodState' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEAdditionalMethodState >> doWriteInto: aWriter [ method writeInto: aWriter. selector writeInto: aWriter. diff --git a/Hermes-Exporter/HEArray.extension.st b/src/Hermes-Exporter/HEArray.extension.st similarity index 82% rename from Hermes-Exporter/HEArray.extension.st rename to src/Hermes-Exporter/HEArray.extension.st index 645c25e..0579c17 100644 --- a/Hermes-Exporter/HEArray.extension.st +++ b/src/Hermes-Exporter/HEArray.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEArray } +Extension { #name : 'HEArray' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEArray >> allDependenciesIn: aCollection [ "I check that all the traits in myself are included in the collection passed as parameters. This is used to check if the trait composition can be correctly serialized. @@ -8,7 +8,7 @@ HEArray >> allDependenciesIn: aCollection [ ^ self value flatCollect: [ :aTrait | aTrait allDependenciesIn: aCollection ] ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEArray >> doWriteInto: aWriter [ aWriter writeInt32: value size. value do:[:e | e writeInto: aWriter]. diff --git a/Hermes-Exporter/HEAssociation.extension.st b/src/Hermes-Exporter/HEAssociation.extension.st similarity index 56% rename from Hermes-Exporter/HEAssociation.extension.st rename to src/Hermes-Exporter/HEAssociation.extension.st index 1b500bc..d116fbe 100644 --- a/Hermes-Exporter/HEAssociation.extension.st +++ b/src/Hermes-Exporter/HEAssociation.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEAssociation } +Extension { #name : 'HEAssociation' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEAssociation >> doWriteInto: aWriter [ key writeInto: aWriter. value writeInto: aWriter. diff --git a/Hermes-Exporter/HEBinaryReaderWriter.class.st b/src/Hermes-Exporter/HEBinaryReaderWriter.class.st similarity index 74% rename from Hermes-Exporter/HEBinaryReaderWriter.class.st rename to src/Hermes-Exporter/HEBinaryReaderWriter.class.st index d947d81..ac4d855 100644 --- a/Hermes-Exporter/HEBinaryReaderWriter.class.st +++ b/src/Hermes-Exporter/HEBinaryReaderWriter.class.st @@ -4,33 +4,34 @@ The format used is compatible with the one in HEBinaryReader " Class { - #name : #HEBinaryReaderWriter, - #superclass : #HEBinaryReader, - #category : #'Hermes-Exporter' + #name : 'HEBinaryReaderWriter', + #superclass : 'HEBinaryReader', + #category : 'Hermes-Exporter', + #package : 'Hermes-Exporter' } -{ #category : #accessing } +{ #category : 'accessing' } HEBinaryReaderWriter >> flush [ stream flush ] -{ #category : #writting } +{ #category : 'writting' } HEBinaryReaderWriter >> writeByte: aNumber [ stream nextPut: aNumber ] -{ #category : #writting } +{ #category : 'writting' } HEBinaryReaderWriter >> writeByteArray: byteArray [ self writeInt32: byteArray size. stream nextPutAll: byteArray. ] -{ #category : #writting } +{ #category : 'writting' } HEBinaryReaderWriter >> writeByteString: aString [ self writeByteArray: aString asByteArray ] -{ #category : #writting } +{ #category : 'writting' } HEBinaryReaderWriter >> writeInt32: aNumber [ | numberToSave | numberToSave := aNumber < 0 @@ -39,7 +40,7 @@ HEBinaryReaderWriter >> writeInt32: aNumber [ 1 to: 4 do: [ :i | stream nextPut: (numberToSave byteAt: i) ] ] -{ #category : #writting } +{ #category : 'writting' } HEBinaryReaderWriter >> writeUInt32: aNumber [ 1 to: 4 do: [ :i | stream nextPut: (aNumber byteAt: i) ] ] diff --git a/Hermes-Exporter/HEBoolean.extension.st b/src/Hermes-Exporter/HEBoolean.extension.st similarity index 55% rename from Hermes-Exporter/HEBoolean.extension.st rename to src/Hermes-Exporter/HEBoolean.extension.st index 9cb405a..6ffca1f 100644 --- a/Hermes-Exporter/HEBoolean.extension.st +++ b/src/Hermes-Exporter/HEBoolean.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEBoolean } +Extension { #name : 'HEBoolean' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEBoolean >> doWriteInto: aWriter [ aWriter writeByte:(value ifTrue:1 ifFalse:0). ] diff --git a/Hermes-Exporter/HEByteArray.extension.st b/src/Hermes-Exporter/HEByteArray.extension.st similarity index 50% rename from Hermes-Exporter/HEByteArray.extension.st rename to src/Hermes-Exporter/HEByteArray.extension.st index 2fd8d8e..f135b33 100644 --- a/Hermes-Exporter/HEByteArray.extension.st +++ b/src/Hermes-Exporter/HEByteArray.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEByteArray } +Extension { #name : 'HEByteArray' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEByteArray >> doWriteInto: aWriter [ aWriter writeByteArray: value. ] diff --git a/Hermes-Exporter/HEByteString.extension.st b/src/Hermes-Exporter/HEByteString.extension.st similarity index 51% rename from Hermes-Exporter/HEByteString.extension.st rename to src/Hermes-Exporter/HEByteString.extension.st index 9e739db..ff95670 100644 --- a/Hermes-Exporter/HEByteString.extension.st +++ b/src/Hermes-Exporter/HEByteString.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEByteString } +Extension { #name : 'HEByteString' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEByteString >> doWriteInto: aWriter [ aWriter writeByteString: value. ] diff --git a/Hermes-Exporter/HEClass.extension.st b/src/Hermes-Exporter/HEClass.extension.st similarity index 87% rename from Hermes-Exporter/HEClass.extension.st rename to src/Hermes-Exporter/HEClass.extension.st index 220fecd..d594895 100644 --- a/Hermes-Exporter/HEClass.extension.st +++ b/src/Hermes-Exporter/HEClass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEClass } +Extension { #name : 'HEClass' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEClass >> allSuperclassesIn: aCollection [ "I check that all my dependencies are exported before myself" ^ aCollection detect:[:aSuper | aSuper className = self superclass] @@ -8,7 +8,7 @@ HEClass >> allSuperclassesIn: aCollection [ ifNone:[ #() ] ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEClass >> doWriteHeaderInto: aWriter [ aWriter writeByteString: className. aWriter writeByteString: superclass. @@ -19,14 +19,14 @@ HEClass >> doWriteHeaderInto: aWriter [ aWriter writeByteString: layoutClass ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEClass class >> for: aClass [ ^ self new fromClass: aClass; yourself ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEClass >> fromClass: aClass [ "I fill the header from a real class. I do not handle special slots yet" @@ -41,7 +41,7 @@ HEClass >> fromClass: aClass [ self doFromMethodContainer: aClass ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEClass >> sharedPoolsIn: aCollection [ ^ ((sharedPools substrings collect: #asSymbol) collect: [ :aName | aCollection detect: [ :aClass | aClass className = aName ] ifNone: nil ]) reject: #isNil ] diff --git a/Hermes-Exporter/HECompiledBlock.extension.st b/src/Hermes-Exporter/HECompiledBlock.extension.st similarity index 90% rename from Hermes-Exporter/HECompiledBlock.extension.st rename to src/Hermes-Exporter/HECompiledBlock.extension.st index 5b23c96..79ca4af 100644 --- a/Hermes-Exporter/HECompiledBlock.extension.st +++ b/src/Hermes-Exporter/HECompiledBlock.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HECompiledBlock } +Extension { #name : 'HECompiledBlock' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HECompiledBlock >> doWriteInto: aWriter [ aWriter writeByteString: encoderClassName. @@ -14,7 +14,7 @@ HECompiledBlock >> doWriteInto: aWriter [ literals do:[:e | e writeInto: aWriter]. ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HECompiledBlock >> value: aCompiledBlock [ | literalSpace | diff --git a/Hermes-Exporter/HEConstantBlock.extension.st b/src/Hermes-Exporter/HEConstantBlock.extension.st similarity index 76% rename from Hermes-Exporter/HEConstantBlock.extension.st rename to src/Hermes-Exporter/HEConstantBlock.extension.st index 5f6fb14..74733b1 100644 --- a/Hermes-Exporter/HEConstantBlock.extension.st +++ b/src/Hermes-Exporter/HEConstantBlock.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEConstantBlock } +Extension { #name : 'HEConstantBlock' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEConstantBlock >> doWriteInto: aWriter [ aWriter writeUInt32: numArgs. @@ -9,7 +9,7 @@ HEConstantBlock >> doWriteInto: aWriter [ ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEConstantBlock >> value: aConstantBlock [ value := aConstantBlock. diff --git a/Hermes-Exporter/HEExportTranslator.class.st b/src/Hermes-Exporter/HEExportTranslator.class.st similarity index 76% rename from Hermes-Exporter/HEExportTranslator.class.st rename to src/Hermes-Exporter/HEExportTranslator.class.st index aa52ad3..a8a252e 100644 --- a/Hermes-Exporter/HEExportTranslator.class.st +++ b/src/Hermes-Exporter/HEExportTranslator.class.st @@ -4,38 +4,39 @@ I translate the name of a given encoder class to the corresponding in the target The encoders (source and target) should use compatible bytecode, as the bytecode is not translated. " Class { - #name : #HEExportTranslator, - #superclass : #HEBinaryReader, + #name : 'HEExportTranslator', + #superclass : 'HEBinaryReader', #instVars : [ 'encoderTranslateTable' ], #classVars : [ 'Instance' ], - #category : #'Hermes-Exporter' + #category : 'Hermes-Exporter', + #package : 'Hermes-Exporter' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } HEExportTranslator class >> default [ ^ self new. ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } HEExportTranslator class >> uniqueInstance [ ^ Instance ifNil: [ Instance := self default ] ] -{ #category : #accessing } +{ #category : 'accessing' } HEExportTranslator >> encoderTranslateTable [ ^ encoderTranslateTable ] -{ #category : #accessing } +{ #category : 'accessing' } HEExportTranslator >> encoderTranslateTable: anObject [ encoderTranslateTable := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } HEExportTranslator >> initialize [ encoderTranslateTable := { #OpalEncoderForSistaV1 -> #EncoderForSistaV1. @@ -44,7 +45,7 @@ HEExportTranslator >> initialize [ } asDictionary ] -{ #category : #translate } +{ #category : 'translate' } HEExportTranslator >> translateEncoderName: aEncoderName [ ^ encoderTranslateTable at: aEncoderName asSymbol ifAbsent: [ aEncoderName ] ] diff --git a/Hermes-Exporter/HEExportedLiteral.extension.st b/src/Hermes-Exporter/HEExportedLiteral.extension.st similarity index 79% rename from Hermes-Exporter/HEExportedLiteral.extension.st rename to src/Hermes-Exporter/HEExportedLiteral.extension.st index 3294d8e..be7e0e8 100644 --- a/Hermes-Exporter/HEExportedLiteral.extension.st +++ b/src/Hermes-Exporter/HEExportedLiteral.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #HEExportedLiteral } +Extension { #name : 'HEExportedLiteral' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral class >> checkAllTags [ "I check that all my subclasses have different tag values" self assert: (self allSubclasses size = (self allSubclasses collect:#tag as:Set) size) ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral >> doWriteInto: aWriter [ "My subclasses should implement the writing strategy" self subclassResponsibility. ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral class >> for: aValue [ "Creates a new instance with this initial value" ^ self new @@ -20,13 +20,13 @@ HEExportedLiteral class >> for: aValue [ yourself ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral class >> missingTags [ "Check if all my subclasses implements the tag message" ^ self allSubclasses reject: [ :e | e class canUnderstand: #tag ] ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral class >> nextTag [ "Finds the next unused tag, useful when creating a new HEExportedLiteral" ^(self allSubclasses @@ -36,12 +36,12 @@ HEExportedLiteral class >> nextTag [ ifFalse: [ -1 ] ]) max + 1 ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral >> value: anObject [ value := anObject ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEExportedLiteral >> writeInto: aWriter [ "I write the corresponding tag of the class and then my subclasses should implement the custom behavior" aWriter writeByte: self class tag. diff --git a/Hermes-Exporter/HEFloat.extension.st b/src/Hermes-Exporter/HEFloat.extension.st similarity index 62% rename from Hermes-Exporter/HEFloat.extension.st rename to src/Hermes-Exporter/HEFloat.extension.st index b8fb9f4..e1fc0c2 100644 --- a/Hermes-Exporter/HEFloat.extension.st +++ b/src/Hermes-Exporter/HEFloat.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEFloat } +Extension { #name : 'HEFloat' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEFloat >> doWriteInto: aWriter [ aWriter writeUInt32: (value at:1). aWriter writeUInt32: (value at:2). diff --git a/Hermes-Exporter/HEFraction.extension.st b/src/Hermes-Exporter/HEFraction.extension.st similarity index 68% rename from Hermes-Exporter/HEFraction.extension.st rename to src/Hermes-Exporter/HEFraction.extension.st index 8a4877a..f8089e2 100644 --- a/Hermes-Exporter/HEFraction.extension.st +++ b/src/Hermes-Exporter/HEFraction.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEFraction } +Extension { #name : 'HEFraction' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEFraction >> doWriteInto: aWriter [ value numerator asExportedLiteral writeInto: aWriter. value denominator asExportedLiteral writeInto: aWriter. diff --git a/Hermes-Exporter/HEInteger.extension.st b/src/Hermes-Exporter/HEInteger.extension.st similarity index 68% rename from Hermes-Exporter/HEInteger.extension.st rename to src/Hermes-Exporter/HEInteger.extension.st index 0b7549b..0c034e9 100644 --- a/Hermes-Exporter/HEInteger.extension.st +++ b/src/Hermes-Exporter/HEInteger.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEInteger } +Extension { #name : 'HEInteger' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEInteger >> doWriteInto: aWriter [ aWriter writeByte: (value sign < 0 ifTrue: [ 1 ] ifFalse: [ 0 ]). aWriter writeByteArray: value asByteArray. diff --git a/Hermes-Exporter/HEMethod.extension.st b/src/Hermes-Exporter/HEMethod.extension.st similarity index 76% rename from Hermes-Exporter/HEMethod.extension.st rename to src/Hermes-Exporter/HEMethod.extension.st index c3a3cca..f13a6b3 100644 --- a/Hermes-Exporter/HEMethod.extension.st +++ b/src/Hermes-Exporter/HEMethod.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEMethod } +Extension { #name : 'HEMethod' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethod >> fillLiteralsAndBytecode: aMethod [ | literalSpace | @@ -22,22 +22,26 @@ HEMethod >> fillLiteralsAndBytecode: aMethod [ literals := literals copyWith: nil asExportedLiteral. ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethod class >> for: aMethod [ ^ self new fromMethod: aMethod; yourself ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethod >> fromMethod: aMethod [ + name := aMethod selector. className := aMethod methodClass name. - protocol := aMethod protocol. + self flag: #pharo11. "When Pharo 12 will be the minimal version we can remove this check and call #protocolName instead" + protocol := aMethod protocol isString + ifTrue: [ aMethod protocol ] + ifFalse: [ aMethod protocol name ]. self fillLiteralsAndBytecode: aMethod ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethod >> writeInto: aWriter [ aWriter writeByteString: name. aWriter writeByteString: className. diff --git a/Hermes-Exporter/HEMethodContainer.extension.st b/src/Hermes-Exporter/HEMethodContainer.extension.st similarity index 86% rename from Hermes-Exporter/HEMethodContainer.extension.st rename to src/Hermes-Exporter/HEMethodContainer.extension.st index 026f379..359c674 100644 --- a/Hermes-Exporter/HEMethodContainer.extension.st +++ b/src/Hermes-Exporter/HEMethodContainer.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEMethodContainer } +Extension { #name : 'HEMethodContainer' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethodContainer >> doFromMethodContainer: aMethodContainer [ "When a class or a trait is transformed all the methods should be transformed. In both the class and instance side. Also the trait composition should be handled" @@ -18,12 +18,12 @@ HEMethodContainer >> doFromMethodContainer: aMethodContainer [ thenCollect: [ :e | HEMethod for: e ] ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethodContainer >> doWriteHeaderInto: aWriter [ self subclassResponsibility ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethodContainer >> doWriteMethods: aWriter [ aWriter writeByteString: category. @@ -37,7 +37,7 @@ HEMethodContainer >> doWriteMethods: aWriter [ classTraitComposition writeInto: aWriter ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethodContainer >> writeInto: aWriter [ self doWriteHeaderInto: aWriter. self doWriteMethods: aWriter diff --git a/Hermes-Exporter/HEMethodLiteral.extension.st b/src/Hermes-Exporter/HEMethodLiteral.extension.st similarity index 61% rename from Hermes-Exporter/HEMethodLiteral.extension.st rename to src/Hermes-Exporter/HEMethodLiteral.extension.st index 155a9c7..9746199 100644 --- a/Hermes-Exporter/HEMethodLiteral.extension.st +++ b/src/Hermes-Exporter/HEMethodLiteral.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEMethodLiteral } +Extension { #name : 'HEMethodLiteral' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEMethodLiteral >> doWriteInto: aWriter [ aWriter writeByteString: className. aWriter writeByteString: selector. diff --git a/Hermes-Exporter/HEPackage.extension.st b/src/Hermes-Exporter/HEPackage.extension.st similarity index 87% rename from Hermes-Exporter/HEPackage.extension.st rename to src/Hermes-Exporter/HEPackage.extension.st index f67e9ff..5346944 100644 --- a/Hermes-Exporter/HEPackage.extension.st +++ b/src/Hermes-Exporter/HEPackage.extension.st @@ -1,19 +1,19 @@ -Extension { #name : #HEPackage } +Extension { #name : 'HEPackage' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPackage >> allSharedPoolsOf: aClass in: aCollection [ "Used to check the dependency order when exporting" ^ ({aClass} , (aClass allSuperclassesIn: aCollection)) flatCollect: [:e | e sharedPoolsIn: aCollection]. ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPackage class >> for: aPackage [ ^ self new fromPackage: aPackage; yourself ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPackage >> fromPackage: aPackage [ packageName := aPackage name. @@ -23,13 +23,13 @@ HEPackage >> fromPackage: aPackage [ extensionMethods := aPackage extensionMethods collect: [ :e | HEMethod for: e ] ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPackage >> numberOfRequiredClassesOf: aClass in: aCollection [ "Used to sort the classes by dependency" ^ ((aClass allSuperclassesIn: aCollection) , ((self allSharedPoolsOf: aClass in: aCollection) flatCollect: [:e | {e} , (e allSuperclassesIn: aCollection)])) size ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPackage >> sortContent [ | allClasses| "The classes and traits should be ordered by dependencies so it is easier to import in the target image" @@ -40,7 +40,7 @@ HEPackage >> sortContent [ ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPackage >> writeInto: aWriter [ self sortContent. diff --git a/Hermes-Exporter/HEPragma.extension.st b/src/Hermes-Exporter/HEPragma.extension.st similarity index 64% rename from Hermes-Exporter/HEPragma.extension.st rename to src/Hermes-Exporter/HEPragma.extension.st index 1f67e0c..34f8e8f 100644 --- a/Hermes-Exporter/HEPragma.extension.st +++ b/src/Hermes-Exporter/HEPragma.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEPragma } +Extension { #name : 'HEPragma' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEPragma >> doWriteInto: aWriter [ method writeInto: aWriter. keyword writeInto: aWriter. diff --git a/Hermes-Exporter/HEScaledDecimal.extension.st b/src/Hermes-Exporter/HEScaledDecimal.extension.st similarity index 62% rename from Hermes-Exporter/HEScaledDecimal.extension.st rename to src/Hermes-Exporter/HEScaledDecimal.extension.st index ed78655..f807b72 100644 --- a/Hermes-Exporter/HEScaledDecimal.extension.st +++ b/src/Hermes-Exporter/HEScaledDecimal.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEScaledDecimal } +Extension { #name : 'HEScaledDecimal' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEScaledDecimal >> doWriteInto: aWriter [ super doWriteInto: aWriter. value scale asExportedLiteral writeInto: aWriter. diff --git a/Hermes-Exporter/HESendMessage.extension.st b/src/Hermes-Exporter/HESendMessage.extension.st similarity index 65% rename from Hermes-Exporter/HESendMessage.extension.st rename to src/Hermes-Exporter/HESendMessage.extension.st index b2d6864..505ada7 100644 --- a/Hermes-Exporter/HESendMessage.extension.st +++ b/src/Hermes-Exporter/HESendMessage.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HESendMessage } +Extension { #name : 'HESendMessage' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HESendMessage >> doWriteInto: aWriter [ selector writeInto: aWriter. diff --git a/Hermes-Exporter/HETrait.extension.st b/src/Hermes-Exporter/HETrait.extension.st similarity index 64% rename from Hermes-Exporter/HETrait.extension.st rename to src/Hermes-Exporter/HETrait.extension.st index ce92881..75756f5 100644 --- a/Hermes-Exporter/HETrait.extension.st +++ b/src/Hermes-Exporter/HETrait.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #HETrait } +Extension { #name : 'HETrait' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HETrait >> doWriteHeaderInto: aWriter [ aWriter writeByteString: traitName ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HETrait class >> for: aTrait [ ^ self new fromTrait: aTrait; yourself ] -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HETrait >> fromTrait: aTrait [ traitName := aTrait name. diff --git a/Hermes-Exporter/HETraitCompositionExporter.class.st b/src/Hermes-Exporter/HETraitCompositionExporter.class.st similarity index 77% rename from Hermes-Exporter/HETraitCompositionExporter.class.st rename to src/Hermes-Exporter/HETraitCompositionExporter.class.st index 5364f60..5d3bd16 100644 --- a/Hermes-Exporter/HETraitCompositionExporter.class.st +++ b/src/Hermes-Exporter/HETraitCompositionExporter.class.st @@ -3,18 +3,20 @@ I am a visitor for visiting trait compositions. Each trait composition is visited and translated to a set of HEMessageSend and literals. " Class { - #name : #HETraitCompositionExporter, - #superclass : #Object, - #category : #'Hermes-Exporter-Traits' + #name : 'HETraitCompositionExporter', + #superclass : 'Object', + #category : 'Hermes-Exporter-Traits', + #package : 'Hermes-Exporter', + #tag : 'Traits' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } HETraitCompositionExporter class >> export: aTraitComposition [ ^ self new export: aTraitComposition ] -{ #category : #exporting } +{ #category : 'exporting' } HETraitCompositionExporter >> export: aTraitComposition [ | node | @@ -23,25 +25,25 @@ HETraitCompositionExporter >> export: aTraitComposition [ ^ node acceptVisitor: self ] -{ #category : #visiting } +{ #category : 'visiting' } HETraitCompositionExporter >> visitArrayNode: aArrayNode [ ^ (aArrayNode statements collect: [ :e | e acceptVisitor: self ] as: Array) asExportedLiteral ] -{ #category : #visiting } +{ #category : 'visiting' } HETraitCompositionExporter >> visitLiteralNode: aLiteralValueNode [ ^ aLiteralValueNode value asExportedLiteral ] -{ #category : #visiting } +{ #category : 'visiting' } HETraitCompositionExporter >> visitLiteralValueNode: aRBLiteralValueNode [ ^ self visitLiteralNode: aRBLiteralValueNode ] -{ #category : #visiting } +{ #category : 'visiting' } HETraitCompositionExporter >> visitMessageNode: aMessageNode [ ^ HESendMessage @@ -50,7 +52,7 @@ HETraitCompositionExporter >> visitMessageNode: aMessageNode [ arguments: (aMessageNode arguments collect: [:e | e acceptVisitor: self ]) asExportedLiteral ] -{ #category : #visiting } +{ #category : 'visiting' } HETraitCompositionExporter >> visitVariableNode: aVariableNode [ ^ HETraitLiteral for: aVariableNode diff --git a/Hermes-Exporter/HETraitLiteral.extension.st b/src/Hermes-Exporter/HETraitLiteral.extension.st similarity index 75% rename from Hermes-Exporter/HETraitLiteral.extension.st rename to src/Hermes-Exporter/HETraitLiteral.extension.st index d96aa81..4ff12cd 100644 --- a/Hermes-Exporter/HETraitLiteral.extension.st +++ b/src/Hermes-Exporter/HETraitLiteral.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HETraitLiteral } +Extension { #name : 'HETraitLiteral' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HETraitLiteral >> allDependenciesIn: aCollection [ "I am used to check that all my dependencies are fulfilled before myself" ^ aCollection detect: [ :aTrait | aTrait traitName = self value ] ifFound: [ :x | {x} ] ifNone: [ #() ] diff --git a/src/Hermes-Exporter/HEUndefinedObject.extension.st b/src/Hermes-Exporter/HEUndefinedObject.extension.st new file mode 100644 index 0000000..5dd0d94 --- /dev/null +++ b/src/Hermes-Exporter/HEUndefinedObject.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'HEUndefinedObject' } + +{ #category : '*Hermes-Exporter' } +HEUndefinedObject >> doWriteInto: aWriter [ + +] diff --git a/Hermes-Exporter/HEWideString.extension.st b/src/Hermes-Exporter/HEWideString.extension.st similarity index 54% rename from Hermes-Exporter/HEWideString.extension.st rename to src/Hermes-Exporter/HEWideString.extension.st index 763ede8..71c352e 100644 --- a/Hermes-Exporter/HEWideString.extension.st +++ b/src/Hermes-Exporter/HEWideString.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HEWideString } +Extension { #name : 'HEWideString' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } HEWideString >> doWriteInto: aWriter [ aWriter writeByteArray: value utf8Encoded. ] diff --git a/src/Hermes-Exporter/Integer.extension.st b/src/Hermes-Exporter/Integer.extension.st new file mode 100644 index 0000000..0430f4f --- /dev/null +++ b/src/Hermes-Exporter/Integer.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Integer' } + +{ #category : '*Hermes-Exporter' } +Integer >> asExportedLiteral [ + ^ HEInteger for: self +] diff --git a/Hermes-Exporter/Metaclass.extension.st b/src/Hermes-Exporter/Metaclass.extension.st similarity index 50% rename from Hermes-Exporter/Metaclass.extension.st rename to src/Hermes-Exporter/Metaclass.extension.st index 9f758f0..01f218f 100644 --- a/Hermes-Exporter/Metaclass.extension.st +++ b/src/Hermes-Exporter/Metaclass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Metaclass } +Extension { #name : 'Metaclass' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } Metaclass >> asExportedLiteral [ ^ HEExportedMetaclass for:self. ] diff --git a/src/Hermes-Exporter/MetaclassForTraits.extension.st b/src/Hermes-Exporter/MetaclassForTraits.extension.st new file mode 100644 index 0000000..2bfdc22 --- /dev/null +++ b/src/Hermes-Exporter/MetaclassForTraits.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'MetaclassForTraits' } + +{ #category : '*Hermes-Exporter' } +MetaclassForTraits >> asExportedLiteral [ + ^ HEClassTrait for: self +] diff --git a/src/Hermes-Exporter/Pragma.extension.st b/src/Hermes-Exporter/Pragma.extension.st new file mode 100644 index 0000000..1429ed5 --- /dev/null +++ b/src/Hermes-Exporter/Pragma.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Pragma' } + +{ #category : '*Hermes-Exporter' } +Pragma >> asExportedLiteral [ + ^ HEPragma for: self. +] diff --git a/src/Hermes-Exporter/ScaledDecimal.extension.st b/src/Hermes-Exporter/ScaledDecimal.extension.st new file mode 100644 index 0000000..365fb2b --- /dev/null +++ b/src/Hermes-Exporter/ScaledDecimal.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'ScaledDecimal' } + +{ #category : '*Hermes-Exporter' } +ScaledDecimal >> asExportedLiteral [ + ^ HEScaledDecimal for: self. +] diff --git a/Hermes-Exporter/TaAbstractComposition.extension.st b/src/Hermes-Exporter/TaAbstractComposition.extension.st similarity index 53% rename from Hermes-Exporter/TaAbstractComposition.extension.st rename to src/Hermes-Exporter/TaAbstractComposition.extension.st index eb9d3d3..9e98009 100644 --- a/Hermes-Exporter/TaAbstractComposition.extension.st +++ b/src/Hermes-Exporter/TaAbstractComposition.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #TaAbstractComposition } +Extension { #name : 'TaAbstractComposition' } -{ #category : #'*Hermes-Exporter' } +{ #category : '*Hermes-Exporter' } TaAbstractComposition >> asExportedLiteral [ ^ HETraitCompositionExporter export: self. diff --git a/src/Hermes-Exporter/Trait.extension.st b/src/Hermes-Exporter/Trait.extension.st new file mode 100644 index 0000000..195e2c2 --- /dev/null +++ b/src/Hermes-Exporter/Trait.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'Trait' } + +{ #category : '*Hermes-Exporter' } +Trait >> asExportedLiteral [ + ^ HETraitLiteral for: self. +] diff --git a/src/Hermes-Exporter/UndeclaredVariable.extension.st b/src/Hermes-Exporter/UndeclaredVariable.extension.st new file mode 100644 index 0000000..fd9bdc2 --- /dev/null +++ b/src/Hermes-Exporter/UndeclaredVariable.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'UndeclaredVariable' } + +{ #category : '*Hermes-Exporter' } +UndeclaredVariable >> asExportedLiteral [ + ^ HEGlobalVariable for:self. +] diff --git a/src/Hermes-Exporter/UndefinedObject.extension.st b/src/Hermes-Exporter/UndefinedObject.extension.st new file mode 100644 index 0000000..2258571 --- /dev/null +++ b/src/Hermes-Exporter/UndefinedObject.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'UndefinedObject' } + +{ #category : '*Hermes-Exporter' } +UndefinedObject >> asExportedLiteral [ + ^ HEUndefinedObject for:self. +] diff --git a/src/Hermes-Exporter/WideString.extension.st b/src/Hermes-Exporter/WideString.extension.st new file mode 100644 index 0000000..d5ceda9 --- /dev/null +++ b/src/Hermes-Exporter/WideString.extension.st @@ -0,0 +1,6 @@ +Extension { #name : 'WideString' } + +{ #category : '*Hermes-Exporter' } +WideString >> asExportedLiteral [ + ^ HEWideString for:self. +] diff --git a/src/Hermes-Exporter/package.st b/src/Hermes-Exporter/package.st new file mode 100644 index 0000000..b0bee5b --- /dev/null +++ b/src/Hermes-Exporter/package.st @@ -0,0 +1 @@ +Package { #name : 'Hermes-Exporter' } diff --git a/Hermes-Extensions/HEDuplicationModeStrategy.class.st b/src/Hermes-Extensions/HEDuplicationModeStrategy.class.st similarity index 100% rename from Hermes-Extensions/HEDuplicationModeStrategy.class.st rename to src/Hermes-Extensions/HEDuplicationModeStrategy.class.st diff --git a/Hermes-Extensions/HEExtendedInstaller.class.st b/src/Hermes-Extensions/HEExtendedInstaller.class.st similarity index 100% rename from Hermes-Extensions/HEExtendedInstaller.class.st rename to src/Hermes-Extensions/HEExtendedInstaller.class.st diff --git a/Hermes-Extensions/HEFailOnDuplication.class.st b/src/Hermes-Extensions/HEFailOnDuplication.class.st similarity index 100% rename from Hermes-Extensions/HEFailOnDuplication.class.st rename to src/Hermes-Extensions/HEFailOnDuplication.class.st diff --git a/Hermes-Extensions/HEIgnoreOnDuplication.class.st b/src/Hermes-Extensions/HEIgnoreOnDuplication.class.st similarity index 100% rename from Hermes-Extensions/HEIgnoreOnDuplication.class.st rename to src/Hermes-Extensions/HEIgnoreOnDuplication.class.st diff --git a/Hermes-Extensions/HEReplaceOnDuplication.class.st b/src/Hermes-Extensions/HEReplaceOnDuplication.class.st similarity index 100% rename from Hermes-Extensions/HEReplaceOnDuplication.class.st rename to src/Hermes-Extensions/HEReplaceOnDuplication.class.st diff --git a/Hermes-Extensions/package.st b/src/Hermes-Extensions/package.st similarity index 100% rename from Hermes-Extensions/package.st rename to src/Hermes-Extensions/package.st diff --git a/Hermes-Ring2/HERing2ToHermesBuilder.class.st b/src/Hermes-Ring2/HERing2ToHermesBuilder.class.st similarity index 74% rename from Hermes-Ring2/HERing2ToHermesBuilder.class.st rename to src/Hermes-Ring2/HERing2ToHermesBuilder.class.st index 852c9ed..8d25994 100644 --- a/Hermes-Ring2/HERing2ToHermesBuilder.class.st +++ b/src/Hermes-Ring2/HERing2ToHermesBuilder.class.st @@ -1,21 +1,27 @@ Class { - #name : #HERing2ToHermesBuilder, - #superclass : #Object, - #category : #'Hermes-Ring2' + #name : 'HERing2ToHermesBuilder', + #superclass : 'Object', + #category : 'Hermes-Ring2', + #package : 'Hermes-Ring2' } -{ #category : #compiling } +{ #category : 'compiling' } HERing2ToHermesBuilder >> compileMethod: aRGMethod [ - - ^ OpalCompiler new - class: aRGMethod parent; - source: aRGMethod sourceCode; - compiledMethodClass: CompiledMethod; - environment: aRGMethod environment; - compile + + | compiler | + compiler := self class compiler + class: aRGMethod parent; + source: aRGMethod sourceCode; + compiledMethodClass: CompiledMethod; + environment: aRGMethod environment; + yourself. + self flag: #pharo11. "When Pharo12 will be the minimal version, remove the need of this condition." + SystemVersion current major >= 12 ifTrue: [ compiler permitUndeclared: true ]. + + ^ compiler compile ] -{ #category : #visiting } +{ #category : 'visiting' } HERing2ToHermesBuilder >> visitClass: aClass [ | aHEClass | @@ -42,22 +48,25 @@ HERing2ToHermesBuilder >> visitClass: aClass [ ^ aHEClass ] -{ #category : #visiting } +{ #category : 'visiting' } HERing2ToHermesBuilder >> visitMethod: aMethod [ + | aHEMethod compiledMethod | - aHEMethod := HEMethod new. + aHEMethod := HEMethod new. aHEMethod name: aMethod selector. aHEMethod className: aMethod methodClass name. - aHEMethod protocol: aMethod protocol. + aHEMethod protocol: (aMethod protocol isString + ifTrue: [ aMethod protocol ] + ifFalse: [ aMethod protocol name ]). compiledMethod := self compileMethod: aMethod. aHEMethod fillLiteralsAndBytecode: compiledMethod. - + ^ aHEMethod ] -{ #category : #visiting } +{ #category : 'visiting' } HERing2ToHermesBuilder >> visitMethodContainer: aMethodContainer using: aHEClass [ | instanceMethods classMethods | @@ -78,7 +87,7 @@ HERing2ToHermesBuilder >> visitMethodContainer: aMethodContainer using: aHEClass (classMethods collect: [ :e | e acceptVisitor: self ]) ] -{ #category : #visiting } +{ #category : 'visiting' } HERing2ToHermesBuilder >> visitPackage: aPackage [ | aHEPackage classDefinedSorted | aHEPackage := HEPackage new. @@ -93,7 +102,7 @@ HERing2ToHermesBuilder >> visitPackage: aPackage [ ^ aHEPackage. ] -{ #category : #visiting } +{ #category : 'visiting' } HERing2ToHermesBuilder >> visitTrait: aTrait [ | aHETrait | diff --git a/Hermes-Ring2/RGBehavior.extension.st b/src/Hermes-Ring2/RGBehavior.extension.st similarity index 71% rename from Hermes-Ring2/RGBehavior.extension.st rename to src/Hermes-Ring2/RGBehavior.extension.st index 20c49b2..124449a 100644 --- a/Hermes-Ring2/RGBehavior.extension.st +++ b/src/Hermes-Ring2/RGBehavior.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RGBehavior } +Extension { #name : 'RGBehavior' } -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGBehavior >> categoryOfElement: aSymbol [ | aMethod | diff --git a/Hermes-Ring2/RGClassVariable.extension.st b/src/Hermes-Ring2/RGClassVariable.extension.st similarity index 65% rename from Hermes-Ring2/RGClassVariable.extension.st rename to src/Hermes-Ring2/RGClassVariable.extension.st index 1a52dda..89ca0fa 100644 --- a/Hermes-Ring2/RGClassVariable.extension.st +++ b/src/Hermes-Ring2/RGClassVariable.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #RGClassVariable } +Extension { #name : 'RGClassVariable' } -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGClassVariable >> asExportedLiteral [ ^ HEClassVariable for: self ] -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGClassVariable >> emitStore: methodBuilder [ methodBuilder storeIntoLiteralVariable: self. @@ -13,7 +13,7 @@ RGClassVariable >> emitStore: methodBuilder [ ] -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGClassVariable >> emitValue: methodBuilder [ methodBuilder pushLiteralVariable: self. diff --git a/src/Hermes-Ring2/RGEnvironment.extension.st b/src/Hermes-Ring2/RGEnvironment.extension.st new file mode 100644 index 0000000..f378003 --- /dev/null +++ b/src/Hermes-Ring2/RGEnvironment.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'RGEnvironment' } + +{ #category : '*Hermes-Ring2' } +RGEnvironment >> packages [ + + ^ self ask packages +] diff --git a/Hermes-Ring2/RGGlobalVariable.extension.st b/src/Hermes-Ring2/RGGlobalVariable.extension.st similarity index 65% rename from Hermes-Ring2/RGGlobalVariable.extension.st rename to src/Hermes-Ring2/RGGlobalVariable.extension.st index 2e4039a..57cde9a 100644 --- a/Hermes-Ring2/RGGlobalVariable.extension.st +++ b/src/Hermes-Ring2/RGGlobalVariable.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #RGGlobalVariable } +Extension { #name : 'RGGlobalVariable' } -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGGlobalVariable >> asExportedLiteral [ ^ HEGlobalVariable for:self. ] -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGGlobalVariable >> emitStore: methodBuilder [ methodBuilder storeIntoLiteralVariable: self. ] -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGGlobalVariable >> emitValue: methodBuilder [ methodBuilder pushLiteralVariable: self. ] diff --git a/src/Hermes-Ring2/RGLayout.extension.st b/src/Hermes-Ring2/RGLayout.extension.st new file mode 100644 index 0000000..599e5f9 --- /dev/null +++ b/src/Hermes-Ring2/RGLayout.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'RGLayout' } + +{ #category : '*Hermes-Ring2' } +RGLayout >> slots [ + + ^ { } +] diff --git a/Hermes-Ring2/RGMetaclassStrategy.extension.st b/src/Hermes-Ring2/RGMetaclassStrategy.extension.st similarity index 50% rename from Hermes-Ring2/RGMetaclassStrategy.extension.st rename to src/Hermes-Ring2/RGMetaclassStrategy.extension.st index c170bb5..ea27ddc 100644 --- a/Hermes-Ring2/RGMetaclassStrategy.extension.st +++ b/src/Hermes-Ring2/RGMetaclassStrategy.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RGMetaclassStrategy } +Extension { #name : 'RGMetaclassStrategy' } -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGMetaclassStrategy >> asExportedLiteral [ ^ HEExportedMetaclass for:self. ] diff --git a/Hermes-Ring2/RGMethod.extension.st b/src/Hermes-Ring2/RGMethod.extension.st similarity index 51% rename from Hermes-Ring2/RGMethod.extension.st rename to src/Hermes-Ring2/RGMethod.extension.st index 8116b81..02791cc 100644 --- a/Hermes-Ring2/RGMethod.extension.st +++ b/src/Hermes-Ring2/RGMethod.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #RGMethod } +Extension { #name : 'RGMethod' } -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGMethod >> acceptVisitor: aVisitor [ ^ aVisitor visitMethod: self ] -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGMethod >> header [ ^ 7 diff --git a/Hermes-Ring2/RGTraitComposition.extension.st b/src/Hermes-Ring2/RGTraitComposition.extension.st similarity index 60% rename from Hermes-Ring2/RGTraitComposition.extension.st rename to src/Hermes-Ring2/RGTraitComposition.extension.st index 39a9d7e..603f2c0 100644 --- a/Hermes-Ring2/RGTraitComposition.extension.st +++ b/src/Hermes-Ring2/RGTraitComposition.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RGTraitComposition } +Extension { #name : 'RGTraitComposition' } -{ #category : #'*Hermes-Ring2' } +{ #category : '*Hermes-Ring2' } RGTraitComposition >> asExportedLiteral [ ^ HETraitCompositionExporter export: self traitCompositionString diff --git a/src/Hermes-Ring2/package.st b/src/Hermes-Ring2/package.st new file mode 100644 index 0000000..78e8b92 --- /dev/null +++ b/src/Hermes-Ring2/package.st @@ -0,0 +1 @@ +Package { #name : 'Hermes-Ring2' } diff --git a/Hermes-Tests-Changes-Collector/HEAbstractChangeCollectorTest.class.st b/src/Hermes-Tests-Changes-Collector/HEAbstractChangeCollectorTest.class.st similarity index 100% rename from Hermes-Tests-Changes-Collector/HEAbstractChangeCollectorTest.class.st rename to src/Hermes-Tests-Changes-Collector/HEAbstractChangeCollectorTest.class.st diff --git a/Hermes-Tests-Changes-Collector/HEChangeSetTest.class.st b/src/Hermes-Tests-Changes-Collector/HEChangeSetTest.class.st similarity index 100% rename from Hermes-Tests-Changes-Collector/HEChangeSetTest.class.st rename to src/Hermes-Tests-Changes-Collector/HEChangeSetTest.class.st diff --git a/Hermes-Tests-Changes-Collector/HEClassChangeCollectorTest.class.st b/src/Hermes-Tests-Changes-Collector/HEClassChangeCollectorTest.class.st similarity index 100% rename from Hermes-Tests-Changes-Collector/HEClassChangeCollectorTest.class.st rename to src/Hermes-Tests-Changes-Collector/HEClassChangeCollectorTest.class.st diff --git a/Hermes-Tests-Changes-Collector/HEMethodChangeCollectorTest.class.st b/src/Hermes-Tests-Changes-Collector/HEMethodChangeCollectorTest.class.st similarity index 100% rename from Hermes-Tests-Changes-Collector/HEMethodChangeCollectorTest.class.st rename to src/Hermes-Tests-Changes-Collector/HEMethodChangeCollectorTest.class.st diff --git a/Hermes-Tests-Changes-Collector/package.st b/src/Hermes-Tests-Changes-Collector/package.st similarity index 100% rename from Hermes-Tests-Changes-Collector/package.st rename to src/Hermes-Tests-Changes-Collector/package.st diff --git a/Hermes-Tests-Classes/HETeSimpleClass.class.st b/src/Hermes-Tests-Classes/HETeSimpleClass.class.st similarity index 100% rename from Hermes-Tests-Classes/HETeSimpleClass.class.st rename to src/Hermes-Tests-Classes/HETeSimpleClass.class.st diff --git a/Hermes-Tests-Classes/HETeSimpleClassReferingClass.class.st b/src/Hermes-Tests-Classes/HETeSimpleClassReferingClass.class.st similarity index 100% rename from Hermes-Tests-Classes/HETeSimpleClassReferingClass.class.st rename to src/Hermes-Tests-Classes/HETeSimpleClassReferingClass.class.st diff --git a/Hermes-Tests-Classes/HETeSimpleClassWithBlocks.class.st b/src/Hermes-Tests-Classes/HETeSimpleClassWithBlocks.class.st similarity index 74% rename from Hermes-Tests-Classes/HETeSimpleClassWithBlocks.class.st rename to src/Hermes-Tests-Classes/HETeSimpleClassWithBlocks.class.st index 3f0e6c2..1761a3d 100644 --- a/Hermes-Tests-Classes/HETeSimpleClassWithBlocks.class.st +++ b/src/Hermes-Tests-Classes/HETeSimpleClassWithBlocks.class.st @@ -17,6 +17,14 @@ Class { { #category : #'test methods' } HETeSimpleClassWithBlocks >> aMethodWithABlock [ + ^ [ + self. + 42 ] +] + +{ #category : #'test methods' } +HETeSimpleClassWithBlocks >> aMethodWithAContantBlock [ + ^ [ 42 ] ] @@ -25,9 +33,12 @@ HETeSimpleClassWithBlocks >> aMethodWithNestedBlocks [ passedTheEnsure := false. - ^ [ [ 42 ] on: Error - do: [ ^ self halt ] ] - ensure: [ passedTheEnsure := true ]. + ^ [ + [ + self. + 42 ] + on: Error + do: [ ^ self halt ] ] ensure: [ passedTheEnsure := true ] ] { #category : #'test methods' } diff --git a/Hermes-Tests-Classes/HETeSimpleClassWithComplexTraits.class.st b/src/Hermes-Tests-Classes/HETeSimpleClassWithComplexTraits.class.st similarity index 100% rename from Hermes-Tests-Classes/HETeSimpleClassWithComplexTraits.class.st rename to src/Hermes-Tests-Classes/HETeSimpleClassWithComplexTraits.class.st diff --git a/Hermes-Tests-Classes/HETeSimpleClassWithNilSuperclass.class.st b/src/Hermes-Tests-Classes/HETeSimpleClassWithNilSuperclass.class.st similarity index 100% rename from Hermes-Tests-Classes/HETeSimpleClassWithNilSuperclass.class.st rename to src/Hermes-Tests-Classes/HETeSimpleClassWithNilSuperclass.class.st diff --git a/Hermes-Tests-Classes/HETeSimpleClassWithTraits.class.st b/src/Hermes-Tests-Classes/HETeSimpleClassWithTraits.class.st similarity index 100% rename from Hermes-Tests-Classes/HETeSimpleClassWithTraits.class.st rename to src/Hermes-Tests-Classes/HETeSimpleClassWithTraits.class.st diff --git a/Hermes-Tests-Classes/THEATraitUsingOthers.trait.st b/src/Hermes-Tests-Classes/THEATraitUsingOthers.trait.st similarity index 100% rename from Hermes-Tests-Classes/THEATraitUsingOthers.trait.st rename to src/Hermes-Tests-Classes/THEATraitUsingOthers.trait.st diff --git a/Hermes-Tests-Classes/THEOneTestTrait.trait.st b/src/Hermes-Tests-Classes/THEOneTestTrait.trait.st similarity index 100% rename from Hermes-Tests-Classes/THEOneTestTrait.trait.st rename to src/Hermes-Tests-Classes/THEOneTestTrait.trait.st diff --git a/Hermes-Tests-Classes/THEOtherTestTrait.trait.st b/src/Hermes-Tests-Classes/THEOtherTestTrait.trait.st similarity index 100% rename from Hermes-Tests-Classes/THEOtherTestTrait.trait.st rename to src/Hermes-Tests-Classes/THEOtherTestTrait.trait.st diff --git a/Hermes-Tests-Classes/package.st b/src/Hermes-Tests-Classes/package.st similarity index 100% rename from Hermes-Tests-Classes/package.st rename to src/Hermes-Tests-Classes/package.st diff --git a/Hermes-Tests-External-Package/AClassToBeExtracted.class.st b/src/Hermes-Tests-External-Package/AClassToBeExtracted.class.st similarity index 100% rename from Hermes-Tests-External-Package/AClassToBeExtracted.class.st rename to src/Hermes-Tests-External-Package/AClassToBeExtracted.class.st diff --git a/Hermes-Tests-External-Package/AClassToBeExtractedFactory.class.st b/src/Hermes-Tests-External-Package/AClassToBeExtractedFactory.class.st similarity index 100% rename from Hermes-Tests-External-Package/AClassToBeExtractedFactory.class.st rename to src/Hermes-Tests-External-Package/AClassToBeExtractedFactory.class.st diff --git a/Hermes-Tests-External-Package/HETeSimpleClassWithComplexTraits.extension.st b/src/Hermes-Tests-External-Package/HETeSimpleClassWithComplexTraits.extension.st similarity index 100% rename from Hermes-Tests-External-Package/HETeSimpleClassWithComplexTraits.extension.st rename to src/Hermes-Tests-External-Package/HETeSimpleClassWithComplexTraits.extension.st diff --git a/Hermes-Tests-External-Package/TSimpleTraitToBeExtracted.trait.st b/src/Hermes-Tests-External-Package/TSimpleTraitToBeExtracted.trait.st similarity index 100% rename from Hermes-Tests-External-Package/TSimpleTraitToBeExtracted.trait.st rename to src/Hermes-Tests-External-Package/TSimpleTraitToBeExtracted.trait.st diff --git a/Hermes-Tests-External-Package/package.st b/src/Hermes-Tests-External-Package/package.st similarity index 100% rename from Hermes-Tests-External-Package/package.st rename to src/Hermes-Tests-External-Package/package.st diff --git a/Hermes-Tests-Ring/HERingTest.class.st b/src/Hermes-Tests-Ring/HERingTest.class.st similarity index 100% rename from Hermes-Tests-Ring/HERingTest.class.st rename to src/Hermes-Tests-Ring/HERingTest.class.st diff --git a/Hermes-Tests-Ring/HETestRingAgainstHermesModel.class.st b/src/Hermes-Tests-Ring/HETestRingAgainstHermesModel.class.st similarity index 100% rename from Hermes-Tests-Ring/HETestRingAgainstHermesModel.class.st rename to src/Hermes-Tests-Ring/HETestRingAgainstHermesModel.class.st diff --git a/Hermes-Tests-Ring/HETestRingAgainstSystemClasses.class.st b/src/Hermes-Tests-Ring/HETestRingAgainstSystemClasses.class.st similarity index 100% rename from Hermes-Tests-Ring/HETestRingAgainstSystemClasses.class.st rename to src/Hermes-Tests-Ring/HETestRingAgainstSystemClasses.class.st diff --git a/Hermes-Tests-Ring/package.st b/src/Hermes-Tests-Ring/package.st similarity index 100% rename from Hermes-Tests-Ring/package.st rename to src/Hermes-Tests-Ring/package.st diff --git a/Hermes-Tests/HEAbstractBinaryClassBuilderTest.class.st b/src/Hermes-Tests/HEAbstractBinaryClassBuilderTest.class.st similarity index 76% rename from Hermes-Tests/HEAbstractBinaryClassBuilderTest.class.st rename to src/Hermes-Tests/HEAbstractBinaryClassBuilderTest.class.st index 1f67173..416fc63 100644 --- a/Hermes-Tests/HEAbstractBinaryClassBuilderTest.class.st +++ b/src/Hermes-Tests/HEAbstractBinaryClassBuilderTest.class.st @@ -2,18 +2,19 @@ The abstract class of all the Hermes tests. It creates a reader and a writer . " Class { - #name : #HEAbstractBinaryClassBuilderTest, - #superclass : #TestCase, + #name : 'HEAbstractBinaryClassBuilderTest', + #superclass : 'TestCase', #instVars : [ 'filename', 'reader', 'writer', 'fileReference' ], - #category : #'Hermes-Tests' + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #initialization } +{ #category : 'initialization' } HEAbstractBinaryClassBuilderTest >> setUp [ super setUp. fileReference := (FileReference newTempFilePrefix: 'export' suffix: '.exp'). @@ -29,7 +30,7 @@ HEAbstractBinaryClassBuilderTest >> setUp [ ] -{ #category : #initialization } +{ #category : 'initialization' } HEAbstractBinaryClassBuilderTest >> tearDown [ writer close. reader close. diff --git a/Hermes-Tests/HECommandLineHandlerTest.class.st b/src/Hermes-Tests/HECommandLineHandlerTest.class.st similarity index 88% rename from Hermes-Tests/HECommandLineHandlerTest.class.st rename to src/Hermes-Tests/HECommandLineHandlerTest.class.st index 153be4b..1fb8855 100644 --- a/Hermes-Tests/HECommandLineHandlerTest.class.st +++ b/src/Hermes-Tests/HECommandLineHandlerTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HECommandLineHandlerTest, - #superclass : #TestCase, - #category : #'Hermes-Tests' + #name : 'HECommandLineHandlerTest', + #superclass : 'TestCase', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testDuplicationModeDefault [ | handler installer | handler := HermesCommandLineHandler new. @@ -14,7 +15,7 @@ HECommandLineHandlerTest >> testDuplicationModeDefault [ self assert: (installer instVarNamed: #duplicationMode) class equals: HEFailOnDuplication. ] -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testDuplicationModeFail [ | handler installer | handler := HermesCommandLineHandler new. @@ -24,7 +25,7 @@ HECommandLineHandlerTest >> testDuplicationModeFail [ self assert: (installer instVarNamed: #duplicationMode) class equals: HEFailOnDuplication. ] -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testDuplicationModeIgnore [ | handler installer | handler := HermesCommandLineHandler new. @@ -34,7 +35,7 @@ HECommandLineHandlerTest >> testDuplicationModeIgnore [ self assert: (installer instVarNamed: #duplicationMode) class equals: HEIgnoreOnDuplication. ] -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testDuplicationModeReplace [ | handler installer | handler := HermesCommandLineHandler new. @@ -44,7 +45,7 @@ HECommandLineHandlerTest >> testDuplicationModeReplace [ self assert: (installer instVarNamed: #duplicationMode) class equals: HEReplaceOnDuplication. ] -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testFailOnNewUndeclared [ | handler installer | handler := HermesCommandLineHandler new. @@ -54,7 +55,7 @@ HECommandLineHandlerTest >> testFailOnNewUndeclared [ self assert: (installer instVarNamed: #failOnUndeclared) equals: true ] -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testNoFailOnNewUndeclared [ | handler installer | handler := HermesCommandLineHandler new. @@ -64,7 +65,7 @@ HECommandLineHandlerTest >> testNoFailOnNewUndeclared [ self assert: (installer instVarNamed: #failOnUndeclared) equals: false ] -{ #category : #tests } +{ #category : 'tests' } HECommandLineHandlerTest >> testValidateFiles [ | handler | handler := HermesCommandLineHandler new. diff --git a/Hermes-Tests/HEExportedLiteralTest.class.st b/src/Hermes-Tests/HEExportedLiteralTest.class.st similarity index 80% rename from Hermes-Tests/HEExportedLiteralTest.class.st rename to src/Hermes-Tests/HEExportedLiteralTest.class.st index e0424cc..74c18e2 100644 --- a/Hermes-Tests/HEExportedLiteralTest.class.st +++ b/src/Hermes-Tests/HEExportedLiteralTest.class.st @@ -1,17 +1,18 @@ Class { - #name : #HEExportedLiteralTest, - #superclass : #HEAbstractBinaryClassBuilderTest, - #category : #'Hermes-Tests' + #name : 'HEExportedLiteralTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HEExportedLiteralTest >> doTestExportLiteral: original [ | exported | exported := self export: original. self assert: exported equals: original. ] -{ #category : #tests } +{ #category : 'tests' } HEExportedLiteralTest >> export: original [ original asExportedLiteral writeInto: writer. writer flush. @@ -20,13 +21,13 @@ HEExportedLiteralTest >> export: original [ ] -{ #category : #tests } +{ #category : 'tests' } HEExportedLiteralTest >> testFraction [ self doTestExportLiteral: 1/3. self doTestExportLiteral: 0.5s3. ] -{ #category : #tests } +{ #category : 'tests' } HEExportedLiteralTest >> testLiteralEqualsOfFloat [ self assert: ((self export:0.0) literalEqual: 0.0). self assert: ((self export:-0.0) literalEqual: 0.0 negated). @@ -41,13 +42,13 @@ HEExportedLiteralTest >> testLiteralEqualsOfFloat [ ] -{ #category : #tests } +{ #category : 'tests' } HEExportedLiteralTest >> testTagsAreOk [ HEExportedLiteral checkAllTags. HEExportedLiteral nextTag. ] -{ #category : #tests } +{ #category : 'tests' } HEExportedLiteralTest >> testWideString [ self doTestExportLiteral: '1796exportFixes-tkMX' asWideString. self doTestExportLiteral: (Character value: 257) asString. diff --git a/Hermes-Tests/HEExportingClassTest.class.st b/src/Hermes-Tests/HEExportingClassTest.class.st similarity index 80% rename from Hermes-Tests/HEExportingClassTest.class.st rename to src/Hermes-Tests/HEExportingClassTest.class.st index d4dfbeb..68225b9 100644 --- a/Hermes-Tests/HEExportingClassTest.class.st +++ b/src/Hermes-Tests/HEExportingClassTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HEExportingClassTest, - #superclass : #HEAbstractBinaryClassBuilderTest, - #category : #'Hermes-Tests' + #name : 'HEExportingClassTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HEExportingClassTest >> doTestExportingClass: classUnderTest [ | new old nonExtensionMethodsClassSide nonExtensionMethods | old := HEClass for: classUnderTest. @@ -26,22 +27,22 @@ HEExportingClassTest >> doTestExportingClass: classUnderTest [ self assert: old equals: new ] -{ #category : #tests } +{ #category : 'tests' } HEExportingClassTest >> testExportingClassWithBlocks [ self doTestExportingClass: HETeSimpleClassWithBlocks ] -{ #category : #tests } +{ #category : 'tests' } HEExportingClassTest >> testExportingClassWithComplexTraits [ self doTestExportingClass: HETeSimpleClassWithComplexTraits ] -{ #category : #tests } +{ #category : 'tests' } HEExportingClassTest >> testExportingClassWithTraits [ self doTestExportingClass: HETeSimpleClassWithTraits ] -{ #category : #tests } +{ #category : 'tests' } HEExportingClassTest >> testExportingObject [ self doTestExportingClass: Object ] diff --git a/Hermes-Tests/HEExportingMethodTest.class.st b/src/Hermes-Tests/HEExportingMethodTest.class.st similarity index 79% rename from Hermes-Tests/HEExportingMethodTest.class.st rename to src/Hermes-Tests/HEExportingMethodTest.class.st index 742dd48..b926bba 100644 --- a/Hermes-Tests/HEExportingMethodTest.class.st +++ b/src/Hermes-Tests/HEExportingMethodTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HEExportingMethodTest, - #superclass : #HEAbstractBinaryClassBuilderTest, - #category : #'Hermes-Tests' + #name : 'HEExportingMethodTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HEExportingMethodTest >> testAllObjectMethods [ | olds news | olds := Object methods collect: [ :e | HEMethod for: e ]. @@ -17,7 +18,7 @@ HEExportingMethodTest >> testAllObjectMethods [ self assert: olds equals: news ] -{ #category : #tests } +{ #category : 'tests' } HEExportingMethodTest >> testSingleMethod [ | old new | old := HEMethod for: (Behavior >> #basicNew:). diff --git a/Hermes-Tests/HEExportingPackageFromRingTest.class.st b/src/Hermes-Tests/HEExportingPackageFromRingTest.class.st similarity index 81% rename from Hermes-Tests/HEExportingPackageFromRingTest.class.st rename to src/Hermes-Tests/HEExportingPackageFromRingTest.class.st index c5412a3..4aeff1f 100644 --- a/Hermes-Tests/HEExportingPackageFromRingTest.class.st +++ b/src/Hermes-Tests/HEExportingPackageFromRingTest.class.st @@ -1,17 +1,18 @@ Class { - #name : #HEExportingPackageFromRingTest, - #superclass : #HEExportingPackageTest, - #category : #'Hermes-Tests' + #name : 'HEExportingPackageFromRingTest', + #superclass : 'HEExportingPackageTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageFromRingTest >> fillOldPackage: aPackageNamed [ aPackage := self rfiPackageFor: aPackageNamed. old := HERingToHermesBuilder new visitPackage: aPackage. ] -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageFromRingTest >> rfiPackageFor: aPackageNamed [ | environment rfienvironment | environment := Dictionary new. @@ -25,7 +26,7 @@ HEExportingPackageFromRingTest >> rfiPackageFor: aPackageNamed [ ^ rfienvironment packages detect: [ :p | p name = aPackageNamed asSymbol ] ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageFromRingTest >> testExportingCollectionsTests [ self skip. ] diff --git a/Hermes-Tests/HEExportingPackageTest.class.st b/src/Hermes-Tests/HEExportingPackageTest.class.st similarity index 87% rename from Hermes-Tests/HEExportingPackageTest.class.st rename to src/Hermes-Tests/HEExportingPackageTest.class.st index 0d13d0e..7f5ba60 100644 --- a/Hermes-Tests/HEExportingPackageTest.class.st +++ b/src/Hermes-Tests/HEExportingPackageTest.class.st @@ -1,14 +1,15 @@ Class { - #name : #HEExportingPackageTest, - #superclass : #HEAbstractBinaryClassBuilderTest, + #name : 'HEExportingPackageTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', #instVars : [ 'old', 'aPackage' ], - #category : #'Hermes-Tests' + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageTest >> doTestExportingPackage: aPackageNamed [ | new | @@ -35,14 +36,14 @@ HEExportingPackageTest >> doTestExportingPackage: aPackageNamed [ self assert: new equals: old. ] -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageTest >> fillOldPackage: aPackageNamed [ aPackage := RPackageOrganizer default packageNamed: aPackageNamed. old := HEPackage for:aPackage. ] -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageTest >> in: aSeq allSharedPoolsAreBeforeThan: aClass [ | myIndex allSharedPools | myIndex := aSeq indexOf: aClass. @@ -51,7 +52,7 @@ HEExportingPackageTest >> in: aSeq allSharedPoolsAreBeforeThan: aClass [ ^ allSharedPools allSatisfy: [ :sp | (aSeq indexOf: sp) < myIndex ] ] -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageTest >> in: aSeq allSuperclassesAreBeforeThan: aClass [ | myIndex superclass superclassIndex | myIndex := aSeq indexOf: aClass. @@ -61,45 +62,45 @@ HEExportingPackageTest >> in: aSeq allSuperclassesAreBeforeThan: aClass [ ^ (superclassIndex < myIndex) and:[ self in:aSeq allSuperclassesAreBeforeThan: superclass]. ] -{ #category : #utils } +{ #category : 'utils' } HEExportingPackageTest >> in: aSeq allTraitsAreBeforeThan: aTrait [ | myIndex | myIndex := aSeq indexOf: aTrait. ^ (aTrait traitComposition allDependenciesIn: aSeq) allSatisfy: [ :aUsedTrait | (aSeq indexOf: aUsedTrait) < myIndex ] ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageTest >> testExportingCollectionsTests [ self doTestExportingPackage: 'Collections-Tests'. ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageTest >> testExportingKernel [ self doTestExportingPackage: 'Kernel'. ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageTest >> testExportingKernelTests [ self doTestExportingPackage: 'Kernel-Tests'. ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageTest >> testExportingOpal [ self doTestExportingPackage: 'OpalCompiler-Core'. ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageTest >> testExportingSUnit [ self doTestExportingPackage: 'SUnit-Core'. self doTestExportingPackage: 'SUnit-Tests'. ] -{ #category : #tests } +{ #category : 'tests' } HEExportingPackageTest >> testExportingTraits [ self doTestExportingPackage: 'TraitsV2'. diff --git a/Hermes-Tests/HEExportingTraitTest.class.st b/src/Hermes-Tests/HEExportingTraitTest.class.st similarity index 79% rename from Hermes-Tests/HEExportingTraitTest.class.st rename to src/Hermes-Tests/HEExportingTraitTest.class.st index b734f5c..c0b40cb 100644 --- a/Hermes-Tests/HEExportingTraitTest.class.st +++ b/src/Hermes-Tests/HEExportingTraitTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HEExportingTraitTest, - #superclass : #HEAbstractBinaryClassBuilderTest, - #category : #'Hermes-Tests' + #name : 'HEExportingTraitTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #utils } +{ #category : 'utils' } HEExportingTraitTest >> doTestExportingTrait: traitUnderTest [ | new old nonExtensionMethodsClassSide nonExtensionMethods | old := HETrait for: traitUnderTest. @@ -26,12 +27,12 @@ HEExportingTraitTest >> doTestExportingTrait: traitUnderTest [ self assert: old equals: new ] -{ #category : #tests } +{ #category : 'tests' } HEExportingTraitTest >> testExportingTrait [ self doTestExportingTrait: THEOneTestTrait. ] -{ #category : #tests } +{ #category : 'tests' } HEExportingTraitTest >> testExportingTraitUsingOther [ self doTestExportingTrait: THEATraitUsingOthers. ] diff --git a/Hermes-Tests/HEInstallWholePackageTest.class.st b/src/Hermes-Tests/HEInstallWholePackageTest.class.st similarity index 80% rename from Hermes-Tests/HEInstallWholePackageTest.class.st rename to src/Hermes-Tests/HEInstallWholePackageTest.class.st index a768dbd..220c076 100644 --- a/Hermes-Tests/HEInstallWholePackageTest.class.st +++ b/src/Hermes-Tests/HEInstallWholePackageTest.class.st @@ -1,14 +1,15 @@ Class { - #name : #HEInstallWholePackageTest, - #superclass : #HEAbstractBinaryClassBuilderTest, + #name : 'HEInstallWholePackageTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', #instVars : [ 'builder', 'newClass' ], - #category : #'Hermes-Tests' + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #utils } +{ #category : 'utils' } HEInstallWholePackageTest >> changeClassesNames: aPackage [ aPackage instVarNamed: #packageName put: #'Hermes-Tests-External-Package2'. aPackage classes @@ -21,7 +22,7 @@ HEInstallWholePackageTest >> changeClassesNames: aPackage [ aPackage traits do: [ :e | e instVarNamed: #category put: #'Hermes-Tests-External-Package2'. - e instVarNamed: #traitName put: (e className , '2') asSymbol. + e instVarNamed: #traitName put: (e traitName , '2') asSymbol. self updateMethodLiterals: e methods. self updateMethodLiterals: e classSideMethods ]. @@ -32,21 +33,20 @@ HEInstallWholePackageTest >> changeClassesNames: aPackage [ ] -{ #category : #initialization } +{ #category : 'initialization' } HEInstallWholePackageTest >> setUp [ super setUp. builder := HEInstaller new ] -{ #category : #initialization } +{ #category : 'initialization' } HEInstallWholePackageTest >> tearDown [ - | aPackage | - aPackage := RPackageOrganizer default packageNamed:#'Hermes-Tests-External-Package2' ifAbsent: nil. - aPackage ifNotNil: #removeFromSystem. - super tearDown. + + (RPackageOrganizer default packageNamed: #'Hermes-Tests-External-Package2' ifAbsent: nil) ifNotNil: #removeFromSystem. + super tearDown ] -{ #category : #tests } +{ #category : 'tests' } HEInstallWholePackageTest >> testExportingWholePackageAndImportingIt [ | hePackage readPackage newPackage oldPackage obj obj2 | oldPackage := RPackageOrganizer default packageNamed: #'Hermes-Tests-External-Package'. @@ -69,7 +69,7 @@ HEInstallWholePackageTest >> testExportingWholePackageAndImportingIt [ self assert: obj2 class equals: (Smalltalk at: #AClassToBeExtracted2) ] -{ #category : #utils } +{ #category : 'utils' } HEInstallWholePackageTest >> updateMethodLiterals: methods [ methods do: [ :e | diff --git a/Hermes-Tests/HEInstallerClassesWithBlocksTest.class.st b/src/Hermes-Tests/HEInstallerClassesWithBlocksTest.class.st similarity index 64% rename from Hermes-Tests/HEInstallerClassesWithBlocksTest.class.st rename to src/Hermes-Tests/HEInstallerClassesWithBlocksTest.class.st index a3fb2d9..c43e6d7 100644 --- a/Hermes-Tests/HEInstallerClassesWithBlocksTest.class.st +++ b/src/Hermes-Tests/HEInstallerClassesWithBlocksTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HEInstallerClassesWithBlocksTest, - #superclass : #HEInstallerTest, - #category : #'Hermes-Tests' + #name : 'HEInstallerClassesWithBlocksTest', + #superclass : 'HEInstallerTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> setUp [ | exportedClass | @@ -19,7 +20,7 @@ HEInstallerClassesWithBlocksTest >> setUp [ ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> testAMethodWithASingleBlockHasCorrectBindingToTheHomeMethod [ | methodWithSimpleBlock block | @@ -32,7 +33,25 @@ HEInstallerClassesWithBlocksTest >> testAMethodWithASingleBlockHasCorrectBinding ] -{ #category : #tests } +{ #category : 'tests' } +HEInstallerClassesWithBlocksTest >> testAMethodWithASingleConstantBlockHasCorrectBindingToTheHomeMethod [ + + | methodWithSimpleBlock block | + methodWithSimpleBlock := aClass >> #aMethodWithAContantBlock. + block := methodWithSimpleBlock literals at: 1. + + self flag: #pharo10. "This can be simplified once Pharo 11 will be the minimal version for Hermes. + In Pharo < 11, this will be a compiled block while in other cases il will be a constant block." + SystemVersion current major >= 11 + ifTrue: [ + self assert: block isBlock. + self assert: (block compiledBlock allLiterals at: 2) equals: methodWithSimpleBlock ] + ifFalse: [ + self assert: block isCompiledBlock. + self assert: (block allLiterals at: 2) equals: methodWithSimpleBlock ] +] + +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> testAMethodWithNestedBlocksHasCorrectBindingOfTheHomeBlockInTheNested [ | methodWithNestedBlocks block nestedBlock | @@ -46,7 +65,7 @@ HEInstallerClassesWithBlocksTest >> testAMethodWithNestedBlocksHasCorrectBinding self assert: (nestedBlock allLiterals last) equals: block. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> testCreatedClassHaveTheCorrectName [ self assert: aClass name equals: #HETeSimpleClassWithBlocksNew. @@ -55,7 +74,7 @@ HEInstallerClassesWithBlocksTest >> testCreatedClassHaveTheCorrectName [ ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> testExecutingAMethodWithASingleBlockBehavesCorrectly [ | obj | @@ -64,7 +83,7 @@ HEInstallerClassesWithBlocksTest >> testExecutingAMethodWithASingleBlockBehavesC ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> testExecutingAMethodWithNestedBlocksBehavesCorrectly [ | obj | @@ -74,7 +93,7 @@ HEInstallerClassesWithBlocksTest >> testExecutingAMethodWithNestedBlocksBehavesC ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerClassesWithBlocksTest >> testExecutingAMethodWithNestedBlocksExecutesTheEnsure [ | obj | diff --git a/Hermes-Tests/HEInstallerDuplicationTest.class.st b/src/Hermes-Tests/HEInstallerDuplicationTest.class.st similarity index 92% rename from Hermes-Tests/HEInstallerDuplicationTest.class.st rename to src/Hermes-Tests/HEInstallerDuplicationTest.class.st index 2a96a76..6c8bf3c 100644 --- a/Hermes-Tests/HEInstallerDuplicationTest.class.st +++ b/src/Hermes-Tests/HEInstallerDuplicationTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HEInstallerDuplicationTest, - #superclass : #HEInstallerTest, - #category : #'Hermes-Tests' + #name : 'HEInstallerDuplicationTest', + #superclass : 'HEInstallerTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClass [ | exportedClass | @@ -18,7 +19,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClass [ ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClassFailing [ | exportedClass method | installer := HEExtendedInstaller new. @@ -36,7 +37,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClassFailing ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClassIgnore [ | exportedClass method | installer := HEExtendedInstaller new. @@ -57,7 +58,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClassIgnore ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClassReplace [ | exportedClass method | installer := HEExtendedInstaller new. @@ -78,7 +79,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleClassReplace ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTrait [ | exportedTrait | @@ -92,7 +93,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTrait [ ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTraitFailing [ | exportedTrait method | installer := HEExtendedInstaller new. @@ -110,7 +111,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTraitFailing ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTraitIgnore [ | exportedTrait method | installer := HEExtendedInstaller new. @@ -130,7 +131,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTraitIgnore self assert: (aTrait >> #oneMessage) literals first equals: 1234 ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTraitReplace [ | exportedTrait method | installer := HEExtendedInstaller new. @@ -150,7 +151,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedMethodsInSimpleTraitReplace self assert: (aTrait >> #oneMessage) literals first equals: 22 ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClass [ | exportedClass | @@ -164,7 +165,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClass [ ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClassFailing [ | exportedClass | installer := HEExtendedInstaller new. @@ -180,7 +181,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClassFailing [ self should: [installer build:exportedClass] raise: Error. ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClassIgnore [ | exportedClass | installer := HEExtendedInstaller new. @@ -195,7 +196,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClassIgnore [ self assert: aClass instVarNames equals: #(anInstanceVariable) ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClassReplace [ | exportedClass | installer := HEExtendedInstaller new. @@ -212,7 +213,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleClassReplace [ equals: #(anInstanceVariable anotherInstanceVariable) ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTrait [ | exportedTrait | @@ -226,7 +227,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTrait [ ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTraitFailing [ | exportedTrait | installer := HEExtendedInstaller new. @@ -241,7 +242,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTraitFailing [ ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTraitIgnore [ | exportedTrait | installer := HEExtendedInstaller new. @@ -259,7 +260,7 @@ HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTraitIgnore [ self assert: (Smalltalk at: #THEOneTestTraitNew ) category equals: THEOneTestTrait category. ] -{ #category : #'tests-extended-installer' } +{ #category : 'tests-extended-installer' } HEInstallerDuplicationTest >> testCreatingADuplicatedSimpleTraitReplace [ | exportedTrait newCategory | installer := HEExtendedInstaller new. diff --git a/Hermes-Tests/HEInstallerSimpleTest.class.st b/src/Hermes-Tests/HEInstallerSimpleTest.class.st similarity index 88% rename from Hermes-Tests/HEInstallerSimpleTest.class.st rename to src/Hermes-Tests/HEInstallerSimpleTest.class.st index 6b8f6fe..f7d1cd1 100644 --- a/Hermes-Tests/HEInstallerSimpleTest.class.st +++ b/src/Hermes-Tests/HEInstallerSimpleTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #HEInstallerSimpleTest, - #superclass : #HEInstallerTest, - #category : #'Hermes-Tests' + #name : 'HEInstallerSimpleTest', + #superclass : 'HEInstallerTest', + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingAClassUsingComplexTraits [ | exportedClass obj| @@ -27,7 +28,7 @@ HEInstallerSimpleTest >> testCreatingAClassUsingComplexTraits [ self assert: obj otherMessage equals: 4321. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingAClassUsingTraits [ | exportedClass obj| @@ -53,7 +54,7 @@ HEInstallerSimpleTest >> testCreatingAClassUsingTraits [ self assert: obj otherMessage equals: 4321. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingAClassWithUndeclared [ | exportedClass | @@ -71,7 +72,7 @@ HEInstallerSimpleTest >> testCreatingAClassWithUndeclared [ self should: [installer validateNoNewUndeclared] raise: Error. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingAClassWithUndeclaredWithNoFailOption [ | exportedClass | @@ -92,7 +93,7 @@ HEInstallerSimpleTest >> testCreatingAClassWithUndeclaredWithNoFailOption [ installer validateNoNewUndeclared ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingASimpleClass [ | exportedClass slots classSlots obj | @@ -128,7 +129,7 @@ HEInstallerSimpleTest >> testCreatingASimpleClass [ self assert: obj usingAConstant equals: 42. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingASimpleClassExportingToFile [ | exportedClass obj readedClass | @@ -156,7 +157,7 @@ HEInstallerSimpleTest >> testCreatingASimpleClassExportingToFile [ self assert: obj usingAConstant equals: 42. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingASimpleTrait [ | exportedTrait | @@ -178,7 +179,7 @@ HEInstallerSimpleTest >> testCreatingASimpleTrait [ aTrait >> #oneMessageRequired ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingATraitUsingOthers [ | exportedTrait | exportedTrait := HETrait for: THEATraitUsingOthers. @@ -203,7 +204,7 @@ HEInstallerSimpleTest >> testCreatingATraitUsingOthers [ aTrait >> #oneMessageRequired ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testCreatingAWithNilSuperclass [ | exportedClass slots classSlots | @@ -233,7 +234,7 @@ HEInstallerSimpleTest >> testCreatingAWithNilSuperclass [ self assert: aClass superclass equals: nil ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testPragmaMethod [ | exportedClass aMethod | @@ -247,21 +248,30 @@ HEInstallerSimpleTest >> testPragmaMethod [ self assert: aMethod pragmas first method == aMethod. ] -{ #category : #tests } +{ #category : 'tests' } HEInstallerSimpleTest >> testUndeclared [ + | exportedClass | - - UndefinedObject compile:'xxx + "If we run the test multiple times we need to do this to be sure #AnUndeclaredClass is not in the Undeclared dictionary anymore." + Undeclared removeUnreferencedKeys. + [ + UndefinedObject compile: 'xxx ^ AnUndeclaredClass'. - - self assert: nil xxx equals: nil. - - exportedClass := HEClass for: HETeSimpleClass. + self flag: #pahro11. "In Pharo 12 we should use UndeclaredVariableRead instead of the Error" + self + assert: ([ nil xxx ] + on: Error + do: [ :e | e resume ]) + equals: nil. + + exportedClass := HEClass for: HETeSimpleClass. self changeNameOf: exportedClass to: #AnUndeclaredClass. aClass := installer build: exportedClass. installer installMethods: exportedClass into: aClass. self should: [ Undeclared at: #AnUndeclaredClass ] raise: KeyNotFound. - Smalltalk at:#AnUndeclaredClass. + Smalltalk at: #AnUndeclaredClass ifAbsent: [ self fail: 'Class should be here.' ] ] ensure: [ + UndefinedObject removeSelector: #xxx. + Smalltalk at: #AnUndeclaredClass ifPresent: [ :class | class removeFromSystem ] ] ] diff --git a/Hermes-Tests/HEInstallerTest.class.st b/src/Hermes-Tests/HEInstallerTest.class.st similarity index 70% rename from Hermes-Tests/HEInstallerTest.class.st rename to src/Hermes-Tests/HEInstallerTest.class.st index 3b1d9f0..4a1f463 100644 --- a/Hermes-Tests/HEInstallerTest.class.st +++ b/src/Hermes-Tests/HEInstallerTest.class.st @@ -2,17 +2,18 @@ Abstract class that has the common behaviour of the HEInstallerTests " Class { - #name : #HEInstallerTest, - #superclass : #HEAbstractBinaryClassBuilderTest, + #name : 'HEInstallerTest', + #superclass : 'HEAbstractBinaryClassBuilderTest', #instVars : [ 'aClass', 'aTrait', 'installer' ], - #category : #'Hermes-Tests' + #category : 'Hermes-Tests', + #package : 'Hermes-Tests' } -{ #category : #utils } +{ #category : 'utils' } HEInstallerTest >> changeNameOf: exportedClass to: aNewName [ (exportedClass isKindOf: HETrait) ifTrue: [ @@ -26,7 +27,7 @@ HEInstallerTest >> changeNameOf: exportedClass to: aNewName [ ] -{ #category : #utils } +{ #category : 'utils' } HEInstallerTest >> renameExportedClass: aName to: aNewName on:aMethod [ aMethod literals do:[ :e | (e isKindOf: HEAdditionalMethodState) ifTrue:[ @@ -37,20 +38,19 @@ HEInstallerTest >> renameExportedClass: aName to: aNewName on:aMethod [ ]. ] -{ #category : #initialization } +{ #category : 'initialization' } HEInstallerTest >> setUp [ super setUp. installer := HEInstaller new. ] -{ #category : #initialization } +{ #category : 'initialization' } HEInstallerTest >> tearDown [ - aClass ifNotNil: #removeFromSystem. - aTrait ifNotNil: #removeFromSystem. - UndefinedObject removeSelector: #xxx. - Undeclared removeKey: #AUndeclared ifAbsent:[]. + aClass ifNotNil: [ :class | class removeFromSystem ]. + aTrait ifNotNil: [ :trait | trait removeFromSystem ]. - super tearDown. + Undeclared removeKey: #AUndeclared ifAbsent: [ ]. + super tearDown ] diff --git a/src/Hermes-Tests/package.st b/src/Hermes-Tests/package.st new file mode 100644 index 0000000..07e04ca --- /dev/null +++ b/src/Hermes-Tests/package.st @@ -0,0 +1 @@ +Package { #name : 'Hermes-Tests' } diff --git a/Hermes/HEAbstractExported.class.st b/src/Hermes/HEAbstractExported.class.st similarity index 84% rename from Hermes/HEAbstractExported.class.st rename to src/Hermes/HEAbstractExported.class.st index ab59cf5..c9732de 100644 --- a/Hermes/HEAbstractExported.class.st +++ b/src/Hermes/HEAbstractExported.class.st @@ -10,19 +10,21 @@ that is used to read any of my subclasses. Each of my subclasses knows how to read itself from the stream. " Class { - #name : #HEAbstractExported, - #superclass : #Object, - #category : #'Hermes-Model' + #name : 'HEAbstractExported', + #superclass : 'Object', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } HEAbstractExported class >> readFrom: aReader [ ^ self new readFrom: aReader; yourself ] -{ #category : #comparing } +{ #category : 'comparing' } HEAbstractExported >> = anObject [ "The comparison is implemented using a set of my instance variables. Each subclass has the responsibility to tell the instance variables to use." @@ -31,7 +33,7 @@ HEAbstractExported >> = anObject [ ^ self valuesToCompareForEquality = anObject valuesToCompareForEquality ] -{ #category : #comparing } +{ #category : 'comparing' } HEAbstractExported >> hash [ "The hash is calculated with the instance variable used for comparison" ^ self valuesToCompareForEquality @@ -39,13 +41,13 @@ HEAbstractExported >> hash [ into: [ :hash :comparisonValue | (hash bitXor: comparisonValue hash) hashMultiply ] ] -{ #category : #comparing } +{ #category : 'comparing' } HEAbstractExported >> instVarNamesForEqualityComparison [ "By default all the instance variables are used in the comparison and in the hash calculation" ^ self class allInstVarNames ] -{ #category : #comparing } +{ #category : 'comparing' } HEAbstractExported >> valuesToCompareForEquality [ "By default all the instance variables are used in the comparison and in the hash calculation" ^ self instVarNamesForEqualityComparison collect: [ :ivName | self instVarNamed: ivName ] diff --git a/Hermes/HEAdditionalMethodState.class.st b/src/Hermes/HEAdditionalMethodState.class.st similarity index 86% rename from Hermes/HEAdditionalMethodState.class.st rename to src/Hermes/HEAdditionalMethodState.class.st index ab34c50..54562db 100644 --- a/Hermes/HEAdditionalMethodState.class.st +++ b/src/Hermes/HEAdditionalMethodState.class.st @@ -10,21 +10,23 @@ Each of this elements is exported as a HEExportedLiteral. My value contains the array of elements in the AdditionalMethodState. " Class { - #name : #HEAdditionalMethodState, - #superclass : #HEExportedLiteral, + #name : 'HEAdditionalMethodState', + #superclass : 'HEExportedLiteral', #instVars : [ 'method', 'selector' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEAdditionalMethodState class >> tag [ ^ 1 ] -{ #category : #converting } +{ #category : 'converting' } HEAdditionalMethodState >> asLiteralIn: env [ "When the literal is deserialized in the environment, the method is the actual method that is currently deserialized (this #newMethod message)." | additionalMethodState | @@ -36,14 +38,14 @@ HEAdditionalMethodState >> asLiteralIn: env [ ^ additionalMethodState ] -{ #category : #reading } +{ #category : 'reading' } HEAdditionalMethodState >> doReadFrom: aReader [ method := HEExportedLiteral readFrom: aReader. selector := HEExportedLiteral readFrom: aReader. value := HEExportedLiteral readFrom: aReader ] -{ #category : #accessing } +{ #category : 'accessing' } HEAdditionalMethodState >> value: anAdditionalMethodState [ "I extract the information from the additional method state and convert it to exported literals." method := anAdditionalMethodState method asExportedLiteral. diff --git a/Hermes/HEArray.class.st b/src/Hermes/HEArray.class.st similarity index 81% rename from Hermes/HEArray.class.st rename to src/Hermes/HEArray.class.st index 0a695ef..7fa0abd 100644 --- a/Hermes/HEArray.class.st +++ b/src/Hermes/HEArray.class.st @@ -12,23 +12,25 @@ This allows us to export any kind of array, if it is limited to a size of 32 bit The reading is perform in the inverse order " Class { - #name : #HEArray, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEArray', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEArray class >> tag [ ^ 2 ] -{ #category : #converting } +{ #category : 'converting' } HEArray >> asLiteralIn: env [ "A new array is returned with all its elements as target literals in the environment" ^ value collect: [ :e | e asLiteralIn: env ] ] -{ #category : #reading } +{ #category : 'reading' } HEArray >> doReadFrom: aReader [ | size | "The size of the array is stored as a 32bits integer. Before any of the elements" @@ -38,7 +40,7 @@ HEArray >> doReadFrom: aReader [ 1 to:size do:[:idx | value at:idx put: (HEExportedLiteral readFrom: aReader)] ] -{ #category : #accessing } +{ #category : 'accessing' } HEArray >> value: anArray [ value := anArray collect: [:each | each asExportedLiteral] ] diff --git a/Hermes/HEAssociation.class.st b/src/Hermes/HEAssociation.class.st similarity index 73% rename from Hermes/HEAssociation.class.st rename to src/Hermes/HEAssociation.class.st index 17ecf0a..1cfa21d 100644 --- a/Hermes/HEAssociation.class.st +++ b/src/Hermes/HEAssociation.class.st @@ -5,31 +5,33 @@ The key and the value are transformed as HEExportedLiterals. When writing or reading, the key is before of the value. " Class { - #name : #HEAssociation, - #superclass : #HEExportedLiteral, + #name : 'HEAssociation', + #superclass : 'HEExportedLiteral', #instVars : [ 'key' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEAssociation class >> tag [ ^ 12 ] -{ #category : #converting } +{ #category : 'converting' } HEAssociation >> asLiteralIn: env [ ^ (key asLiteralIn: env) -> (value asLiteralIn: env) ] -{ #category : #reading } +{ #category : 'reading' } HEAssociation >> doReadFrom: aReader [ key := HEExportedLiteral readFrom: aReader. value := HEExportedLiteral readFrom: aReader ] -{ #category : #accessing } +{ #category : 'accessing' } HEAssociation >> value: anAssociation [ value := anAssociation value asExportedLiteral. key := anAssociation key asExportedLiteral diff --git a/Hermes/HEBinaryReader.class.st b/src/Hermes/HEBinaryReader.class.st similarity index 77% rename from Hermes/HEBinaryReader.class.st rename to src/Hermes/HEBinaryReader.class.st index 8ef7202..1b230c3 100644 --- a/Hermes/HEBinaryReader.class.st +++ b/src/Hermes/HEBinaryReader.class.st @@ -14,30 +14,32 @@ In this way the format can be used in any platform and architecture. The integers are stored in little endian style. " Class { - #name : #HEBinaryReader, - #superclass : #Object, + #name : 'HEBinaryReader', + #superclass : 'Object', #instVars : [ 'stream' ], - #category : #'Hermes-CommandLineHandler' + #category : 'Hermes-CommandLineHandler', + #package : 'Hermes', + #tag : 'CommandLineHandler' } -{ #category : #initialization } +{ #category : 'initialization' } HEBinaryReader >> close [ self stream close ] -{ #category : #sizes } +{ #category : 'sizes' } HEBinaryReader >> intSize [ ^ 4 ] -{ #category : #reading } +{ #category : 'reading' } HEBinaryReader >> readByte [ ^ stream next ] -{ #category : #reading } +{ #category : 'reading' } HEBinaryReader >> readByteArray [ | byteArray size | size := self readInt32. @@ -45,17 +47,17 @@ HEBinaryReader >> readByteArray [ ^ byteArray ] -{ #category : #reading } +{ #category : 'reading' } HEBinaryReader >> readByteString [ ^ self readByteArray asString ] -{ #category : #reading } +{ #category : 'reading' } HEBinaryReader >> readByteSymbol [ ^ self readByteString asSymbol ] -{ #category : #reading } +{ #category : 'reading' } HEBinaryReader >> readInt32 [ | byteArray n | byteArray := stream next: self intSize. @@ -68,7 +70,7 @@ HEBinaryReader >> readInt32 [ ^ n ] -{ #category : #reading } +{ #category : 'reading' } HEBinaryReader >> readUInt32 [ | byteArray n | byteArray := stream next: self intSize. @@ -79,12 +81,12 @@ HEBinaryReader >> readUInt32 [ ^ n ] -{ #category : #accessing } +{ #category : 'accessing' } HEBinaryReader >> stream [ ^ stream ] -{ #category : #accessing } +{ #category : 'accessing' } HEBinaryReader >> stream: anObject [ stream := anObject ] diff --git a/Hermes/HEBoolean.class.st b/src/Hermes/HEBoolean.class.st similarity index 54% rename from Hermes/HEBoolean.class.st rename to src/Hermes/HEBoolean.class.st index 3ddd980..a29d9f5 100644 --- a/Hermes/HEBoolean.class.st +++ b/src/Hermes/HEBoolean.class.st @@ -3,22 +3,24 @@ I represent a boolean. I am stored in the file as a byte with values 0 (false) and 1 (true). " Class { - #name : #HEBoolean, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEBoolean', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEBoolean class >> tag [ ^ 17 ] -{ #category : #converting } +{ #category : 'converting' } HEBoolean >> asLiteralIn: env [ ^ value ] -{ #category : #reading } +{ #category : 'reading' } HEBoolean >> doReadFrom: aReader [ value := aReader readByte = 1 ] diff --git a/Hermes/HEByteArray.class.st b/src/Hermes/HEByteArray.class.st similarity index 55% rename from Hermes/HEByteArray.class.st rename to src/Hermes/HEByteArray.class.st index ad42757..6d90a18 100644 --- a/Hermes/HEByteArray.class.st +++ b/src/Hermes/HEByteArray.class.st @@ -4,22 +4,24 @@ The Hermes streams knows how to store byte arrays. I only use them. " Class { - #name : #HEByteArray, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEByteArray', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEByteArray class >> tag [ ^ 15 ] -{ #category : #converting } +{ #category : 'converting' } HEByteArray >> asLiteralIn: env [ ^ value ] -{ #category : #reading } +{ #category : 'reading' } HEByteArray >> doReadFrom: aReader [ value := aReader readByteArray ] diff --git a/Hermes/HEByteString.class.st b/src/Hermes/HEByteString.class.st similarity index 67% rename from Hermes/HEByteString.class.st rename to src/Hermes/HEByteString.class.st index ac04538..b8b9cbb 100644 --- a/Hermes/HEByteString.class.st +++ b/src/Hermes/HEByteString.class.st @@ -4,28 +4,30 @@ Readers and writers knows how to handle byte strings. I just use them and I provide an entry point to my subclasses to convert the readed value. " Class { - #name : #HEByteString, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEByteString', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEByteString class >> tag [ ^ 4 ] -{ #category : #converting } +{ #category : 'converting' } HEByteString >> asLiteralIn: env [ ^ value ] -{ #category : #reading } +{ #category : 'reading' } HEByteString >> doConvertValue: aValue [ "My subclasses are able to do something else to convert the readed value" ^ aValue ] -{ #category : #reading } +{ #category : 'reading' } HEByteString >> doReadFrom: aReader [ value := self doConvertValue:(aReader readByteString) ] diff --git a/Hermes/HECharacter.class.st b/src/Hermes/HECharacter.class.st similarity index 61% rename from Hermes/HECharacter.class.st rename to src/Hermes/HECharacter.class.st index f0724de..0db7065 100644 --- a/Hermes/HECharacter.class.st +++ b/src/Hermes/HECharacter.class.st @@ -5,22 +5,24 @@ When I am readed back I just read the first character of the value. My value is always a String " Class { - #name : #HECharacter, - #superclass : #HEByteString, - #category : #'Hermes-Model' + #name : 'HECharacter', + #superclass : 'HEByteString', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HECharacter class >> tag [ ^ 5 ] -{ #category : #converting } +{ #category : 'converting' } HECharacter >> asLiteralIn: env [ ^ value at:1 ] -{ #category : #accessing } +{ #category : 'accessing' } HECharacter >> value: aValue [ value := aValue asString ] diff --git a/Hermes/HEClass.class.st b/src/Hermes/HEClass.class.st similarity index 73% rename from Hermes/HEClass.class.st rename to src/Hermes/HEClass.class.st index 950cc25..53a1f14 100644 --- a/Hermes/HEClass.class.st +++ b/src/Hermes/HEClass.class.st @@ -15,8 +15,8 @@ All exported as ByteStrings (and symbols). I do not support exporting special slots (yet). " Class { - #name : #HEClass, - #superclass : #HEMethodContainer, + #name : 'HEClass', + #superclass : 'HEMethodContainer', #instVars : [ 'className', 'superclass', @@ -26,40 +26,42 @@ Class { 'sharedPools', 'layoutClass' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> classInstancevariables [ ^ classInstancevariables ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> classInstancevariables: anObject [ classInstancevariables := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } HEClass >> className [ ^ className ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> className: anObject [ className := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> classVariables [ ^ classVariables ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> classVariables: anObject [ classVariables := anObject ] -{ #category : #reading } +{ #category : 'reading' } HEClass >> doReadHeaderFrom: aReader [ className := aReader readByteSymbol. superclass := aReader readByteSymbol. @@ -70,38 +72,38 @@ HEClass >> doReadHeaderFrom: aReader [ layoutClass := aReader readByteSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> instanceVariables [ ^ instanceVariables ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> instanceVariables: anObject [ instanceVariables := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> isTrait [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> layoutClass [ ^ layoutClass ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> layoutClass: anObject [ layoutClass := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> name [ ^ self className ] -{ #category : #printing } +{ #category : 'printing' } HEClass >> printOn: aStream [ aStream @@ -110,22 +112,22 @@ HEClass >> printOn: aStream [ nextPutAll: ' )' ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> sharedPools [ ^ sharedPools ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> sharedPools: anObject [ sharedPools := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> superclass [ ^ superclass ifEmpty: [nil] ] -{ #category : #accessing } +{ #category : 'accessing' } HEClass >> superclass: anObject [ superclass := anObject ] diff --git a/Hermes/HEClassTrait.class.st b/src/Hermes/HEClassTrait.class.st similarity index 64% rename from Hermes/HEClassTrait.class.st rename to src/Hermes/HEClassTrait.class.st index 3458b10..fcd2852 100644 --- a/Hermes/HEClassTrait.class.st +++ b/src/Hermes/HEClassTrait.class.st @@ -6,22 +6,24 @@ When serialized I get the name of the base trait. When deserialized I find the classTrait in the target environment " Class { - #name : #HEClassTrait, - #superclass : #HESymbol, - #category : #'Hermes-Model' + #name : 'HEClassTrait', + #superclass : 'HESymbol', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEClassTrait class >> tag [ ^ 22 ] -{ #category : #converting } +{ #category : 'converting' } HEClassTrait >> asLiteralIn: env [ ^ (env classNamed: value) classTrait ] -{ #category : #accessing } +{ #category : 'accessing' } HEClassTrait >> value: aClassTrait [ value := aClassTrait instanceSide name ] diff --git a/Hermes/HEClassVariable.class.st b/src/Hermes/HEClassVariable.class.st similarity index 69% rename from Hermes/HEClassVariable.class.st rename to src/Hermes/HEClassVariable.class.st index 6442b82..a306b73 100644 --- a/Hermes/HEClassVariable.class.st +++ b/src/Hermes/HEClassVariable.class.st @@ -6,23 +6,25 @@ When serialized I get the name of the class variable When deserialized I look up the class variable binding in the class that is being deserialized. " Class { - #name : #HEClassVariable, - #superclass : #HESymbol, - #category : #'Hermes-Model' + #name : 'HEClassVariable', + #superclass : 'HESymbol', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEClassVariable class >> tag [ ^ 6 ] -{ #category : #converting } +{ #category : 'converting' } HEClassVariable >> asLiteralIn: env [ "I ask the binding to the class that is currently being deserialized" ^ env newClass bindingOf: value ] -{ #category : #accessing } +{ #category : 'accessing' } HEClassVariable >> value: aClassVariable [ value := aClassVariable name ] diff --git a/Hermes/HECompiledBlock.class.st b/src/Hermes/HECompiledBlock.class.st similarity index 87% rename from Hermes/HECompiledBlock.class.st rename to src/Hermes/HECompiledBlock.class.st index 5987b27..a0ab55d 100644 --- a/Hermes/HECompiledBlock.class.st +++ b/src/Hermes/HECompiledBlock.class.st @@ -1,6 +1,6 @@ Class { - #name : #HECompiledBlock, - #superclass : #HEExportedLiteral, + #name : 'HECompiledBlock', + #superclass : 'HEExportedLiteral', #instVars : [ 'encoderClassName', 'numArgs', @@ -9,16 +9,18 @@ Class { 'bytecode', 'literals' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HECompiledBlock class >> tag [ ^ 28 ] -{ #category : #reading } +{ #category : 'reading' } HECompiledBlock >> asLiteralIn: anEnvironment [ | containingBlockOrMethod newBlock literalSpace previousBlock| @@ -44,7 +46,7 @@ HECompiledBlock >> asLiteralIn: anEnvironment [ ^ newBlock ] -{ #category : #reading } +{ #category : 'reading' } HECompiledBlock >> doReadFrom: aReader [ | numberOfLiterals | @@ -61,7 +63,7 @@ HECompiledBlock >> doReadFrom: aReader [ 1 to: numberOfLiterals do: [ :idx | literals at:idx put: (HEExportedLiteral readFrom: aReader) ] ] -{ #category : #compiling } +{ #category : 'compiling' } HECompiledBlock >> headerFor: anEnvironment [ | encoderClass| "When a method is deserialized its header should be recalculated" @@ -70,7 +72,7 @@ HECompiledBlock >> headerFor: anEnvironment [ ^ (CompiledMethod headerFlagForEncoder: encoderClass) + (numArgs bitShift: 24) + (numTemps bitShift: 18) + literals size + (hasPrimitive bitShift: 16) ] -{ #category : #comparing } +{ #category : 'comparing' } HECompiledBlock >> instVarNamesForEqualityComparison [ ^ self class allInstVarNames reject: [ :e | e = #value ] diff --git a/Hermes/HEConstantBlock.class.st b/src/Hermes/HEConstantBlock.class.st similarity index 74% rename from Hermes/HEConstantBlock.class.st rename to src/Hermes/HEConstantBlock.class.st index 86f80df..8ba77a0 100644 --- a/Hermes/HEConstantBlock.class.st +++ b/src/Hermes/HEConstantBlock.class.st @@ -1,21 +1,23 @@ Class { - #name : #HEConstantBlock, - #superclass : #HEExportedLiteral, + #name : 'HEConstantBlock', + #superclass : 'HEExportedLiteral', #instVars : [ 'literal', 'numArgs', 'compiledBlock' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEConstantBlock class >> tag [ ^ 29 ] -{ #category : #reading } +{ #category : 'reading' } HEConstantBlock >> asLiteralIn: anEnvironment [ ^ (ConstantBlockClosure @@ -25,7 +27,7 @@ HEConstantBlock >> asLiteralIn: anEnvironment [ yourself ] -{ #category : #reading } +{ #category : 'reading' } HEConstantBlock >> doReadFrom: aReader [ numArgs := aReader readUInt32. @@ -33,7 +35,7 @@ HEConstantBlock >> doReadFrom: aReader [ compiledBlock := HEExportedLiteral readFrom: aReader ] -{ #category : #comparing } +{ #category : 'comparing' } HEConstantBlock >> instVarNamesForEqualityComparison [ "Ignoring the value, as it is an object of the source environment" diff --git a/Hermes/HEExportedLiteral.class.st b/src/Hermes/HEExportedLiteral.class.st similarity index 85% rename from Hermes/HEExportedLiteral.class.st rename to src/Hermes/HEExportedLiteral.class.st index 6477634..70c228e 100644 --- a/Hermes/HEExportedLiteral.class.st +++ b/src/Hermes/HEExportedLiteral.class.st @@ -25,15 +25,17 @@ This method creates the proper literal in the given environment. Some of the lit for example the classes. " Class { - #name : #HEExportedLiteral, - #superclass : #HEAbstractExported, + #name : 'HEExportedLiteral', + #superclass : 'HEAbstractExported', #instVars : [ 'value' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } HEExportedLiteral class >> readFrom: aReader [ | tag subclass | tag := aReader readByte. @@ -43,25 +45,25 @@ HEExportedLiteral class >> readFrom: aReader [ yourself ] -{ #category : #converting } +{ #category : 'converting' } HEExportedLiteral >> asExportedLiteral [ "I am already an exported literal, I do not need any conversion" ^ self ] -{ #category : #reading } +{ #category : 'reading' } HEExportedLiteral >> asLiteralIn: anEnvironment [ self subclassResponsibility ] -{ #category : #reading } +{ #category : 'reading' } HEExportedLiteral >> doReadFrom: aReader [ "Main template method to read the instance from the reader stream" self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } HEExportedLiteral >> value [ ^ value ] diff --git a/Hermes/HEExportedMetaclass.class.st b/src/Hermes/HEExportedMetaclass.class.st similarity index 64% rename from Hermes/HEExportedMetaclass.class.st rename to src/Hermes/HEExportedMetaclass.class.st index 8ebdd5f..1d3306e 100644 --- a/Hermes/HEExportedMetaclass.class.st +++ b/src/Hermes/HEExportedMetaclass.class.st @@ -6,22 +6,24 @@ When serialized I get the name of the base class. When deserialized I find the metaclass in the target environment " Class { - #name : #HEExportedMetaclass, - #superclass : #HESymbol, - #category : #'Hermes-Model' + #name : 'HEExportedMetaclass', + #superclass : 'HESymbol', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEExportedMetaclass class >> tag [ ^ 16 ] -{ #category : #converting } +{ #category : 'converting' } HEExportedMetaclass >> asLiteralIn: env [ ^ (env classNamed: value) class ] -{ #category : #accessing } +{ #category : 'accessing' } HEExportedMetaclass >> value: aMetaclass [ value := aMetaclass instanceSide name ] diff --git a/Hermes/HEExtendedEnvironment.class.st b/src/Hermes/HEExtendedEnvironment.class.st similarity index 70% rename from Hermes/HEExtendedEnvironment.class.st rename to src/Hermes/HEExtendedEnvironment.class.st index 35ed74f..871b029 100644 --- a/Hermes/HEExtendedEnvironment.class.st +++ b/src/Hermes/HEExtendedEnvironment.class.st @@ -7,8 +7,8 @@ I provide access to all the elements in the environment and also to: - The selector of the method being deserialized. " Class { - #name : #HEExtendedEnvironment, - #superclass : #Object, + #name : 'HEExtendedEnvironment', + #superclass : 'Object', #instVars : [ 'inner', 'newMethod', @@ -16,64 +16,66 @@ Class { 'newSelector', 'newBlock' ], - #category : #'Hermes-ClassInstaller' + #category : 'Hermes-ClassInstaller', + #package : 'Hermes', + #tag : 'ClassInstaller' } -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> classNamed: aClassName [ ^ newClass name = aClassName ifTrue: [ newClass ] ifFalse: [ inner classNamed: aClassName ] ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> inner [ ^ inner ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> inner: anObject [ inner := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newBlock [ ^ newBlock ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newBlock: anObject [ newBlock := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newClass [ ^ newClass ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newClass: anObject [ newClass := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newMethod [ ^ newMethod ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newMethod: anObject [ newMethod := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newSelector [ ^ newSelector ] -{ #category : #accessing } +{ #category : 'accessing' } HEExtendedEnvironment >> newSelector: anObject [ newSelector := anObject ] diff --git a/Hermes/HEFloat.class.st b/src/Hermes/HEFloat.class.st similarity index 77% rename from Hermes/HEFloat.class.st rename to src/Hermes/HEFloat.class.st index 257e34a..a41258b 100644 --- a/Hermes/HEFloat.class.st +++ b/src/Hermes/HEFloat.class.st @@ -7,22 +7,24 @@ Then this instance is operated to generate the correct immediate instance if req This hack allows us to load the same hermes file in 32bits or 64 bits " Class { - #name : #HEFloat, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEFloat', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEFloat class >> tag [ ^ 3 ] -{ #category : #converting } +{ #category : 'converting' } HEFloat >> asLiteralIn: env [ ^ value ] -{ #category : #reading } +{ #category : 'reading' } HEFloat >> doReadFrom: aReader [ | originalValue | originalValue := BoxedFloat64 new. diff --git a/Hermes/HEFraction.class.st b/src/Hermes/HEFraction.class.st similarity index 61% rename from Hermes/HEFraction.class.st rename to src/Hermes/HEFraction.class.st index 9eadb4a..a30c00e 100644 --- a/Hermes/HEFraction.class.st +++ b/src/Hermes/HEFraction.class.st @@ -3,26 +3,28 @@ I represent a Fraction. I store myself as two exported literals: the numerator and the denominator. " Class { - #name : #HEFraction, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEFraction', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } -HEFraction class >> tag [ +{ #category : 'accessing' } +HEFraction class >> tag [ ^ 24 ] -{ #category : #converting } +{ #category : 'converting' } HEFraction >> asLiteralIn: aFraction [ ^ value ] -{ #category : #reading } +{ #category : 'reading' } HEFraction >> doReadFrom: aReader [ | denominator numerator | numerator := HEExportedLiteral readFrom: aReader. denominator := HEExportedLiteral readFrom: aReader. - - value := Fraction numerator: numerator value denominator: denominator value + + value := Fraction numerator: numerator value denominator: denominator value. ] diff --git a/Hermes/HEGlobalVariable.class.st b/src/Hermes/HEGlobalVariable.class.st similarity index 73% rename from Hermes/HEGlobalVariable.class.st rename to src/Hermes/HEGlobalVariable.class.st index ec54650..9330313 100644 --- a/Hermes/HEGlobalVariable.class.st +++ b/src/Hermes/HEGlobalVariable.class.st @@ -7,17 +7,19 @@ When deserialized I find the global variable in the target environment. I use the class being created to look up the binding. If there is no binding I create an undeclared. " Class { - #name : #HEGlobalVariable, - #superclass : #HESymbol, - #category : #'Hermes-Model' + #name : 'HEGlobalVariable', + #superclass : 'HESymbol', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEGlobalVariable class >> tag [ ^ 7 ] -{ #category : #converting } +{ #category : 'converting' } HEGlobalVariable >> asLiteralIn: env [ | bind | bind := env newClass bindingOf: value. @@ -27,7 +29,7 @@ HEGlobalVariable >> asLiteralIn: env [ ^UndeclaredVariable registeredWithName: value ] -{ #category : #accessing } +{ #category : 'accessing' } HEGlobalVariable >> value: aClassVariable [ value := aClassVariable name ] diff --git a/Hermes/HEInstaller.class.st b/src/Hermes/HEInstaller.class.st similarity index 56% rename from Hermes/HEInstaller.class.st rename to src/Hermes/HEInstaller.class.st index afb1972..5444780 100644 --- a/Hermes/HEInstaller.class.st +++ b/src/Hermes/HEInstaller.class.st @@ -21,79 +21,96 @@ Example: installer installPackage: readPackage " Class { - #name : #HEInstaller, - #superclass : #Object, + #name : 'HEInstaller', + #superclass : 'Object', #instVars : [ 'environment', - 'originalUndeclareds', - 'hasTraits' + 'originalUndeclareds' ], - #category : #'Hermes-ClassInstaller' + #category : 'Hermes-ClassInstaller', + #package : 'Hermes', + #tag : 'ClassInstaller' } -{ #category : #converting } -HEInstaller >> asClassVariables: aString [ - | trimmed | - trimmed := aString trimBoth. - - trimmed isEmpty - ifTrue: [ ^ #() ]. - - ^ (trimmed substrings: ' ') collect: [:x | x asSymbol => ClassVariable] -] - -{ #category : #converting } -HEInstaller >> asSlots: aString [ - | trimmed | - trimmed := aString trimBoth. - - trimmed isEmpty - ifTrue: [ ^ #() ]. - - ^ (trimmed splitOn: ' ') collect: [ :e | e asSymbol asSlot ] as: Array -] - -{ #category : #'creating classes' } +{ #category : 'creating classes' } HEInstaller >> build: aHEClass [ - | newClass superclass layoutType | + | newClass superclass layoutType | (self existingClass: aHEClass) ifNotNil: [ :x | ^ x ]. superclass := self classNamed: aHEClass superclass. layoutType := self classNamed: aHEClass layoutClass. newClass := self class classInstaller make: [ :builder | - builder name: aHEClass className; - superclass: superclass; - layoutClass: layoutType; - slots: (self asSlots: aHEClass instanceVariables); - sharedVariables: (self asClassVariables:aHEClass classVariables); - sharedPools: aHEClass sharedPools; - category: aHEClass category; - classSlots: (self asSlots: aHEClass classInstancevariables) ]. + builder + name: aHEClass className; + superclass: superclass; + layoutClass: layoutType; + slots: aHEClass instanceVariables asSlotCollection; + sharedVariablesFromString: aHEClass classVariables; + sharedPools: aHEClass sharedPools; + category: aHEClass category; + classSlots: aHEClass classInstancevariables asSlotCollection. + self supportsTraits ifTrue: [ + builder + traitComposition: (self buildTraitCompositionFor: aHEClass traitComposition); + classTraitComposition: (self buildTraitCompositionFor: aHEClass classTraitComposition) ] ]. + ^ newClass +] + +{ #category : 'creating traits' } +HEInstaller >> buildTrait: aTraitDefinition [ + | newTrait traitComposition traitClass| + + (self existingTrait: aTraitDefinition) ifNotNil: [:x | ^ x ]. + + traitClass := Smalltalk globals at: #Trait ifAbsent: [ self error: 'Trait support is not installed' ]. + + traitComposition := self buildTraitCompositionFor: aTraitDefinition traitComposition. + + newTrait := traitClass + named: aTraitDefinition traitName + uses: traitComposition + package: aTraitDefinition category + env: environment. + + newTrait classTrait traitComposition: (self buildTraitCompositionFor: aTraitDefinition classTraitComposition). - self processTraitsFrom: aHEClass in: newClass. + ^ newTrait +] + +{ #category : 'creating traits' } +HEInstaller >> buildTraitCompositionFor: traitComposition [ - ^newClass + | aLiteral | + + aLiteral := (traitComposition asLiteralIn: environment). + aLiteral isArray + ifTrue: [ ^ aLiteral + ifEmpty: [ TaEmptyComposition new ] + ifNotEmpty: [ TaSequence withAll: (aLiteral collect: [:each | each asTraitComposition]) ] ] + ifFalse: [ ^ aLiteral asTraitComposition ] ] -{ #category : #accessing } +{ #category : 'accessing' } HEInstaller >> classNamed: aSymbol [ aSymbol ifNil: [ ^ nil ]. ^ self environment at: aSymbol ] -{ #category : #'reporting undeclared' } +{ #category : 'reporting undeclared' } HEInstaller >> createdUndeclared [ - ^ (Undeclared associations reject: [ :asoc | originalUndeclareds associations includes: asoc]) asDictionary + ^ (Undeclared associations reject: [ :asoc | originalUndeclareds associations includes: asoc]) asDictionary ] -{ #category : #'installing package' } +{ #category : 'installing package' } HEInstaller >> doInstallPackage: aHEPackage [ + | newTraits newClasses | "Creating the package. It requires a number of steps. 1. Register the package in the organizer." - self packageOrganizer ensurePackage: aHEPackage packageName. + self flag: #pahro11. "Update this when Pharo 12 will be the minimal version" + SystemVersion current major < 12 ifTrue: [ RPackageOrganizer default registerPackageNamed: aHEPackage packageName ] ifFalse: [ self packageOrganizer ensurePackage: aHEPackage packageName ]. "2. Install the traits" newTraits := aHEPackage traits collect: [ :exportedTrait | self buildTrait: exportedTrait ]. @@ -102,8 +119,7 @@ HEInstaller >> doInstallPackage: aHEPackage [ aHEPackage traits with: newTraits do: [ :exportedTrait :newTrait | self installMethods: exportedTrait into: newTrait ]. "4. Install classes" - newClasses := aHEPackage classes - collect: [ :exportedClass | self build: exportedClass ]. + newClasses := aHEPackage classes collect: [ :exportedClass | self build: exportedClass ]. "5. Install class methods" aHEPackage classes with: newClasses do: [ :exportedClass :newClass | self installMethods: exportedClass into: newClass ]. @@ -116,17 +132,17 @@ HEInstaller >> doInstallPackage: aHEPackage [ self validateNoNewUndeclared ] -{ #category : #accessing } +{ #category : 'accessing' } HEInstaller >> environment [ ^ environment ] -{ #category : #accessing } +{ #category : 'accessing' } HEInstaller >> environment: anObject [ environment := anObject ] -{ #category : #'validating existence' } +{ #category : 'validating existence' } HEInstaller >> existingClass: aHEClass [ (environment hasClassNamed: aHEClass className) ifTrue:[ self error: (self messageExistingClass: aHEClass) @@ -134,33 +150,33 @@ HEInstaller >> existingClass: aHEClass [ ^ nil ] -{ #category : #'validating existence' } +{ #category : 'validating existence' } HEInstaller >> existingTrait: aHETrait [ - (environment includesKey: aHETrait traitName) ifTrue:[ + (environment includesKey: aHETrait traitName) ifTrue:[ self error: (self messageExistingTrait: aHETrait) ]. - + ^nil ] -{ #category : #initialization } +{ #category : 'initialization' } HEInstaller >> initialize [ + environment := self class environment. - originalUndeclareds := Undeclared copy. - hasTraits := Smalltalk globals hasClassNamed: #Trait + originalUndeclareds := Undeclared copy ] -{ #category : #'installing methods' } +{ #category : 'installing methods' } HEInstaller >> installExtensionMethod: extensionMethod [ | aClass | aClass := self environment classNamed: extensionMethod className. - + aClass ifNil: [ self error: 'Required class named: ' , extensionMethod className, ' does not exists.' ]. - - self rebuildMethod: extensionMethod into: aClass + + self rebuildMethod: extensionMethod into: aClass. ] -{ #category : #'installing methods' } +{ #category : 'installing methods' } HEInstaller >> installMethods: exportedClass into: aClass [ exportedClass methods do: [ :e | self rebuildMethod: e into: aClass ]. exportedClass classSideMethods @@ -168,51 +184,43 @@ HEInstaller >> installMethods: exportedClass into: aClass [ [ :e | self rebuildMethod: e into: aClass classSide ] ] -{ #category : #'installing package' } +{ #category : 'installing package' } HEInstaller >> installPackage: aHEPackage [ - - (SystemAnnouncer uniqueInstance suspendAllWhileStoring: [ self doInstallPackage: aHEPackage ]) - do: [ :storedAnnouncement | SystemAnnouncer announce: storedAnnouncement ] + | storedAnnouncements | + + storedAnnouncements := SystemAnnouncer uniqueInstance suspendAllWhileStoring: [ self doInstallPackage: aHEPackage ]. + storedAnnouncements do: [ :e | SystemAnnouncer uniqueInstance announce: e ]. ] -{ #category : #messages } +{ #category : 'messages' } HEInstaller >> messageExistingClass: aHEClass [ ^ 'The class ' , aHEClass className asString , ' already exists. Should not be overwritten' ] -{ #category : #messages } +{ #category : 'messages' } HEInstaller >> messageExistingTrait: aHETrait [ ^ 'The trait ' , aHETrait traitName asString , ' already exists. Should not be overwritten' ] -{ #category : #messages } +{ #category : 'messages' } HEInstaller >> messageMethod: aHEMethod alreadyExistsIn: aClass [ ^ 'The method ' , aHEMethod name asString , ' already exists in class ' , aClass name asString ] -{ #category : #'creating classes' } -HEInstaller >> processTraitsFrom: aHEClass in: newClass [ - - hasTraits ifFalse: [ ^ self ]. - - newClass setTraitComposition: (self buildTraitCompositionFor: aHEClass traitComposition). - newClass class setTraitComposition: (self buildTraitCompositionFor: aHEClass classTraitComposition) -] - -{ #category : #'installing methods' } +{ #category : 'installing methods' } HEInstaller >> rebuildMethod: aMethod into: aClass [ | newMethod literalSpace extendedEnvironment | - - (self shouldBuildMethod: aMethod in: aClass) ifFalse: [ ^ self ]. + + (self shouldBuildMethod: aMethod in: aClass) ifFalse: [ ^ self ]. extendedEnvironment := HEExtendedEnvironment new. extendedEnvironment inner: environment. extendedEnvironment newClass: aClass. extendedEnvironment newSelector: aMethod name. - newMethod := CompiledMethod newMethod: aMethod bytecode size + CompiledMethod trailerSize header: (aMethod headerFor: extendedEnvironment). + newMethod := CompiledMethod newMethod: aMethod bytecode size header: (aMethod headerFor: extendedEnvironment). extendedEnvironment newMethod: newMethod. @@ -231,25 +239,31 @@ HEInstaller >> rebuildMethod: aMethod into: aClass [ inProtocol: aMethod protocol ] -{ #category : #'reporting undeclared' } +{ #category : 'reporting undeclared' } HEInstaller >> reportNewUndeclareds: newUndeclareds [ newUndeclareds ifNotEmpty: [ self error: 'New Undeclared created... check dependencies: ' , newUndeclareds keys printString ] ] -{ #category : #'validating existence' } +{ #category : 'validating existence' } HEInstaller >> shouldBuildMethod: aHEMethod in: aClass [ aClass compiledMethodAt: aHEMethod name - ifPresent: [ :m | - (m isFromTrait and:[aClass isTrait not]) ifTrue:[ ^ true ]. + ifPresent: [ :m | + (m isFromTrait and:[aClass isTrait not]) ifTrue:[ ^ true ]. self error: (self messageMethod: aHEMethod alreadyExistsIn: aClass ) ] ifAbsent: [ ^ true ] ] -{ #category : #'reporting undeclared' } +{ #category : 'testing' } +HEInstaller >> supportsTraits [ + + ^ Smalltalk globals hasClassNamed: #Trait +] + +{ #category : 'reporting undeclared' } HEInstaller >> validateNoNewUndeclared [ self reportNewUndeclareds: self createdUndeclared. - + SystemNotification signal: ('[Hermes] Remaining Undeclared variables in the system: ' , Undeclared keys printString) ] diff --git a/Hermes/HEInteger.class.st b/src/Hermes/HEInteger.class.st similarity index 69% rename from Hermes/HEInteger.class.st rename to src/Hermes/HEInteger.class.st index 0a70d16..8a55a86 100644 --- a/Hermes/HEInteger.class.st +++ b/src/Hermes/HEInteger.class.st @@ -7,22 +7,24 @@ I am stored as: This allows to serialize any given Integer in the image " Class { - #name : #HEInteger, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEInteger', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEInteger class >> tag [ ^ 8 ] -{ #category : #converting } +{ #category : 'converting' } HEInteger >> asLiteralIn: env [ ^ value ] -{ #category : #reading } +{ #category : 'reading' } HEInteger >> doReadFrom: aReader [ | anArray isNegative | isNegative := aReader readByte = 1. diff --git a/Hermes/HEMethod.class.st b/src/Hermes/HEMethod.class.st similarity index 81% rename from Hermes/HEMethod.class.st rename to src/Hermes/HEMethod.class.st index ce376f3..c028462 100644 --- a/Hermes/HEMethod.class.st +++ b/src/Hermes/HEMethod.class.st @@ -19,8 +19,8 @@ I have: Check the methods #readFrom: and #writeInto: for details of how it is written in the file. " Class { - #name : #HEMethod, - #superclass : #HEAbstractExported, + #name : 'HEMethod', + #superclass : 'HEAbstractExported', #instVars : [ 'className', 'name', @@ -32,30 +32,32 @@ Class { 'numTemps', 'hasPrimitive' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> bytecode [ ^ bytecode ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> bytecode: anObject [ bytecode := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> className [ ^ className ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> className: anObject [ className := anObject ] -{ #category : #compiling } +{ #category : 'compiling' } HEMethod >> headerFor: anEnvironment [ | encoderClass| "When a method is deserialized its header should be recalculated" @@ -64,27 +66,27 @@ HEMethod >> headerFor: anEnvironment [ ^ (CompiledMethod headerFlagForEncoder: encoderClass) + (numArgs bitShift: 24) + (numTemps bitShift: 18) + literals size + (hasPrimitive bitShift: 16) ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> literals [ ^ literals ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> literals: anObject [ literals := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> name: anObject [ name := anObject ] -{ #category : #printing } +{ #category : 'printing' } HEMethod >> printOn: aStream [ aStream nextPutAll: 'HEMethod ( '; @@ -92,17 +94,17 @@ HEMethod >> printOn: aStream [ nextPutAll: ' )' ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> protocol [ ^ protocol ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> protocol: anObject [ protocol := anObject ] -{ #category : #reading } +{ #category : 'reading' } HEMethod >> readFrom: aReader [ | numberOfLiterals | @@ -122,7 +124,7 @@ HEMethod >> readFrom: aReader [ 1 to: numberOfLiterals do: [ :idx | literals at:idx put: (HEExportedLiteral readFrom: aReader) ] ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethod >> selector [ ^ self name ] diff --git a/Hermes/HEMethodContainer.class.st b/src/Hermes/HEMethodContainer.class.st similarity index 81% rename from Hermes/HEMethodContainer.class.st rename to src/Hermes/HEMethodContainer.class.st index 111a75a..00209f6 100644 --- a/Hermes/HEMethodContainer.class.st +++ b/src/Hermes/HEMethodContainer.class.st @@ -4,8 +4,8 @@ I implement all the handling of methods (instance side and class side) and the t The headers of a class and a trait are different. Each subclass implements this reading. " Class { - #name : #HEMethodContainer, - #superclass : #HEAbstractExported, + #name : 'HEMethodContainer', + #superclass : 'HEAbstractExported', #instVars : [ 'methods', 'classSideMethods', @@ -13,46 +13,48 @@ Class { 'classTraitComposition', 'category' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> category [ ^ category ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> category: anObject [ category := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> classSideMethods [ ^ classSideMethods ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> classSideMethods: anObject [ classSideMethods := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> classTraitComposition [ ^ classTraitComposition ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> classTraitComposition: anObject [ classTraitComposition := anObject ] -{ #category : #reading } +{ #category : 'reading' } HEMethodContainer >> doReadHeaderFrom: aReader [ "The headers of a class and a trait are different. Each subclass implements this reading" self subclassResponsibility ] -{ #category : #reading } +{ #category : 'reading' } HEMethodContainer >> doReadMethodsFrom: aReader [ | numberOfMethods numberOfClassMethods | "The category of a trait or a class is stored as a byteString." @@ -70,28 +72,28 @@ HEMethodContainer >> doReadMethodsFrom: aReader [ classTraitComposition := HEExportedLiteral readFrom: aReader ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> methods [ ^ methods ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> methods: anObject [ methods := anObject ] -{ #category : #reading } +{ #category : 'reading' } HEMethodContainer >> readFrom: aReader [ self doReadHeaderFrom: aReader. self doReadMethodsFrom: aReader ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> traitComposition [ ^ traitComposition ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodContainer >> traitComposition: anObject [ traitComposition := anObject ] diff --git a/Hermes/HEMethodLiteral.class.st b/src/Hermes/HEMethodLiteral.class.st similarity index 71% rename from Hermes/HEMethodLiteral.class.st rename to src/Hermes/HEMethodLiteral.class.st index 5412b0c..fc3de2f 100644 --- a/Hermes/HEMethodLiteral.class.st +++ b/src/Hermes/HEMethodLiteral.class.st @@ -4,44 +4,46 @@ I am stored as a className and a selector. Both elements are stored as HEExportedLiterals. " Class { - #name : #HEMethodLiteral, - #superclass : #HEExportedLiteral, + #name : 'HEMethodLiteral', + #superclass : 'HEExportedLiteral', #instVars : [ 'className', 'selector' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEMethodLiteral class >> tag [ ^ 10 ] -{ #category : #converting } +{ #category : 'converting' } HEMethodLiteral >> asLiteralIn: env [ ^ (env newClass name = className and: [ env newSelector = selector ]) ifTrue: [ env newMethod ] ifFalse: [ (env classNamed: className) >> selector ] ] -{ #category : #introspection } +{ #category : 'introspection' } HEMethodLiteral >> className [ ^ className ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodLiteral >> className: anObject [ className := anObject ] -{ #category : #reading } +{ #category : 'reading' } HEMethodLiteral >> doReadFrom: aReader [ className := aReader readByteSymbol. selector := aReader readByteSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } HEMethodLiteral >> value: aMethod [ className := aMethod methodClass name. selector := aMethod selector diff --git a/Hermes/HEPackage.class.st b/src/Hermes/HEPackage.class.st similarity index 81% rename from Hermes/HEPackage.class.st rename to src/Hermes/HEPackage.class.st index 9a1db14..c40f3c4 100644 --- a/Hermes/HEPackage.class.st +++ b/src/Hermes/HEPackage.class.st @@ -17,8 +17,8 @@ Then the methods for all the classes and traits. And then the extension methods. " Class { - #name : #HEPackage, - #superclass : #HEAbstractExported, + #name : 'HEPackage', + #superclass : 'HEAbstractExported', #instVars : [ 'version', 'packageName', @@ -26,40 +26,42 @@ Class { 'extensionMethods', 'traits' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #formatting } +{ #category : 'formatting' } HEPackage class >> formatVersion [ ^ 2 ] -{ #category : #adding } +{ #category : 'adding' } HEPackage >> addClass: anExportedClass [ classes add: anExportedClass ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> classes [ ^ classes ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> classes: anObject [ classes := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> extensionMethods [ ^ extensionMethods ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> extensionMethods: anObject [ extensionMethods := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } HEPackage >> initialize [ version := self class formatVersion. classes := OrderedCollection new. @@ -68,17 +70,17 @@ HEPackage >> initialize [ extensionMethods := OrderedCollection new ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> packageName [ ^ packageName ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> packageName: anObject [ packageName := anObject ] -{ #category : #printing } +{ #category : 'printing' } HEPackage >> printOn: aStream [ aStream nextPutAll: 'HEPackage ( '; @@ -86,12 +88,12 @@ HEPackage >> printOn: aStream [ nextPutAll: ' )' ] -{ #category : #reading } +{ #category : 'reading' } HEPackage >> readClassFrom: aReader [ classes add: (HEClass readFrom: aReader) ] -{ #category : #reading } +{ #category : 'reading' } HEPackage >> readFrom: aReader [ | numberOfTraits numberOfClasses numberOfExtensionMethods | version := aReader readInt32. @@ -110,17 +112,17 @@ HEPackage >> readFrom: aReader [ 1 to: numberOfExtensionMethods do: [ :idx | extensionMethods add: (HEMethod readFrom: aReader) ] ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> traits [ ^ traits ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> traits: anObject [ traits := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HEPackage >> version [ ^ version ] diff --git a/Hermes/HEPragma.class.st b/src/Hermes/HEPragma.class.st similarity index 74% rename from Hermes/HEPragma.class.st rename to src/Hermes/HEPragma.class.st index 50947e8..5579657 100644 --- a/Hermes/HEPragma.class.st +++ b/src/Hermes/HEPragma.class.st @@ -8,49 +8,51 @@ The keyword is a HESymbol and the arguments si a HEArray " Class { - #name : #HEPragma, - #superclass : #HEExportedLiteral, + #name : 'HEPragma', + #superclass : 'HEExportedLiteral', #instVars : [ 'method', 'arguments', 'keyword' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEPragma class >> tag [ ^ 11 ] -{ #category : #accessing } +{ #category : 'accessing' } HEPragma >> arguments [ ^ arguments ] -{ #category : #converting } +{ #category : 'converting' } HEPragma >> asLiteralIn: env [ ^ Pragma for: (method asLiteralIn: env) selector: (keyword asLiteralIn: env) arguments: (arguments asLiteralIn: env) ] -{ #category : #reading } +{ #category : 'reading' } HEPragma >> doReadFrom: aReader [ method := HEExportedLiteral readFrom: aReader. keyword := HEExportedLiteral readFrom: aReader. arguments := HEExportedLiteral readFrom: aReader ] -{ #category : #accessing } +{ #category : 'accessing' } HEPragma >> keyword [ ^ keyword ] -{ #category : #accessing } +{ #category : 'accessing' } HEPragma >> method [ ^ method ] -{ #category : #accessing } +{ #category : 'accessing' } HEPragma >> value: aPragma [ method := aPragma method asExportedLiteral. keyword := aPragma selector asExportedLiteral. diff --git a/Hermes/HEScaledDecimal.class.st b/src/Hermes/HEScaledDecimal.class.st similarity index 52% rename from Hermes/HEScaledDecimal.class.st rename to src/Hermes/HEScaledDecimal.class.st index 3120cea..8e4af35 100644 --- a/Hermes/HEScaledDecimal.class.st +++ b/src/Hermes/HEScaledDecimal.class.st @@ -4,21 +4,25 @@ I am stored as a Fraction (check HEFraction class) but also adding the scale. The scale is stored as a exported literal. " Class { - #name : #HEScaledDecimal, - #superclass : #HEFraction, - #category : #'Hermes-Model' + #name : 'HEScaledDecimal', + #superclass : 'HEFraction', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } -HEScaledDecimal class >> tag [ +{ #category : 'accessing' } +HEScaledDecimal class >> tag [ ^ 25 ] -{ #category : #reading } +{ #category : 'reading' } HEScaledDecimal >> doReadFrom: aReader [ | scale | super doReadFrom: aReader. scale := HEExportedLiteral readFrom: aReader. - - value := ScaledDecimal newFromNumber: value scale: scale value + + value := ScaledDecimal newFromNumber: value scale: scale value. + + ] diff --git a/Hermes/HESendMessage.class.st b/src/Hermes/HESendMessage.class.st similarity index 71% rename from Hermes/HESendMessage.class.st rename to src/Hermes/HESendMessage.class.st index e354291..6e21e0d 100644 --- a/Hermes/HESendMessage.class.st +++ b/src/Hermes/HESendMessage.class.st @@ -7,17 +7,19 @@ As a trait composition is a Smalltalk expression it is serialized as one or more Each of my elements are HEExportedLiterals, so they can be any literal " Class { - #name : #HESendMessage, - #superclass : #HEExportedLiteral, + #name : 'HESendMessage', + #superclass : 'HEExportedLiteral', #instVars : [ 'selector', 'receiver', 'arguments' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } HESendMessage class >> selector: aSelector receiver: aReceiver arguments: arguments [ ^ self new @@ -27,56 +29,56 @@ HESendMessage class >> selector: aSelector receiver: aReceiver arguments: argume yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } HESendMessage class >> tag [ ^ 27 ] -{ #category : #accessing } +{ #category : 'accessing' } HESendMessage >> arguments [ ^ arguments ] -{ #category : #accessing } +{ #category : 'accessing' } HESendMessage >> arguments: anObject [ arguments := anObject ] -{ #category : #converting } +{ #category : 'converting' } HESendMessage >> asLiteralIn: env [ | aReceiver aSelector args | aReceiver := receiver asLiteralIn: env. aSelector := selector asLiteralIn: env. args := arguments asLiteralIn: env. - + ^ aReceiver perform: aSelector withArguments: args ] -{ #category : #reading } -HESendMessage >> doReadFrom: aReader [ +{ #category : 'reading' } +HESendMessage >> doReadFrom: aReader [ selector := (HEExportedLiteral readFrom: aReader). receiver := (HEExportedLiteral readFrom: aReader). - arguments := (HEExportedLiteral readFrom: aReader) + arguments := (HEExportedLiteral readFrom: aReader). ] -{ #category : #accessing } +{ #category : 'accessing' } HESendMessage >> receiver [ ^ receiver ] -{ #category : #accessing } +{ #category : 'accessing' } HESendMessage >> receiver: anObject [ receiver := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HESendMessage >> selector [ ^ selector ] -{ #category : #accessing } +{ #category : 'accessing' } HESendMessage >> selector: anObject [ selector := anObject ] diff --git a/Hermes/HESymbol.class.st b/src/Hermes/HESymbol.class.st similarity index 58% rename from Hermes/HESymbol.class.st rename to src/Hermes/HESymbol.class.st index d58a67b..d63482d 100644 --- a/Hermes/HESymbol.class.st +++ b/src/Hermes/HESymbol.class.st @@ -4,17 +4,19 @@ I just extend the HEByteString representation. I just add a conversion from String to Symbol after reading the value. " Class { - #name : #HESymbol, - #superclass : #HEByteString, - #category : #'Hermes-Model' + #name : 'HESymbol', + #superclass : 'HEByteString', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HESymbol class >> tag [ ^ 9 ] -{ #category : #reading } +{ #category : 'reading' } HESymbol >> doConvertValue: aValue [ ^ aValue asSymbol ] diff --git a/Hermes/HETrait.class.st b/src/Hermes/HETrait.class.st similarity index 52% rename from Hermes/HETrait.class.st rename to src/Hermes/HETrait.class.st index a3f6b7f..e801617 100644 --- a/Hermes/HETrait.class.st +++ b/src/Hermes/HETrait.class.st @@ -4,36 +4,47 @@ My header only includes the name of the trait. Mostly of my behavior is from HEMethodContainer. " Class { - #name : #HETrait, - #superclass : #HEMethodContainer, + #name : 'HETrait', + #superclass : 'HEMethodContainer', #instVars : [ 'traitName' ], - #category : #'Hermes-Model' + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #reading } +{ #category : 'reading' } HETrait >> doReadHeaderFrom: aReader [ traitName := aReader readByteSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } HETrait >> isTrait [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } HETrait >> name [ ^ self traitName ] -{ #category : #accessing } +{ #category : 'printing' } +HETrait >> printOn: aStream [ + + aStream + nextPutAll: 'HETrait ( '; + print: traitName; + nextPutAll: ' )' +] + +{ #category : 'accessing' } HETrait >> traitName [ ^ traitName ] -{ #category : #accessing } +{ #category : 'accessing' } HETrait >> traitName: anObject [ traitName := anObject ] diff --git a/Hermes/HETraitLiteral.class.st b/src/Hermes/HETraitLiteral.class.st similarity index 61% rename from Hermes/HETraitLiteral.class.st rename to src/Hermes/HETraitLiteral.class.st index 5acfef6..7b27a10 100644 --- a/Hermes/HETraitLiteral.class.st +++ b/src/Hermes/HETraitLiteral.class.st @@ -6,22 +6,24 @@ When serialized I get the name of the trait. When deserialized I find the trait in the target environment " Class { - #name : #HETraitLiteral, - #superclass : #HESymbol, - #category : #'Hermes-Model' + #name : 'HETraitLiteral', + #superclass : 'HESymbol', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HETraitLiteral class >> tag [ ^ 19 ] -{ #category : #converting } +{ #category : 'converting' } HETraitLiteral >> asLiteralIn: env [ ^ env classNamed: value ] -{ #category : #accessing } +{ #category : 'accessing' } HETraitLiteral >> value: aTrait [ value := aTrait name ] diff --git a/Hermes/HEUndefinedObject.class.st b/src/Hermes/HEUndefinedObject.class.st similarity index 51% rename from Hermes/HEUndefinedObject.class.st rename to src/Hermes/HEUndefinedObject.class.st index f1d2238..31f0788 100644 --- a/Hermes/HEUndefinedObject.class.st +++ b/src/Hermes/HEUndefinedObject.class.st @@ -3,21 +3,23 @@ I represent nil as a literal. I am only stored as my tag. I have no content. " Class { - #name : #HEUndefinedObject, - #superclass : #HEExportedLiteral, - #category : #'Hermes-Model' + #name : 'HEUndefinedObject', + #superclass : 'HEExportedLiteral', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEUndefinedObject class >> tag [ ^ 13 ] -{ #category : #converting } +{ #category : 'converting' } HEUndefinedObject >> asLiteralIn: env [ ^ nil ] -{ #category : #reading } +{ #category : 'reading' } HEUndefinedObject >> doReadFrom: aReader [ ] diff --git a/Hermes/HEWideString.class.st b/src/Hermes/HEWideString.class.st similarity index 57% rename from Hermes/HEWideString.class.st rename to src/Hermes/HEWideString.class.st index 8f2b348..b529db0 100644 --- a/Hermes/HEWideString.class.st +++ b/src/Hermes/HEWideString.class.st @@ -4,17 +4,19 @@ I store myself as a byte array. To store myself I encode the content in utf8. " Class { - #name : #HEWideString, - #superclass : #HEByteArray, - #category : #'Hermes-Model' + #name : 'HEWideString', + #superclass : 'HEByteArray', + #category : 'Hermes-Model', + #package : 'Hermes', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } HEWideString class >> tag [ ^ 26 ] -{ #category : #reading } +{ #category : 'reading' } HEWideString >> doReadFrom: aReader [ value := aReader readByteArray utf8Decoded ] diff --git a/Hermes/HermesCommandLineHandler.class.st b/src/Hermes/HermesCommandLineHandler.class.st similarity index 89% rename from Hermes/HermesCommandLineHandler.class.st rename to src/Hermes/HermesCommandLineHandler.class.st index 0e6560c..e12d5eb 100644 --- a/Hermes/HermesCommandLineHandler.class.st +++ b/src/Hermes/HermesCommandLineHandler.class.st @@ -37,22 +37,24 @@ Examples " Class { - #name : #HermesCommandLineHandler, - #superclass : #CommandLineHandler, - #category : #'Hermes-CommandLineHandler' + #name : 'HermesCommandLineHandler', + #superclass : 'CommandLineHandler', + #category : 'Hermes-CommandLineHandler', + #package : 'Hermes', + #tag : 'CommandLineHandler' } -{ #category : #accessing } +{ #category : 'accessing' } HermesCommandLineHandler class >> commandName [ ^ 'loadHermes' ] -{ #category : #accessing } +{ #category : 'accessing' } HermesCommandLineHandler class >> description [ ^ 'Loads the hermes files passed as parameter' ] -{ #category : #activation } +{ #category : 'activation' } HermesCommandLineHandler >> activate [ self activateHelp ifTrue: [ ^ self ]. self validateParameters. @@ -65,7 +67,7 @@ HermesCommandLineHandler >> activate [ self exitSuccess ] -{ #category : #'processing files' } +{ #category : 'processing files' } HermesCommandLineHandler >> createInstaller [ "In the basic installation, the bootstraped version of Hermes, there is only one Installer, the HEInstaller. @@ -80,7 +82,7 @@ HermesCommandLineHandler >> createInstaller [ ifAbsent: [ HEInstaller new ] ] -{ #category : #'processing files' } +{ #category : 'processing files' } HermesCommandLineHandler >> processFile: file [ "It loads the package and installs it in the image" | installer reader readPackage | @@ -97,13 +99,13 @@ HermesCommandLineHandler >> processFile: file [ installer installPackage: readPackage ] -{ #category : #'processing files' } +{ #category : 'processing files' } HermesCommandLineHandler >> processFiles [ "The files are processed in order of the command line" (self commandLine allFilesWithExtension: '.hermes') do: [ :file | self processFile: file ] ] -{ #category : #validation } +{ #category : 'validation' } HermesCommandLineHandler >> validateParameters [ "The command line handle should have at least one .hermes file" (self commandLine hasFileWithExtension: '.hermes') diff --git a/Hermes/ManifestHermes.class.st b/src/Hermes/ManifestHermes.class.st similarity index 85% rename from Hermes/ManifestHermes.class.st rename to src/Hermes/ManifestHermes.class.st index fb69202..ad7a8b9 100644 --- a/Hermes/ManifestHermes.class.st +++ b/src/Hermes/ManifestHermes.class.st @@ -12,12 +12,14 @@ To Load code check: HEInstaller and HermesCommandLineHandler. To Export code check the comments in the Hermes-Exporter package. " Class { - #name : #ManifestHermes, - #superclass : #PackageManifest, - #category : #'Hermes-Manifest' + #name : 'ManifestHermes', + #superclass : 'PackageManifest', + #category : 'Hermes-Manifest', + #package : 'Hermes', + #tag : 'Manifest' } -{ #category : #'meta-data - dependency analyser' } +{ #category : 'meta-data - dependency analyser' } ManifestHermes class >> manuallyResolvedDependencies [ ^ #(#'RPackage-Core' #Files #'Collections-Abstract') ] diff --git a/src/Hermes/package.st b/src/Hermes/package.st new file mode 100644 index 0000000..fedf26c --- /dev/null +++ b/src/Hermes/package.st @@ -0,0 +1 @@ +Package { #name : 'Hermes' }