author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 21 Mar 2012 01:53:44 +0000 | |
branch | jv |
changeset 3034 | c892671f3e2a |
parent 3033 | 8964521a2c1b |
child 3035 | f70ea244c227 |
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 |
86 |
||
87 |
| class | |
|
88 |
class := self changeClass. |
|
89 |
class ifNil:[^#+]. |
|
2504 | 90 |
^(self class isSource: self source sameSourceAs: class definitionWithoutPackage "definition") |
2368 | 91 |
ifTrue:[#=] |
92 |
ifFalse:[#~] |
|
2504 | 93 |
|
94 |
"Modified: / 31-08-2011 / 09:26:48 / cg" |
|
95 |
! |
|
96 |
||
97 |
deltaDetail |
|
98 |
"Returns a delta to the current state as a ChangeDelta object" |
|
99 |
||
2690 | 100 |
| class mySource imageSource myTree imageTree same | |
2504 | 101 |
|
102 |
class := self changeClass. |
|
103 |
class isNil ifTrue:[^ ChangeDeltaInformation added ]. |
|
2753 | 104 |
class isLoaded ifFalse:[^ ChangeDeltaInformation different ]. |
2504 | 105 |
mySource := self source. |
106 |
imageSource := class definitionWithoutPackage "definition". |
|
2690 | 107 |
same := (mySource = imageSource). |
108 |
same ifFalse:[ |
|
109 |
same := (self class isSource: mySource sameSourceAs: imageSource ). |
|
110 |
same ifFalse:[ |
|
111 |
"/ care for formatting (tabs, indentation etc.) |
|
112 |
myTree := RBParser parseExpression:mySource. |
|
113 |
imageTree := RBParser parseExpression:imageSource. |
|
114 |
same := (myTree = imageTree). |
|
115 |
same ifFalse:[ |
|
116 |
"/ some classDefinition strings contain sn |
|
117 |
"/ instVarName string like 'foo bar ' instead of 'foo bar' (i.e. added a space)... |
|
118 |
((myTree receiver = imageTree receiver) |
|
119 |
and:[ (myTree selector = imageTree selector) |
|
120 |
and:[ ('*ubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' match: myTree selector) |
|
121 |
and:[ (myTree arguments at:1) = (imageTree arguments at:1) |
|
122 |
||
123 |
and:[ (2 to:5) conform:[:i | |
|
124 |
((myTree arguments at:i) isLiteral |
|
125 |
and:[ (imageTree arguments at:i) isLiteral |
|
126 |
and:[ (myTree arguments at:i) value asString withoutSeparators |
|
127 |
= (imageTree arguments at:i) value asString withoutSeparators ]]) ] |
|
128 |
||
129 |
]]]]) |
|
130 |
ifTrue:[ |
|
131 |
same := true |
|
132 |
] |
|
133 |
]. |
|
134 |
] |
|
135 |
]. |
|
136 |
||
137 |
^ same |
|
2504 | 138 |
ifTrue:[ ChangeDeltaInformation identical ] |
139 |
ifFalse:[ ChangeDeltaInformation different ] |
|
140 |
||
141 |
"Created: / 31-08-2011 / 10:26:42 / cg" |
|
2753 | 142 |
"Modified: / 24-01-2012 / 22:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2368 | 143 |
! |
144 |
||
1427 | 145 |
instanceVariableNames |
146 |
^ instanceVariableNames |
|
147 |
! |
|
148 |
||
149 |
instanceVariableNames:something |
|
150 |
instanceVariableNames := something. |
|
151 |
! |
|
152 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
153 |
nameSpaceName |
1318 | 154 |
objectType == #variable ifTrue:[ |
155 |
^ nil |
|
156 |
]. |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
157 |
^ 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
|
158 |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
159 |
"Modified: / 07-09-2011 / 20:47:14 / cg" |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
160 |
! |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
161 |
|
1196 | 162 |
nameSpaceName: aNameSpaceName classType: aClassType otherParameters:otherParametersArg |
1854 | 163 |
"this instance setup message is used when reading from a VW-xml change file. |
164 |
Support for this is not yet complete." |
|
165 |
||
166 |
|indexedType imports| |
|
1196 | 167 |
|
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
168 |
nameSpaceOverride := aNameSpaceName. |
911 | 169 |
classType := aClassType. |
1196 | 170 |
otherParameters := Dictionary new addAll:otherParametersArg; yourself. |
171 |
||
172 |
superClassName := otherParameters at:#superclass: ifAbsent:nil. |
|
173 |
superClassName notNil ifTrue:[ |
|
174 |
superClassName := superClassName pathString. |
|
175 |
]. |
|
176 |
indexedType := otherParameters at:#indexedType: ifAbsent:nil. |
|
177 |
private := otherParameters at:#private: ifAbsent:nil. |
|
178 |
instanceVariableNames := otherParameters at:#instanceVariableNames: ifAbsent:nil. |
|
179 |
classInstanceVariableNames := otherParameters at:#classInstanceVariableNames: ifAbsent:nil. |
|
180 |
imports := otherParameters at:#imports: ifAbsent:nil. |
|
181 |
category := otherParameters at:#category: ifAbsent:nil. |
|
1854 | 182 |
|
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
183 |
"Modified: / 15-06-2010 / 14:50:35 / cg" |
911 | 184 |
! |
185 |
||
186 |
objectType |
|
187 |
"return the value of the instance variable 'objectType' (automatically generated)" |
|
188 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
189 |
^ objectType |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
190 |
! |
911 | 191 |
|
192 |
objectType:something |
|
193 |
"set the value of the instance variable 'objectType' (automatically generated)" |
|
194 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
195 |
objectType := something. |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
196 |
! |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
197 |
|
1427 | 198 |
poolDictionaries |
199 |
^ poolDictionaries |
|
200 |
! |
|
201 |
||
202 |
poolDictionaries:something |
|
203 |
poolDictionaries := something. |
|
204 |
! |
|
205 |
||
2289 | 206 |
private:aBoolean |
207 |
private := aBoolean. |
|
208 |
||
209 |
"Created: / 30-08-2010 / 13:56:11 / cg" |
|
210 |
! |
|
211 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
212 |
source |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
213 |
"return the source of the change" |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
214 |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
215 |
|src ns| |
1196 | 216 |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
217 |
(src := source) isNil ifTrue:[ |
1196 | 218 |
src := self definitionString |
219 |
]. |
|
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
220 |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
221 |
(ns := self nameSpaceOverride) notNil ifTrue:[ |
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
222 |
(className startsWith:(ns,'::')) ifFalse:[ |
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
223 |
^ '"{ NameSpace: ' , ns , ' }"' , |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
224 |
Character cr, Character cr , |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
225 |
src string |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
226 |
]. |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
227 |
]. |
1196 | 228 |
^ src |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
229 |
|
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
230 |
"Modified: / 07-09-2011 / 20:46:13 / cg" |
1196 | 231 |
! |
232 |
||
233 |
superClassName |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
234 |
|nm| |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
235 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
236 |
nm := superClassName. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
237 |
nm notNil ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
238 |
(nm includes:$.) ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
239 |
^ nm copyReplaceAll:$. withAll:'::'. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
240 |
] |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
241 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
242 |
^ nm |
1427 | 243 |
! |
244 |
||
245 |
superClassName:something |
|
246 |
superClassName := something. |
|
2207 | 247 |
self invalidateSource. |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
248 |
! |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
249 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
250 |
superClassNameWithoutMyNamespace |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
251 |
|nm| |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
252 |
|
1956 | 253 |
superClassName isNil ifTrue:[^ 'nil']. |
254 |
||
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
255 |
nm := self cutMyNameSpaceOf:superClassName. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
256 |
(nm includes:$.) ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
257 |
^ nm copyReplaceAll:$. withAll:'::'. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
258 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
259 |
^ nm |
1956 | 260 |
|
261 |
"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
|
262 |
! |
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 |
superClassNameWithoutNamespace |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
265 |
|nm| |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
266 |
|
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
267 |
nm := self cutNameSpaceOf:superClassName. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
268 |
(nm includes:$.) ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
269 |
^ nm copyReplaceAll:$. withAll:'::'. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
270 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
271 |
^ nm |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
272 |
! ! |
911 | 273 |
|
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
274 |
!ClassDefinitionChange methodsFor:'applying'! |
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
275 |
|
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
276 |
apply |
2425 | 277 |
superClassName isNil ifTrue:[ |
278 |
self setupFromSource |
|
279 |
]. |
|
280 |
superClassName isNil ifTrue:[ |
|
281 |
self error:'Should not happen' |
|
282 |
]. |
|
283 |
(Smalltalk classNamed:superClassName) isNil ifTrue:[ |
|
284 |
Class undeclared:superClassName |
|
285 |
]. |
|
2554 | 286 |
Parser evaluate:(self source). |
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
287 |
package notNil ifTrue:[ |
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
288 |
self changeClass setPackage:package. |
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
289 |
]. |
2368 | 290 |
|
291 |
" |
|
2425 | 292 |
(ClassDefinitionChange className: #TestB source: 'TestA subclass: #TestB |
293 |
instanceVariableNames:'''' |
|
294 |
classVariableNames:'''' |
|
295 |
poolDictionaries:'''' |
|
296 |
category:''* remove me *''') |
|
297 |
apply |
|
2368 | 298 |
" |
299 |
||
300 |
"Modified: / 08-11-2010 / 16:10:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2554 | 301 |
"Modified: / 06-10-2011 / 17:01:58 / cg" |
1998
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
302 |
! ! |
06004ad8a6e4
changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents:
1956
diff
changeset
|
303 |
|
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
304 |
!ClassDefinitionChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
305 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
306 |
isForSameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
307 |
"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
|
308 |
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
|
309 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
310 |
changeB isClassDefinitionChange ifFalse:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
311 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
312 |
className ~= changeB className ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
313 |
^ true |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
314 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
315 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
316 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
317 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
318 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
319 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
320 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
321 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
322 |
"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
|
323 |
|
798 | 324 |
(self isForSameAs:changeB) ifFalse:[^ false]. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
325 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
326 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
327 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
328 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
329 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
772
diff
changeset
|
330 |
|
2410 | 331 |
!ClassDefinitionChange methodsFor:'converting'! |
332 |
||
333 |
asAntiChange |
|
334 |
||
335 |
^ClassRemoveChange className: self className |
|
336 |
||
337 |
"Created: / 02-11-2009 / 11:11:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
338 |
! ! |
|
339 |
||
962 | 340 |
!ClassDefinitionChange methodsFor:'printing & storing'! |
787 | 341 |
|
1196 | 342 |
definitionString |
2554 | 343 |
|ns classNameUsed superClassNameUsed| |
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
344 |
|
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
345 |
ns := self nameSpaceOverride. |
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
346 |
|
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
347 |
objectType == #variable ifTrue:[ |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
348 |
^ String streamContents:[:stream | |
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
349 |
ns notNil ifTrue:[ |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
350 |
stream |
2515
39059cf824a8
handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents:
2504
diff
changeset
|
351 |
nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
352 |
] ifFalse:[ |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
353 |
self halt:'can this happen ?'. |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
354 |
stream |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
355 |
nextPutAll:'Smalltalk' |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
356 |
]. |
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
357 |
|
1196 | 358 |
stream |
359 |
nextPutAll:' addClassVarName:'; |
|
1318 | 360 |
nextPutAll:className asString storeString |
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
361 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
362 |
]. |
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
363 |
|
2554 | 364 |
superClassNameUsed := self superClassName. |
365 |
classNameUsed := self className. |
|
366 |
||
1473
a8fe22600414
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1434
diff
changeset
|
367 |
^ String streamContents:[:stream | |
3031
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
368 |
self isPrivateClassDefinitionChange ifFalse:[ |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
369 |
stream |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
370 |
nextPutAll:superClassNameUsed; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
371 |
nextPutAll:' subclass:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
372 |
nextPutAll: classNameUsed asSymbol storeString |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
373 |
; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
374 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
375 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
376 |
nextPutAll:'instanceVariableNames:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
377 |
nextPutAll:(instanceVariableNames ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
378 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
379 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
380 |
nextPutAll:'classVariableNames:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
381 |
nextPutAll:(classVariableNames ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
382 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
383 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
384 |
nextPutAll:'poolDictionaries:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
385 |
nextPutAll:(poolDictionaries ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
386 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
387 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
388 |
nextPutAll:'category:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
389 |
nextPutAll:(category ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
390 |
cr |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
391 |
] ifTrue:[ |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
392 |
stream |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
393 |
nextPutAll:superClassNameUsed; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
394 |
nextPutAll:' subclass:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
395 |
nextPutAll: (classNameUsed copyFrom: owningClassName size + 3) asSymbol storeString |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
396 |
; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
397 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
398 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
399 |
nextPutAll:'instanceVariableNames:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
400 |
nextPutAll:(instanceVariableNames ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
401 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
402 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
403 |
nextPutAll:'classVariableNames:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
404 |
nextPutAll:(classVariableNames ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
405 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
406 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
407 |
nextPutAll:'poolDictionaries:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
408 |
nextPutAll:(poolDictionaries ? '') storeString; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
409 |
cr; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
410 |
tab; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
411 |
nextPutAll:'privateIn:'; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
412 |
nextPutAll:owningClassName; |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
413 |
cr |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
414 |
] |
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
415 |
] |
2280
c93519e114c9
fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents:
2207
diff
changeset
|
416 |
|
2554 | 417 |
"Modified: / 06-10-2011 / 17:02:05 / cg" |
3031
66f3216e3ea5
Fixes to fileout changeset in St/X class source format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
418 |
"Modified: / 19-03-2012 / 19:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1196 | 419 |
! |
420 |
||
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
421 |
definitionStringInNamespace: ns |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
422 |
| classNameUsed superClassNameUsed | |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
423 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
424 |
objectType == #variable ifTrue:[ |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
425 |
^ String streamContents:[:stream | |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
426 |
ns notNil ifTrue:[ |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
427 |
stream |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
428 |
nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
429 |
] ifFalse:[ |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
430 |
self halt:'can this happen ?'. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
431 |
stream |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
432 |
nextPutAll:'Smalltalk' |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
433 |
]. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
434 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
435 |
stream |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
436 |
nextPutAll:' addClassVarName:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
437 |
nextPutAll:className asString storeString |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
438 |
]. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
439 |
]. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
440 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
441 |
superClassNameUsed := self superClassName. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
442 |
classNameUsed := self classNameWithoutNamespace. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
443 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
444 |
^ String streamContents:[:stream | |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
445 |
self isPrivateClassDefinitionChange ifFalse:[ |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
446 |
stream |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
447 |
nextPutAll:superClassNameUsed; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
448 |
nextPutAll:' subclass:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
449 |
nextPutAll: classNameUsed asSymbol storeString |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
450 |
; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
451 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
452 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
453 |
nextPutAll:'instanceVariableNames:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
454 |
nextPutAll:(instanceVariableNames ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
455 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
456 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
457 |
nextPutAll:'classVariableNames:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
458 |
nextPutAll:(classVariableNames ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
459 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
460 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
461 |
nextPutAll:'poolDictionaries:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
462 |
nextPutAll:(poolDictionaries ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
463 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
464 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
465 |
nextPutAll:'category:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
466 |
nextPutAll:(category ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
467 |
cr |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
468 |
] ifTrue:[ |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
469 |
stream |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
470 |
nextPutAll:superClassNameUsed; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
471 |
nextPutAll:' subclass:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
472 |
nextPutAll: (self className copyFrom: owningClassName size + 3) asSymbol storeString |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
473 |
; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
474 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
475 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
476 |
nextPutAll:'instanceVariableNames:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
477 |
nextPutAll:(instanceVariableNames ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
478 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
479 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
480 |
nextPutAll:'classVariableNames:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
481 |
nextPutAll:(classVariableNames ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
482 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
483 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
484 |
nextPutAll:'poolDictionaries:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
485 |
nextPutAll:(poolDictionaries ? '') storeString; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
486 |
cr; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
487 |
tab; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
488 |
nextPutAll:'privateIn:'; |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
489 |
nextPutAll: |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
490 |
(ns isNil |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
491 |
ifTrue:[owningClassName] |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
492 |
ifFalse:[owningClassName copyFrom: ns size + 3]); |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
493 |
cr |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
494 |
] |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
495 |
] |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
496 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
497 |
"Modified: / 06-10-2011 / 17:02:05 / cg" |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
498 |
"Created: / 20-03-2012 / 19:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
499 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
500 |
|
3033 | 501 |
definitionStringWithoutNamespace |
502 |
|ns classNameUsed superClassNameUsed| |
|
503 |
||
504 |
ns := self nameSpaceOverride. |
|
505 |
||
506 |
objectType == #variable ifTrue:[ |
|
507 |
^ String streamContents:[:stream | |
|
508 |
ns notNil ifTrue:[ |
|
509 |
stream |
|
510 |
nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
|
511 |
] ifFalse:[ |
|
512 |
self halt:'can this happen ?'. |
|
513 |
stream |
|
514 |
nextPutAll:'Smalltalk' |
|
515 |
]. |
|
516 |
||
517 |
stream |
|
518 |
nextPutAll:' addClassVarName:'; |
|
519 |
nextPutAll:className asString storeString |
|
520 |
]. |
|
521 |
]. |
|
522 |
||
523 |
superClassNameUsed := self superClassName. |
|
524 |
classNameUsed := self classNameWithoutNamespace. |
|
525 |
||
526 |
^ String streamContents:[:stream | |
|
527 |
self isPrivateClassDefinitionChange ifFalse:[ |
|
528 |
stream |
|
529 |
nextPutAll:superClassNameUsed; |
|
530 |
nextPutAll:' subclass:'; |
|
531 |
nextPutAll: classNameUsed asSymbol storeString |
|
532 |
; |
|
533 |
cr; |
|
534 |
tab; |
|
535 |
nextPutAll:'instanceVariableNames:'; |
|
536 |
nextPutAll:(instanceVariableNames ? '') storeString; |
|
537 |
cr; |
|
538 |
tab; |
|
539 |
nextPutAll:'classVariableNames:'; |
|
540 |
nextPutAll:(classVariableNames ? '') storeString; |
|
541 |
cr; |
|
542 |
tab; |
|
543 |
nextPutAll:'poolDictionaries:'; |
|
544 |
nextPutAll:(poolDictionaries ? '') storeString; |
|
545 |
cr; |
|
546 |
tab; |
|
547 |
nextPutAll:'category:'; |
|
548 |
nextPutAll:(category ? '') storeString; |
|
549 |
cr |
|
550 |
] ifTrue:[ |
|
551 |
stream |
|
552 |
nextPutAll:superClassNameUsed; |
|
553 |
nextPutAll:' subclass:'; |
|
554 |
nextPutAll: (self className copyFrom: owningClassName size + 3) asSymbol storeString |
|
555 |
; |
|
556 |
cr; |
|
557 |
tab; |
|
558 |
nextPutAll:'instanceVariableNames:'; |
|
559 |
nextPutAll:(instanceVariableNames ? '') storeString; |
|
560 |
cr; |
|
561 |
tab; |
|
562 |
nextPutAll:'classVariableNames:'; |
|
563 |
nextPutAll:(classVariableNames ? '') storeString; |
|
564 |
cr; |
|
565 |
tab; |
|
566 |
nextPutAll:'poolDictionaries:'; |
|
567 |
nextPutAll:(poolDictionaries ? '') storeString; |
|
568 |
cr; |
|
569 |
tab; |
|
570 |
nextPutAll:'privateIn:'; |
|
571 |
nextPutAll: |
|
572 |
((ns := self nameSpaceName) isNil |
|
573 |
ifTrue:[owningClassName] |
|
574 |
ifFalse:[owningClassName copyFrom: ns size + 3]); |
|
575 |
cr |
|
576 |
] |
|
577 |
] |
|
578 |
||
579 |
"Modified: / 06-10-2011 / 17:02:05 / cg" |
|
580 |
"Created: / 20-03-2012 / 16:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
581 |
! |
|
582 |
||
1101 | 583 |
printOn:aStream |
1866 | 584 |
aStream |
585 |
nextPutAll:className; nextPutAll:' {definition}' |
|
586 |
||
587 |
"Modified: / 12-10-2006 / 17:48:28 / cg" |
|
1101 | 588 |
! |
589 |
||
896 | 590 |
printWithoutClassNameOn:aStream |
787 | 591 |
aStream nextPutAll:('definition of ' , className) |
592 |
||
593 |
||
594 |
! ! |
|
595 |
||
772 | 596 |
!ClassDefinitionChange methodsFor:'queries'! |
597 |
||
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
598 |
definitionSelector |
1854 | 599 |
definitionSelector isNil ifTrue:[ |
600 |
self setupFromSource. |
|
601 |
]. |
|
602 |
^ definitionSelector |
|
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
603 |
|
1854 | 604 |
"Modified: / 11-10-2006 / 14:11:44 / cg" |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
605 |
! |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
606 |
|
772 | 607 |
isClassDefinitionChange |
608 |
^ true |
|
1854 | 609 |
! |
610 |
||
611 |
isPrivateClassDefinitionChange |
|
612 |
private isNil ifTrue:[ |
|
1904 | 613 |
(className includes:$:) ifFalse:[ |
614 |
"/ cannot be private |
|
615 |
private := false |
|
616 |
] ifTrue:[ |
|
1909
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
617 |
source isNil ifTrue:[^ false ]. |
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
618 |
(source includesString:'private') ifFalse:[ |
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
619 |
private := false. |
1904 | 620 |
] ifTrue:[ |
1916 | 621 |
"/ (self changeClass notNil |
622 |
"/ and:[self changeClass isLoaded not]) ifTrue:[ |
|
623 |
"/ "/ cannot be private |
|
624 |
"/ private := false |
|
625 |
"/ ] ifTrue:[ |
|
1909
ec92c9dabf66
care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
626 |
self setupFromSource. |
1916 | 627 |
"/ ]. |
1904 | 628 |
]. |
629 |
]. |
|
1854 | 630 |
]. |
631 |
^ private |
|
632 |
||
633 |
"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
|
634 |
"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
|
635 |
! |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
636 |
|
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
637 |
owningClassName |
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 |
|
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
678 |
clsName := self 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 |
719 |
"extract privacy, category and selector from the source" |
|
720 |
||
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
721 |
|parseTree idx| |
1854 | 722 |
|
723 |
source notNil ifTrue:[ |
|
724 |
parseTree := Parser parseExpression:source. |
|
1878 | 725 |
(parseTree notNil and:[parseTree isMessage]) ifFalse:[ |
1887 | 726 |
self error:'bad change source' mayProceed:true. |
727 |
^ self |
|
1854 | 728 |
]. |
729 |
||
730 |
definitionSelector := parseTree selector. |
|
731 |
||
732 |
private := (definitionSelector endsWith:':privateIn:'). |
|
1871
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
733 |
private ifTrue:[ |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
734 |
owningClassName := parseTree args last name. |
3daa5601c86e
+owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1866
diff
changeset
|
735 |
]. |
1854 | 736 |
|
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
737 |
#( instanceVariableNames: |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
738 |
classVariableNames: |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
739 |
poolDictionaries: |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
740 |
) do:[:kw| |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
741 |
idx := definitionSelector keywords indexOf:kw. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
742 |
idx ~~ 0 ifTrue:[ |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
743 |
self perform: kw with: (parseTree args at:idx) evaluate. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
744 |
]. |
1854 | 745 |
]. |
2368 | 746 |
|
747 |
superClassName := parseTree receiver name. |
|
1854 | 748 |
]. |
749 |
||
750 |
"Created: / 11-10-2006 / 14:10:02 / cg" |
|
1887 | 751 |
"Modified: / 26-10-2006 / 19:29:17 / cg" |
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
752 |
"Modified: / 21-03-2012 / 01:12:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1134
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
753 |
! ! |
915934e8aab8
care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents:
1101
diff
changeset
|
754 |
|
2614
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
755 |
!ClassDefinitionChange methodsFor:'visiting'! |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
756 |
|
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
757 |
acceptChangeVisitor:aVisitor |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
758 |
^ aVisitor visitClassDefinitionChange:self. |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
759 |
|
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
760 |
"Created: / 25-11-2011 / 17:13:13 / cg" |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
761 |
! ! |
7d342615bb66
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
762 |
|
100 | 763 |
!ClassDefinitionChange class methodsFor:'documentation'! |
764 |
||
2518 | 765 |
version |
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
766 |
^ '$Id: ClassDefinitionChange.st 1900 2012-03-21 01:53:44Z vranyj1 $' |
2518 | 767 |
! |
768 |
||
2368 | 769 |
version_CVS |
3011
1997ff6e7e55
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
770 |
^ '§Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.66 2012/01/24 22:17:07 vrany Exp §' |
2180
c952a3ae234d
changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents:
2093
diff
changeset
|
771 |
! |
c952a3ae234d
changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents:
2093
diff
changeset
|
772 |
|
2368 | 773 |
version_SVN |
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
774 |
^ '$Id: ClassDefinitionChange.st 1900 2012-03-21 01:53:44Z vranyj1 $' |
3012 | 775 |
! ! |