Skip to content

Commit

Permalink
Fixes #129, #130, #131
Browse files Browse the repository at this point in the history
  • Loading branch information
eMaringolo committed Jul 20, 2023
1 parent 2d5c50d commit ddc7d9d
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 38 deletions.
12 changes: 6 additions & 6 deletions source/.configmaps
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
#conditions : [ ],
#ts : 3851938730,
#ts : 3867308070,
#comment : '',
#formatVersion : '1.1',
#applications : OrderedCollection [
Expand All @@ -22,13 +22,13 @@
},
{
#name : 'TonelLoaderModel',
#versionName : '1.6.1',
#ts : 3854101104
#versionName : '1.6.3',
#ts : 3867307944
},
{
#name : 'TonelReaderModel',
#versionName : '1.5.7',
#ts : 3836968025
#versionName : '1.6.2',
#ts : 3867235271
},
{
#name : 'TonelTools',
Expand All @@ -42,7 +42,7 @@
}
],
#name : 'ENVY/Image Tonel',
#versionName : '1.6.1'
#versionName : '1.6.3'
},
{
#conditions : [ ],
Expand Down
27 changes: 24 additions & 3 deletions source/TonelLoaderModel/TonelApplicationLoader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TonelApplicationLoader >> autogenerateClassSideNewInitializers [
superclasses do: [:aSuperclass | | tonelClass |
tonelClass := allDefinedClasses at: aSuperclass.
"Only generate #new if it does not have it...we don't want to override it"
tonelClass includesClassSideNewMethod
(tonelClass includesClassSideNewMethod or: [self classSideNewMethodIsDefinedInSuperclassOf: tonelClass])
ifFalse: [
tonelClass addMethod: (TonelReaderMethodDefinition newInitializeMethodFor: aSuperclass)]]
]
Expand Down Expand Up @@ -96,6 +96,27 @@ TonelApplicationLoader >> chooseVersionName [

]

{ #category : 'loading-internal' }
TonelApplicationLoader >> classSideNewMethodIsDefinedInSuperclassOf: tonelClass [

| superClass superClassImplementor |

superClass :=
Smalltalk
classAt: tonelClass superclassIdentifier
ifAbsent: [
self tonelApplication
definedClassNamed: tonelClass superclassIdentifier
ifAbsent: [self loader tonelClassNamed: tonelClass superclassIdentifier]].
superClass isNil ifTrue: [^false].

(superClass class = TonelReaderClassDefinition) ifTrue: [^tonelClass includesClassSideNewMethod].
superClassImplementor := (superClass class whichClassIncludesSelector: #new).
^superClassImplementor notNil and: [superClassImplementor ~= Behavior]


]

{ #category : 'loading-prompters' }
TonelApplicationLoader >> computePrerequisites [
^self loader prerequisitesFor: self tonelApplication current: tonelApplication prerequisites
Expand Down Expand Up @@ -209,10 +230,10 @@ TonelApplicationLoader >> detectAllRootSuperclassesWithinApp [
superclasses := Set new.
allDefinedClasses keysAndValuesDo: [:aClassName :tonelClass |
superclassBlock := [:aClass |
(allDefinedClasses includesKey: aClass superclassIdentifier asString)
(allDefinedClasses includesKey: aClass superclassIdentifier asSymbol)
ifTrue: [
superclassBlock
value: (allDefinedClasses at: aClass superclassIdentifier asString)]
value: (allDefinedClasses at: aClass superclassIdentifier asSymbol)]
ifFalse: [aClass name]].
superclasses add: (superclassBlock value: tonelClass)].
^superclasses
Expand Down
10 changes: 6 additions & 4 deletions source/TonelLoaderModel/TonelLoader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,14 @@ TonelLoader >> systemLoadedApplications [

{ #category : 'accessing' }
TonelLoader >> tonelClassNamed: aSymbol [
"Returns the Tonel class definition defined in one of receiver's application.
Answers:
<TonelReaderClassDefinition>
"

self applications do: [:tonelApp |
(tonelApp allDefinedClasses
detect: [:tonelClass | tonelClass identifier = aSymbol]
ifNone: [])
ifNotNil: [:foundClass | ^foundClass]].
(tonelApp definedClassNamed: aSymbol ifAbsent: []) ifNotNil: [:foundClass | ^foundClass]].
^nil
]

Expand Down
6 changes: 6 additions & 0 deletions source/TonelLoaderModel/TonelLoaderApplication.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ TonelLoaderApplication >> createTonelPackageNameMethodFor: anApp [
categorizeIn: #('Tonel-Metadata')] "Have it notify itself?"
]

{ #category : 'querying' }
TonelLoaderApplication >> definedClassNamed: aSymbol ifAbsent: aBlock [

^self allDefinedClasses at: aSymbol ifAbsent: aBlock
]

{ #category : 'loading' }
TonelLoaderApplication >> definePoolDictionaries [
"Define the pool dictionaries declared in the receiver."
Expand Down
7 changes: 7 additions & 0 deletions source/TonelLoaderModel/TonelLoaderModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ Class {
#superclass : 'Application',
#category : 'TonelLoaderModel'
}

{ #category : 'Not categorized',
#vaVisibility : 'private' }
TonelLoaderModel class >> removing [

TonelLoaderSettings reset
]
12 changes: 6 additions & 6 deletions source/TonelLoaderModel/TonelReaderClassDefinition.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ TonelReaderClassDefinition class >> appNamed: aString [
superclass: 'Application' "$NON-NLS$"
variable: false
fieldType: 'pointers' "$NON-NLS$"
instanceVariables: '' "$NON-NLS$"
classVariables: '' "$NON-NLS$"
poolDictionaries: '') "$NON-NLS$"
instanceVariables: #()
classVariables: #()
poolDictionaries: #())
addSubAppMethods;
yourself
]
Expand All @@ -25,9 +25,9 @@ TonelReaderClassDefinition class >> subAppNamed: aString [
superclass: 'SubApplication' "$NON-NLS$"
variable: false
fieldType: 'pointers' "$NON-NLS$"
instanceVariables: '' "$NON-NLS$"
classVariables: '' "$NON-NLS$"
poolDictionaries: '') "$NON-NLS$"
instanceVariables: #()
classVariables: #()
poolDictionaries: #())
addSubAppMethods;
yourself
]
Expand Down
18 changes: 11 additions & 7 deletions source/TonelReaderModel/TonelParser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,17 @@ TonelParser >> newClassDefinitionFrom: anArray [
superclass: (metadata at: #superclass)
variable: nil
fieldType: typeName
instanceVariables: (metadata at: #instVars ifAbsent: [#()])
classVariables: (metadata at: #classVars ifAbsent: [#()])
poolDictionaries: (metadata at: #pools ifAbsent: [#()]))
category: (metadata at: #category);
classInstanceVariables: (metadata at: #classInstVars ifAbsent: [#()]);
classComment: classComment;
yourself)
instanceVariables:
((metadata at: #instVars ifAbsent: [#()]) collect: [:each | each asString])
classVariables:
((metadata at: #classVars ifAbsent: [#()]) collect: [:each | each asString])
poolDictionaries:
((metadata at: #pools ifAbsent: [#()]) collect: [:each | each asString])
)
category: (metadata at: #category);
classInstanceVariables: (metadata at: #classInstVars ifAbsent: [#()]);
classComment: classComment;
yourself)


]
Expand Down
23 changes: 11 additions & 12 deletions source/TonelReaderModel/TonelReaderClassDefinition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TonelReaderClassDefinition class >> name: aString [
]

{ #category : 'Initialize-Release' }
TonelReaderClassDefinition class >> name: nameString superclass: superString variable: varBoolean fieldType: fieldTypeString instanceVariables: instVarString classVariables: classVarString poolDictionaries: poolDictString [
TonelReaderClassDefinition class >> name: nameString superclass: superString variable: varBoolean fieldType: fieldTypeString instanceVariables: instVars classVariables: classVars poolDictionaries: poolDicts [
"Answer a new instance of receiver with all the parameters
specified as arguments."

Expand All @@ -45,9 +45,9 @@ TonelReaderClassDefinition class >> name: nameString superclass: superString var
superclass: superString
variable: varBoolean
fieldType: fieldTypeString
instanceVariables: instVarString
classVariables: classVarString
poolDictionaries: poolDictString;
instanceVariables: instVars
classVariables: classVars
poolDictionaries: poolDicts;
yourself

]
Expand Down Expand Up @@ -186,22 +186,21 @@ TonelReaderClassDefinition >> initialize: aString [
isSharedPool := false
]

{ #category : 'Initialize-Release' }
TonelReaderClassDefinition >> initializeWithName: nameString superclass: superString variable: varBoolean fieldType: fieldTypeString instanceVariables: instVarString classVariables: classVarString poolDictionaries: poolDictString [
{ #category : 'Initialize-Release',
#vaVisibility : 'private' }
TonelReaderClassDefinition >> initializeWithName: nameString superclass: superString variable: varBoolean fieldType: fieldTypeString instanceVariables: instVars classVariables: classVars poolDictionaries: poolDicts [

name := nameString.
identifier := nameString asSymbol.
superclassIdentifier := superString asSymbol = #nil ifTrue: [nil] ifFalse: [superString asSymbol].
variableClass := varBoolean.
fieldType := fieldTypeString.
instanceVariables := instVarString.
instanceVariables := instVars.
classInstanceVariables := #(). "If the class has class instance variables, they are provided separately"
classVariables := classVarString.
poolDictionaries := poolDictString.
classVariables := classVars.
poolDictionaries := poolDicts.
extension := false.
tonelMethods := OrderedCollection new.


tonelMethods := OrderedCollection new
]

{ #category : 'accessing' }
Expand Down

0 comments on commit ddc7d9d

Please sign in to comment.