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