author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 10 Jun 2013 17:14:45 +0100 | |
branch | jv |
changeset 3301 | cf7793a3625e |
parent 3285 | 90f2f3083f51 |
child 3303 | 7ed5d48e3756 |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
85 | 3 |
All Rights Reserved |
3 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
957 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
0 | 14 |
ClassChange subclass:#ClassDefinitionChange |
2316 | 15 |
instanceVariableNames:'objectType superClassName classType indexedType otherParameters |
16 |
instanceVariableNames classVariableNames |
|
1854 | 17 |
classInstanceVariableNames poolDictionaries category private |
1871
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
18 |
definitionSelector owningClassName' |
235 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'System-Changes' |
|
0 | 22 |
! |
23 |
||
9 | 24 |
!ClassDefinitionChange class methodsFor:'documentation'! |
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
38 | 29 |
All Rights Reserved |
9 | 30 |
|
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
1162 | 42 |
instances represent class definition-changes. |
43 |
They are typically held in a ChangeSet. |
|
235 | 44 |
|
45 |
[author:] |
|
46 |
Claus Gittinger |
|
9 | 47 |
" |
100 | 48 |
! ! |
49 |
||
911 | 50 |
!ClassDefinitionChange methodsFor:'accessing'! |
51 |
||
1434 | 52 |
basicSuperClassName |
53 |
^ superClassName |
|
54 |
! |
|
55 |
||
1427 | 56 |
category |
1854 | 57 |
category isNil ifTrue:[ |
58 |
self setupFromSource. |
|
59 |
]. |
|
1427 | 60 |
^ category |
1854 | 61 |
|
62 |
"Modified: / 11-10-2006 / 14:12:01 / cg" |
|
1427 | 63 |
! |
64 |
||
1178 | 65 |
category:something |
66 |
category := something. |
|
67 |
! |
|
68 |
||
1427 | 69 |
classInstanceVariableNames |
70 |
^ classInstanceVariableNames |
|
71 |
! |
|
72 |
||
73 |
classInstanceVariableNames:something |
|
74 |
classInstanceVariableNames := something. |
|
75 |
! |
|
76 |
||
77 |
classVariableNames |
|
78 |
^ classVariableNames |
|
79 |
! |
|
80 |
||
81 |
classVariableNames:something |
|
82 |
classVariableNames := something. |
|
83 |
! |
|
84 |
||
2368 | 85 |
delta |
3139
c6eb068647cc
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3111
diff
changeset
|
86 |
| class | |
2368 | 87 |
|
88 |
class := self changeClass. |
|
89 |
class ifNil:[^#+]. |
|
3139
c6eb068647cc
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3111
diff
changeset
|
90 |
|
2504 | 91 |
^(self class isSource: self source sameSourceAs: class definitionWithoutPackage "definition") |
2368 | 92 |
ifTrue:[#=] |
93 |
ifFalse:[#~] |
|
2504 | 94 |
|
95 |
"Modified: / 31-08-2011 / 09:26:48 / cg" |
|
96 |
! |
|
97 |
||
98 |
deltaDetail |
|
99 |
"Returns a delta to the current state as a ChangeDelta object" |
|
100 |
||
2690 | 101 |
| class mySource imageSource myTree imageTree same | |
2504 | 102 |
|
103 |
class := self changeClass. |
|
104 |
class isNil ifTrue:[^ ChangeDeltaInformation added ]. |
|
2753 | 105 |
class isLoaded ifFalse:[^ ChangeDeltaInformation different ]. |
2504 | 106 |
mySource := self source. |
107 |
imageSource := class definitionWithoutPackage "definition". |
|
2690 | 108 |
same := (mySource = imageSource). |
109 |
same ifFalse:[ |
|
110 |
same := (self class isSource: mySource sameSourceAs: imageSource ). |
|
111 |
same ifFalse:[ |
|
112 |
"/ care for formatting (tabs, indentation etc.) |
|
113 |
myTree := RBParser parseExpression:mySource. |
|
114 |
imageTree := RBParser parseExpression:imageSource. |
|
115 |
same := (myTree = imageTree). |
|
116 |
same ifFalse:[ |
|
3275
e525d31c2a9b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3270
diff
changeset
|
117 |
"/ some classDefinition strings may contain whitespace |
2690 | 118 |
"/ instVarName string like 'foo bar ' instead of 'foo bar' (i.e. added a space)... |
119 |
((myTree receiver = imageTree receiver) |
|
120 |
and:[ (myTree selector = imageTree selector) |
|
121 |
and:[ ('*ubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' match: myTree selector) |
|
122 |
and:[ (myTree arguments at:1) = (imageTree arguments at:1) |
|
123 |
||
124 |
and:[ (2 to:5) conform:[:i | |
|
125 |
((myTree arguments at:i) isLiteral |
|
126 |
and:[ (imageTree arguments at:i) isLiteral |
|
3275
e525d31c2a9b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3270
diff
changeset
|
127 |
and:[ (myTree arguments at:i) value asString asCollectionOfWords |
e525d31c2a9b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3270
diff
changeset
|
128 |
= (imageTree arguments at:i) value asString asCollectionOfWords ]]) ] |
2690 | 129 |
|
130 |
]]]]) |
|
131 |
ifTrue:[ |
|
132 |
same := true |
|
133 |
] |
|
134 |
]. |
|
135 |
] |
|
136 |
]. |
|
137 |
||
138 |
^ same |
|
2504 | 139 |
ifTrue:[ ChangeDeltaInformation identical ] |
140 |
ifFalse:[ ChangeDeltaInformation different ] |
|
141 |
||
142 |
"Created: / 31-08-2011 / 10:26:42 / cg" |
|
2753 | 143 |
"Modified: / 24-01-2012 / 22:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2368 | 144 |
! |
145 |
||
3163
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
146 |
imageSource |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
147 |
"return the source for the in-image version of the method" |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
148 |
|
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
149 |
| cls | |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
150 |
|
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
151 |
cls := self changeClass. |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
152 |
cls isNil ifTrue:[ ^ nil ]. |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
153 |
^ cls definitionWithoutPackage |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
154 |
! |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
155 |
|
1427 | 156 |
instanceVariableNames |
157 |
^ instanceVariableNames |
|
158 |
! |
|
159 |
||
160 |
instanceVariableNames:something |
|
161 |
instanceVariableNames := something. |
|
162 |
! |
|
163 |
||
3150
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
164 |
localClassName |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
165 |
"for private classes, this returns the name relative to its owner; |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
166 |
for non-private ones, this is the regular name. |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
167 |
Notice that className always returns the full name (incl. any owner prefix)" |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
168 |
|
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
169 |
self isPrivateClassDefinitionChange ifFalse:[^ self className]. |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
170 |
|
3150
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
171 |
(className startsWith:(owningClassName,'::')) ifTrue:[ |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
172 |
^ className copyFrom:(owningClassName size + 2 + 1). |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
173 |
] ifFalse:[ |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
174 |
"/ should not happen |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
175 |
^ self className |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
176 |
] |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
177 |
! |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
178 |
|
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
179 |
nameSpaceName |
3270
b986056e7fe8
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3245
diff
changeset
|
180 |
|
b986056e7fe8
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3245
diff
changeset
|
181 |
"/ JV: What is the following good for? Please explain..." |
1318 | 182 |
objectType == #variable ifTrue:[ |
183 |
^ nil |
|
184 |
]. |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
185 |
^ self cutNameSpaceOf:(self nameSpaceOverride ? super nameSpaceName) |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
186 |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
187 |
"Modified: / 07-09-2011 / 20:47:14 / cg" |
3270
b986056e7fe8
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3245
diff
changeset
|
188 |
"Modified (comment): / 09-05-2013 / 13:46:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
189 |
! |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
190 |
|
1196 | 191 |
nameSpaceName: aNameSpaceName classType: aClassType otherParameters:otherParametersArg |
1854 | 192 |
"this instance setup message is used when reading from a VW-xml change file. |
193 |
Support for this is not yet complete." |
|
194 |
||
195 |
|indexedType imports| |
|
1196 | 196 |
|
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
197 |
nameSpaceOverride := aNameSpaceName. |
911 | 198 |
classType := aClassType. |
1196 | 199 |
otherParameters := Dictionary new addAll:otherParametersArg; yourself. |
200 |
||
201 |
superClassName := otherParameters at:#superclass: ifAbsent:nil. |
|
3163
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
202 |
self assert:(superClassName notNil). |
1196 | 203 |
superClassName notNil ifTrue:[ |
204 |
superClassName := superClassName pathString. |
|
205 |
]. |
|
206 |
indexedType := otherParameters at:#indexedType: ifAbsent:nil. |
|
207 |
private := otherParameters at:#private: ifAbsent:nil. |
|
208 |
instanceVariableNames := otherParameters at:#instanceVariableNames: ifAbsent:nil. |
|
209 |
classInstanceVariableNames := otherParameters at:#classInstanceVariableNames: ifAbsent:nil. |
|
210 |
imports := otherParameters at:#imports: ifAbsent:nil. |
|
211 |
category := otherParameters at:#category: ifAbsent:nil. |
|
1854 | 212 |
|
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
213 |
"Modified: / 15-06-2010 / 14:50:35 / cg" |
911 | 214 |
! |
215 |
||
216 |
objectType |
|
217 |
"return the value of the instance variable 'objectType' (automatically generated)" |
|
218 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
219 |
^ objectType |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
220 |
! |
911 | 221 |
|
222 |
objectType:something |
|
223 |
"set the value of the instance variable 'objectType' (automatically generated)" |
|
224 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
225 |
objectType := something. |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
226 |
! |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
227 |
|
1427 | 228 |
poolDictionaries |
2832 | 229 |
poolDictionaries isNil ifTrue:[ |
230 |
self setupFromSource. |
|
231 |
]. |
|
1427 | 232 |
^ poolDictionaries |
2832 | 233 |
|
234 |
"Modified: / 13-06-2012 / 12:23:41 / cg" |
|
1427 | 235 |
! |
236 |
||
237 |
poolDictionaries:something |
|
238 |
poolDictionaries := something. |
|
239 |
! |
|
240 |
||
2289 | 241 |
private:aBoolean |
242 |
private := aBoolean. |
|
243 |
||
244 |
"Created: / 30-08-2010 / 13:56:11 / cg" |
|
245 |
! |
|
246 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
247 |
source |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
248 |
"return the source of the change; |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
249 |
either the original source or a synthesized" |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
250 |
|
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
251 |
|src| |
1196 | 252 |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
253 |
(src := source) isNil ifTrue:[ |
1196 | 254 |
src := self definitionString |
255 |
]. |
|
256 |
^ src |
|
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
257 |
|
2900
c21c251db4a0
fixed namespaceoverride (for changeSetBrowser)
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
258 |
"Modified: / 10-08-2012 / 11:53:54 / cg" |
1196 | 259 |
! |
260 |
||
261 |
superClassName |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
262 |
|nm| |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
263 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
264 |
nm := superClassName. |
3163
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
265 |
nm isNil ifTrue:[^ 'nil']. |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
266 |
"/ convert VW namespace syntax |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
267 |
(nm includes:$.) ifTrue:[ |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
268 |
^ nm copyReplaceAll:$. withAll:'::'. |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
269 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
270 |
^ nm |
1427 | 271 |
! |
272 |
||
3163
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
273 |
superClassName:aString |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
274 |
superClassName := aString. |
16fdcb5a998b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3150
diff
changeset
|
275 |
self assert:(aString notNil). |
2207 | 276 |
self invalidateSource. |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
277 |
! |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
278 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
279 |
superClassNameWithoutMyNamespace |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
280 |
|nm| |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
281 |
|
1956 | 282 |
superClassName isNil ifTrue:[^ 'nil']. |
283 |
||
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
284 |
nm := self cutMyNameSpaceOf:superClassName. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
285 |
(nm includes:$.) ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
286 |
^ nm copyReplaceAll:$. withAll:'::'. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
287 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
288 |
^ nm |
1956 | 289 |
|
290 |
"Modified: / 03-03-2007 / 13:09:07 / cg" |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
291 |
! |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
292 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
293 |
superClassNameWithoutNamespace |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
294 |
|nm| |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
295 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
296 |
nm := self cutNameSpaceOf:superClassName. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
297 |
(nm includes:$.) ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
298 |
^ nm copyReplaceAll:$. withAll:'::'. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
299 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
300 |
^ nm |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
301 |
! ! |
911 | 302 |
|
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
303 |
!ClassDefinitionChange methodsFor:'applying'! |
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
304 |
|
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
305 |
apply |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
306 |
|changeClass sourceWithNamespace| |
3111 | 307 |
|
2425 | 308 |
superClassName isNil ifTrue:[ |
3301
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
309 |
self setupFromSource. |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
310 |
]. |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
311 |
"Some classes have nil superclass (such as Object)..." |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
312 |
superClassName notNil ifTrue:[ |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
313 |
(Smalltalk classNamed:superClassName) isNil ifTrue:[ |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
314 |
Class undeclared:superClassName |
3111 | 315 |
]. |
2425 | 316 |
]. |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
317 |
|
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
318 |
"/ here, using the current namespace as provided by the query or the override, |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
319 |
"/ generate a class definition with full names (i.e. incl. ns prefix). |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
320 |
sourceWithNamespace := self source. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
321 |
"/ as the namespace is already in the definition string, make sure that the namespace is not |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
322 |
"/ added twice, by anwering Smalltalk now!! |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
323 |
Class nameSpaceQuerySignal |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
324 |
answer:Smalltalk |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
325 |
do:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
326 |
Parser evaluate:sourceWithNamespace. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
327 |
]. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
328 |
|
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
329 |
package notNil ifTrue:[ |
3111 | 330 |
changeClass := self changeClass. |
331 |
changeClass notNil ifTrue:[ |
|
332 |
changeClass setPackage:package. |
|
333 |
]. |
|
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
334 |
]. |
2368 | 335 |
|
336 |
" |
|
2425 | 337 |
(ClassDefinitionChange className: #TestB source: 'TestA subclass: #TestB |
338 |
instanceVariableNames:'''' |
|
339 |
classVariableNames:'''' |
|
340 |
poolDictionaries:'''' |
|
341 |
category:''* remove me *''') |
|
342 |
apply |
|
2368 | 343 |
" |
344 |
||
2554 | 345 |
"Modified: / 06-10-2011 / 17:01:58 / cg" |
3301
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
346 |
"Modified: / 10-06-2013 / 17:12:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
347 |
! ! |
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
348 |
|
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
349 |
!ClassDefinitionChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
350 |
|
3210
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
351 |
isConflict |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
352 |
"true if this change is different than what is already in the image |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
353 |
(i.e. it overwrites some existing code)" |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
354 |
|
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
355 |
|cls| |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
356 |
|
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
357 |
(cls := self changeClass) isNil ifTrue:[^ false]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
358 |
cls superclass name ~= superClassName ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
359 |
cls instanceVariableString ~= instanceVariableNames ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
360 |
cls classVariableString ~= classVariableNames ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
361 |
cls class instanceVariableString ~= classInstanceVariableNames ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
362 |
cls sharedPoolNames ~= poolDictionaries ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
363 |
cls category ~= category ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
364 |
cls isPrivate ifTrue:[ |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
365 |
cls owningClass name ~= owningClassName ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
366 |
]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
367 |
cls definitionSelector ~= self definitionSelector ifTrue:[ ^ true ]. |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
368 |
^ false |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
369 |
! |
ab1729c084da
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3205
diff
changeset
|
370 |
|
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
371 |
isForSameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
372 |
"return true, if the given change represents a change for the same |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
373 |
thingy as the receiver (i.e. same method, same definition etc.)." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
374 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
375 |
changeB isClassDefinitionChange ifFalse:[^ false]. |
3205 | 376 |
^ self className = changeB className. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
377 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
378 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
379 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
380 |
"return true, if the given change represents the same change as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
381 |
|
798 | 382 |
(self isForSameAs:changeB) ifFalse:[^ false]. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
383 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
384 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
385 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
386 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
387 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
388 |
|
2410 | 389 |
!ClassDefinitionChange methodsFor:'converting'! |
390 |
||
391 |
asAntiChange |
|
392 |
||
393 |
^ClassRemoveChange className: self className |
|
394 |
||
395 |
"Created: / 02-11-2009 / 11:11:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
396 |
! ! |
|
397 |
||
962 | 398 |
!ClassDefinitionChange methodsFor:'printing & storing'! |
787 | 399 |
|
1196 | 400 |
definitionString |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
401 |
^ self definitionStringInNamespace: (self nameSpaceOverride) |
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
402 |
! |
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
403 |
|
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
404 |
definitionStringInNamespace: nsOrNil |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
405 |
|classNameUsed superClassNameUsed selPart ownerNameUsed| |
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
406 |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
407 |
objectType == #variable ifTrue:[ |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
408 |
"/ a visualWorks static variable definition change. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
409 |
"/ kludge to be here - should be a separate StaticVariableDefinitionChange |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
410 |
^ String streamContents:[:stream | |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
411 |
nsOrNil notNil ifTrue:[ |
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
412 |
stream nextPutAll:((nsOrNil asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
413 |
] ifFalse:[ |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
414 |
self halt:'can this happen ?'. |
2834 | 415 |
stream nextPutAll:'Smalltalk' |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
416 |
]. |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
417 |
|
1196 | 418 |
stream |
419 |
nextPutAll:' addClassVarName:'; |
|
1318 | 420 |
nextPutAll:className asString storeString |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
421 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
422 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
423 |
|
2554 | 424 |
superClassNameUsed := self superClassName. |
3150
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
425 |
"/ careful with private classes: the definition MUST give the |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
426 |
"/ local name as argument, not the full name |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
427 |
self isPrivateClassDefinitionChange ifTrue:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
428 |
classNameUsed := self localClassName. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
429 |
] ifFalse:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
430 |
classNameUsed := className. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
431 |
nsOrNil notNil ifTrue:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
432 |
classNameUsed := nsOrNil,'::',classNameUsed. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
433 |
]. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
434 |
]. |
3150
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
435 |
|
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
436 |
"/ selPart is the subclass:/variableSubclass/variableByteSubclass:/... - part |
2834 | 437 |
selPart := (self definitionSelector ? #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:') |
438 |
keywords first. |
|
2554 | 439 |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
440 |
^ String streamContents:[:stream | |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
441 |
stream |
2554 | 442 |
nextPutAll:superClassNameUsed; |
2834 | 443 |
nextPutAll:' ',selPart; |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
444 |
nextPutLine: classNameUsed asSymbol storeString; |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
445 |
tab; |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
446 |
nextPutAll:'instanceVariableNames:'; |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
447 |
nextPutLine:(instanceVariableNames ? '') storeString; |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
448 |
tab; |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
449 |
nextPutAll:'classVariableNames:'; |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
450 |
nextPutLine:(classVariableNames ? '') storeString; |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
451 |
tab; |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
452 |
nextPutAll:'poolDictionaries:'; |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
453 |
nextPutLine:(poolDictionaries ? '') storeString. |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
454 |
self isPrivateClassDefinitionChange ifTrue:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
455 |
ownerNameUsed := self owningClassName. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
456 |
nsOrNil notNil ifTrue:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
457 |
ownerNameUsed := nsOrNil,'::',ownerNameUsed. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
458 |
]. |
2831 | 459 |
stream |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
460 |
tab; |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
461 |
nextPutAll:'privateIn:'; |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
462 |
nextPutAll:ownerNameUsed |
2831 | 463 |
] ifFalse:[ |
464 |
stream |
|
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
465 |
tab; |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
466 |
nextPutAll:'category:'; |
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
467 |
nextPutAll:(category ? '') asString storeString |
2831 | 468 |
]. |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
469 |
] |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
470 |
|
2834 | 471 |
"Modified: / 13-06-2012 / 13:01:58 / cg" |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
472 |
"Modified: / 30-04-2013 / 19:52:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1196 | 473 |
! |
474 |
||
3203
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
475 |
definitionStringWithoutNamespace |
2639572248b5
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3163
diff
changeset
|
476 |
"cg - huh - who needs that? (the definitionString already does NOT include the classes namespace)" |
2876 | 477 |
|
478 |
|ns classNameUsed superClassNameUsed| |
|
479 |
||
480 |
ns := self nameSpaceOverride. |
|
481 |
||
482 |
objectType == #variable ifTrue:[ |
|
483 |
^ String streamContents:[:stream | |
|
484 |
ns notNil ifTrue:[ |
|
485 |
stream |
|
486 |
nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
|
487 |
] ifFalse:[ |
|
488 |
self halt:'can this happen ?'. |
|
489 |
stream |
|
490 |
nextPutAll:'Smalltalk' |
|
491 |
]. |
|
492 |
||
493 |
stream |
|
494 |
nextPutAll:' addClassVarName:'; |
|
495 |
nextPutAll:className asString storeString |
|
496 |
]. |
|
497 |
]. |
|
498 |
||
499 |
superClassNameUsed := self superClassName. |
|
500 |
classNameUsed := self classNameWithoutNamespace. |
|
501 |
||
502 |
^ String streamContents:[:stream | |
|
503 |
self isPrivateClassDefinitionChange ifFalse:[ |
|
504 |
stream |
|
505 |
nextPutAll:superClassNameUsed; |
|
506 |
nextPutAll:' subclass:'; |
|
507 |
nextPutAll: classNameUsed asSymbol storeString |
|
508 |
; |
|
509 |
cr; |
|
510 |
tab; |
|
511 |
nextPutAll:'instanceVariableNames:'; |
|
512 |
nextPutAll:(instanceVariableNames ? '') storeString; |
|
513 |
cr; |
|
514 |
tab; |
|
515 |
nextPutAll:'classVariableNames:'; |
|
516 |
nextPutAll:(classVariableNames ? '') storeString; |
|
517 |
cr; |
|
518 |
tab; |
|
519 |
nextPutAll:'poolDictionaries:'; |
|
520 |
nextPutAll:(poolDictionaries ? '') storeString; |
|
521 |
cr; |
|
522 |
tab; |
|
523 |
nextPutAll:'category:'; |
|
524 |
nextPutAll:(category ? '') storeString; |
|
525 |
cr |
|
526 |
] ifTrue:[ |
|
527 |
stream |
|
528 |
nextPutAll:superClassNameUsed; |
|
529 |
nextPutAll:' subclass:'; |
|
530 |
nextPutAll: (self className copyFrom: owningClassName size + 3) asSymbol storeString |
|
531 |
; |
|
532 |
cr; |
|
533 |
tab; |
|
534 |
nextPutAll:'instanceVariableNames:'; |
|
535 |
nextPutAll:(instanceVariableNames ? '') storeString; |
|
536 |
cr; |
|
537 |
tab; |
|
538 |
nextPutAll:'classVariableNames:'; |
|
539 |
nextPutAll:(classVariableNames ? '') storeString; |
|
540 |
cr; |
|
541 |
tab; |
|
542 |
nextPutAll:'poolDictionaries:'; |
|
543 |
nextPutAll:(poolDictionaries ? '') storeString; |
|
544 |
cr; |
|
545 |
tab; |
|
546 |
nextPutAll:'privateIn:'; |
|
547 |
nextPutAll: |
|
548 |
((ns := self nameSpaceName) isNil |
|
549 |
ifTrue:[owningClassName] |
|
550 |
ifFalse:[owningClassName copyFrom: ns size + 3]); |
|
551 |
cr |
|
552 |
] |
|
553 |
] |
|
554 |
||
555 |
"Modified: / 06-10-2011 / 17:02:05 / cg" |
|
556 |
"Created: / 20-03-2012 / 16:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
557 |
! |
|
558 |
||
1101 | 559 |
printOn:aStream |
1866 | 560 |
aStream |
561 |
nextPutAll:className; nextPutAll:' {definition}' |
|
562 |
||
563 |
"Modified: / 12-10-2006 / 17:48:28 / cg" |
|
1101 | 564 |
! |
565 |
||
896 | 566 |
printWithoutClassNameOn:aStream |
787 | 567 |
aStream nextPutAll:('definition of ' , className) |
568 |
||
569 |
||
570 |
! ! |
|
571 |
||
772 | 572 |
!ClassDefinitionChange methodsFor:'queries'! |
573 |
||
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
574 |
definitionSelector |
1854 | 575 |
definitionSelector isNil ifTrue:[ |
576 |
self setupFromSource. |
|
577 |
]. |
|
578 |
^ definitionSelector |
|
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
579 |
|
1854 | 580 |
"Modified: / 11-10-2006 / 14:11:44 / cg" |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
581 |
! |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
582 |
|
2833 | 583 |
definitionSelector:aSelector |
584 |
definitionSelector := aSelector |
|
585 |
||
586 |
"Created: / 13-06-2012 / 12:45:02 / cg" |
|
587 |
! |
|
588 |
||
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
589 |
fullOwningClassName |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
590 |
"the owner's name, including its namespace" |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
591 |
|
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
592 |
|nm ns| |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
593 |
|
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
594 |
nm := self owningClassName. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
595 |
nm isNil ifTrue:[^ nil]. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
596 |
|
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
597 |
(ns := self nameSpaceOverride) notNil ifTrue:[ |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
598 |
^ ns,'::',nm |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
599 |
]. |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
600 |
^ nm |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
601 |
! |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
602 |
|
772 | 603 |
isClassDefinitionChange |
604 |
^ true |
|
1854 | 605 |
! |
606 |
||
607 |
isPrivateClassDefinitionChange |
|
3150
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
608 |
"compute lazily; remember in private" |
10fa70a50dfa
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3139
diff
changeset
|
609 |
|
1854 | 610 |
private isNil ifTrue:[ |
1904 | 611 |
(className includes:$:) ifFalse:[ |
612 |
"/ cannot be private |
|
613 |
private := false |
|
614 |
] ifTrue:[ |
|
1909
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
615 |
source isNil ifTrue:[^ false ]. |
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
616 |
(source includesString:'private') ifFalse:[ |
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
617 |
private := false. |
1904 | 618 |
] ifTrue:[ |
1916 | 619 |
"/ (self changeClass notNil |
620 |
"/ and:[self changeClass isLoaded not]) ifTrue:[ |
|
621 |
"/ "/ cannot be private |
|
622 |
"/ private := false |
|
623 |
"/ ] ifTrue:[ |
|
1909
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
624 |
self setupFromSource. |
1916 | 625 |
"/ ]. |
1904 | 626 |
]. |
627 |
]. |
|
1854 | 628 |
]. |
629 |
^ private |
|
630 |
||
631 |
"Created: / 11-10-2006 / 14:19:03 / cg" |
|
1909
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
632 |
"Modified: / 16-11-2006 / 16:34:19 / cg" |
1871
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
633 |
! |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
634 |
|
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
635 |
owningClassName |
3220
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
636 |
"the owner's name, excluding the namespace" |
a8e24cc171f6
namespace handling fixed (I hope)
Claus Gittinger <cg@exept.de>
parents:
3210
diff
changeset
|
637 |
|
1871
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
638 |
self isPrivateClassDefinitionChange ifTrue:[ |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
639 |
owningClassName isNil ifTrue:[ |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
640 |
self setupFromSource. |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
641 |
]. |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
642 |
]. |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
643 |
^ owningClassName |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
644 |
|
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
645 |
"Created: / 12-10-2006 / 23:07:25 / cg" |
2289 | 646 |
! |
647 |
||
648 |
owningClassName:aStringOrSymbol |
|
649 |
owningClassName := aStringOrSymbol |
|
650 |
||
651 |
"Created: / 30-08-2010 / 13:55:37 / cg" |
|
772 | 652 |
! ! |
653 |
||
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
654 |
!ClassDefinitionChange methodsFor:'special'! |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
655 |
|
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
656 |
installAsAutoloadedClassIfPublicWithFilename:aFilenameString |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
657 |
"install the class defined by this change as autoloaded. |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
658 |
Skip private classes. |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
659 |
Enter class file name as abbreviation" |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
660 |
|
1904 | 661 |
|parseTree sel cat clsName cls catIdx pkg| |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
662 |
|
2289 | 663 |
private == true ifTrue:[^ self]. |
664 |
||
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
665 |
parseTree := Parser parseExpression:self source. |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
666 |
parseTree isMessage ifFalse:[ |
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
667 |
self error:'bad change source'. |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
668 |
]. |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
669 |
|
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
670 |
sel := parseTree selector. |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
671 |
(sel endsWith:':privateIn:') ifTrue:[^ self]. |
1418 | 672 |
|
2402
f6799fe6acc4
changed: #installAsAutoloadedClassIfPublicWithFilename:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
673 |
catIdx := sel asSymbol keywords indexOf:'category:'. |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
674 |
catIdx ~~ 0 ifTrue:[ |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
675 |
cat := (parseTree args at:catIdx) evaluate. |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
676 |
]. |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
677 |
|
3223
c3c37b9ce3f1
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3220
diff
changeset
|
678 |
clsName := self fullClassName "className" asSymbol. |
1802 | 679 |
cls := Smalltalk at:clsName. |
1904 | 680 |
|
681 |
pkg := package ? Project current package. |
|
682 |
||
1802 | 683 |
(cls isNil |
684 |
or:[cls isBehavior not |
|
685 |
or:[cls isLoaded not]]) ifTrue:[ |
|
1904 | 686 |
|autoloadedClass| |
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
687 |
|
1836 | 688 |
autoloadedClass := Smalltalk |
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
689 |
installAutoloadedClassNamed:clsName |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
690 |
category:cat |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
691 |
package:pkg |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
692 |
revision:nil. |
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
693 |
aFilenameString notNil ifTrue:[ |
1836 | 694 |
autoloadedClass setClassFilename:aFilenameString. |
695 |
"/ Smalltalk setFilename:aFilenameString forClass:clsName package:pkg. |
|
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1318
diff
changeset
|
696 |
] |
1904 | 697 |
] ifFalse:[ |
698 |
cls notNil ifTrue:[ |
|
699 |
cls isBehavior ifTrue:[ |
|
700 |
cls package ~= pkg ifTrue:[ |
|
2180
c952a3ae234d
changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents:
2093
diff
changeset
|
701 |
Transcript showCR:('Autoloaded class: %1 not installed (package would change from %2 to %3)' |
c952a3ae234d
changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents:
2093
diff
changeset
|
702 |
bindWith:clsName with:cls package with:pkg). |
1904 | 703 |
] |
704 |
]. |
|
705 |
]. |
|
706 |
]. |
|
1836 | 707 |
|
2402
f6799fe6acc4
changed: #installAsAutoloadedClassIfPublicWithFilename:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
708 |
"Modified: / 03-07-2011 / 18:34:05 / cg" |
1854 | 709 |
! |
710 |
||
2207 | 711 |
invalidateSource |
712 |
"internal - flush the sourceString if it got invalidated due to a |
|
713 |
className, superclassName, etc... change" |
|
714 |
||
715 |
source := nil. |
|
716 |
! |
|
717 |
||
1854 | 718 |
setupFromSource |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
719 |
"Extract data from class definition string in source. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
720 |
WARNING: This overwrites values in instvars!!" |
1854 | 721 |
|
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
722 |
|parseTree catIdx poolIdx instVarIdx classVarIdx | |
1854 | 723 |
|
724 |
source notNil ifTrue:[ |
|
725 |
parseTree := Parser parseExpression:source. |
|
1878 | 726 |
(parseTree notNil and:[parseTree isMessage]) ifFalse:[ |
1887 | 727 |
self error:'bad change source' mayProceed:true. |
728 |
^ self |
|
1854 | 729 |
]. |
730 |
||
731 |
definitionSelector := parseTree selector. |
|
732 |
||
733 |
private := (definitionSelector endsWith:':privateIn:'). |
|
1871
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
734 |
private ifTrue:[ |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
735 |
owningClassName := parseTree args last name. |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
736 |
]. |
1854 | 737 |
|
738 |
catIdx := definitionSelector keywords indexOf:'category:'. |
|
739 |
catIdx ~~ 0 ifTrue:[ |
|
740 |
category := (parseTree args at:catIdx) evaluate. |
|
741 |
]. |
|
2368 | 742 |
|
2832 | 743 |
poolIdx := definitionSelector keywords indexOf:'poolDictionaries:'. |
744 |
poolIdx ~~ 0 ifTrue:[ |
|
745 |
poolDictionaries := (parseTree args at:poolIdx) evaluate. |
|
746 |
]. |
|
747 |
||
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
748 |
instVarIdx := definitionSelector keywords indexOf:'instanceVariableNames:'. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
749 |
instVarIdx ~~ 0 ifTrue:[ |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
750 |
instanceVariableNames := (parseTree args at:instVarIdx) value. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
751 |
]. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
752 |
|
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
753 |
classVarIdx := definitionSelector keywords indexOf:'classVariableNames:'. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
754 |
classVarIdx ~~ 0 ifTrue:[ |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
755 |
classVariableNames := (parseTree args at:classVarIdx) value. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
756 |
]. |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
757 |
|
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
758 |
|
3301
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
759 |
"Care about nil superclasss (that's valid for certain |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
760 |
classes like Object, ProtoObject or custom proxies" |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
761 |
parseTree receiver isVariable ifTrue:[ |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
762 |
superClassName := parseTree receiver name. |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
763 |
] ifFalse:[ |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
764 |
parseTree receiver isConstant ifTrue:[ |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
765 |
superClassName := parseTree receiver value. |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
766 |
superClassName notNil ifTrue:[ |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
767 |
self error: 'Invalid superclass - can be either a class or nil' |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
768 |
] |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
769 |
] |
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
770 |
]. |
1854 | 771 |
]. |
772 |
||
773 |
"Created: / 11-10-2006 / 14:10:02 / cg" |
|
2832 | 774 |
"Modified: / 13-06-2012 / 12:25:10 / cg" |
3301
cf7793a3625e
Bugfix in ClassDefinitionChange (nil superclass),
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3285
diff
changeset
|
775 |
"Modified: / 10-06-2013 / 17:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
776 |
! ! |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
777 |
|
2614
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
778 |
!ClassDefinitionChange methodsFor:'visiting'! |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
779 |
|
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
780 |
acceptChangeVisitor:aVisitor |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
781 |
^ aVisitor visitClassDefinitionChange:self. |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
782 |
|
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
783 |
"Created: / 25-11-2011 / 17:13:13 / cg" |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
784 |
! ! |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
785 |
|
100 | 786 |
!ClassDefinitionChange class methodsFor:'documentation'! |
787 |
||
2518 | 788 |
version |
3275
e525d31c2a9b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3270
diff
changeset
|
789 |
^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.84 2013-05-15 15:58:10 cg Exp $' |
3223
c3c37b9ce3f1
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3220
diff
changeset
|
790 |
! |
c3c37b9ce3f1
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3220
diff
changeset
|
791 |
|
c3c37b9ce3f1
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3220
diff
changeset
|
792 |
version_CVS |
3275
e525d31c2a9b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3270
diff
changeset
|
793 |
^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.84 2013-05-15 15:58:10 cg Exp $' |
3245
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
794 |
! |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
795 |
|
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
796 |
version_HG |
a0e79ed3aa65
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3223
diff
changeset
|
797 |
|
3270
b986056e7fe8
class: ClassDefinitionChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3245
diff
changeset
|
798 |
^ '$Changeset: <not expanded> $' |
2180
c952a3ae234d
changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents:
2093
diff
changeset
|
799 |
! |
c952a3ae234d
changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents:
2093
diff
changeset
|
800 |
|
2368 | 801 |
version_SVN |
3275
e525d31c2a9b
class: ClassDefinitionChange
Claus Gittinger <cg@exept.de>
parents:
3270
diff
changeset
|
802 |
^ '$Id: ClassDefinitionChange.st,v 1.84 2013-05-15 15:58:10 cg Exp $' |
100 | 803 |
! ! |
3111 | 804 |