author | Jan Vrany <jan.vrany@labware.com> |
Wed, 03 Feb 2021 11:52:30 +0000 | |
branch | jv |
changeset 25410 | c91ea94445d1 |
parent 23546 | 0bb5e8a11f90 |
permissions | -rw-r--r-- |
13406 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
23107 | 3 |
COPYRIGHT (c) 2009-2010 Jan Vrany |
13406 | 4 |
All Rights Reserved |
5 |
||
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
11962 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
17334
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
15 |
"{ NameSpace: Smalltalk }" |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
16 |
|
11962 | 17 |
Object subclass:#AbstractSourceFileWriter |
16879
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
18 |
instanceVariableNames:'generatingSourceForOriginal' |
11962 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
15419
a1da7568bcfe
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
14407
diff
changeset
|
21 |
category:'Kernel-Classes-Support' |
11962 | 22 |
! |
23 |
||
23546
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
24 |
Query subclass:#ClassSourceRewriteQuery |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
25 |
instanceVariableNames:'source klass' |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
26 |
classVariableNames:'' |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
27 |
poolDictionaries:'' |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
28 |
privateIn:AbstractSourceFileWriter |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
29 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
30 |
|
12041 | 31 |
Query subclass:#MethodSourceRewriteQuery |
23546
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
32 |
instanceVariableNames:'source method' |
12041 | 33 |
classVariableNames:'' |
34 |
poolDictionaries:'' |
|
35 |
privateIn:AbstractSourceFileWriter |
|
36 |
! |
|
37 |
||
13406 | 38 |
!AbstractSourceFileWriter class methodsFor:'documentation'! |
39 |
||
40 |
copyright |
|
41 |
" |
|
42 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
23107 | 43 |
COPYRIGHT (c) 2009-2010 Jan Vrany |
13406 | 44 |
All Rights Reserved |
45 |
||
46 |
This software is furnished under a license and may be used |
|
47 |
only in accordance with the terms of that license and with the |
|
48 |
inclusion of the above copyright notice. This software may not |
|
49 |
be provided or otherwise made available to, or used by, any |
|
50 |
other person. No title to or ownership of the software is |
|
51 |
hereby transferred. |
|
52 |
" |
|
14407 | 53 |
! |
54 |
||
55 |
documentation |
|
56 |
" |
|
57 |
Abstract common superclass for source file writers |
|
58 |
" |
|
13406 | 59 |
! ! |
12041 | 60 |
|
18913 | 61 |
!AbstractSourceFileWriter class methodsFor:'queries'! |
62 |
||
63 |
isAbstract |
|
64 |
^ self == AbstractSourceFileWriter |
|
65 |
! ! |
|
66 |
||
12041 | 67 |
!AbstractSourceFileWriter class methodsFor:'signal constants'! |
11962 | 68 |
|
23546
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
69 |
classSourceRewriteQuery |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
70 |
" |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
71 |
Hook to allow for just-in-time rewriting of a class definition while filing out. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
72 |
This can be used (is used) by source code exporters that need to rewrite class |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
73 |
definitions on the fly. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
74 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
75 |
See for example BeeProjectWriter. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
76 |
" |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
77 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
78 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
79 |
^ ClassSourceRewriteQuery |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
80 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
81 |
"Created: / 24-10-2018 / 10:49:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
82 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
83 |
|
12041 | 84 |
methodSourceRewriteQuery |
85 |
"hook to allow for just-in-time rewriting of a method's sourceCode while filing out |
|
86 |
used when saving version_XXX methods in a non-XXX sourceCodeManager |
|
87 |
(i.e. to rewrite all non-CVS version methods while saving into a CVS repository) |
|
88 |
this is required because we cannot save an SVN version method (dollar-ID-...-dollar) into a |
|
89 |
CVS repository without loosing the original string with the next checkout, because it also gets |
|
90 |
expanded by CVS. The same is true vice-versa for CVS-Ids, which get clobbered by SVN. |
|
91 |
||
92 |
see SmalltalkChunkFileSourceWriter fileOutMethod:on:" |
|
93 |
||
94 |
^ MethodSourceRewriteQuery |
|
11962 | 95 |
! ! |
96 |
||
16879
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
97 |
!AbstractSourceFileWriter methodsFor:'accessing'! |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
98 |
|
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
99 |
generatingSourceForOriginal:aBoolean |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
100 |
"if false (the default), the source of the current (in image) code is generated. |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
101 |
That means, that any extension method which shadows some other original method, |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
102 |
that extension method's code is generated. |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
103 |
if true, the code of the original method is generated. |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
104 |
Use a true value, when generating code for a SCM checkin operation, as then we do not |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
105 |
want the extension to shadow the original" |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
106 |
|
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
107 |
generatingSourceForOriginal := aBoolean. |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
108 |
! ! |
2b94ea863dda
Moved #generatingSourceForOriginal: from SmalltalkChunkFileSourceWriter to
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15419
diff
changeset
|
109 |
|
11962 | 110 |
!AbstractSourceFileWriter methodsFor:'fileout'! |
111 |
||
112 |
fileOut:aClass on:outStreamArg |
|
113 |
||
114 |
self |
|
115 |
fileOut:aClass on:outStreamArg |
|
116 |
withTimeStamp:true withInitialize:true |
|
117 |
withDefinition:true |
|
118 |
methodFilter:nil encoder:nil |
|
119 |
||
120 |
"Created: / 15-08-2009 / 13:11:31 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
121 |
! ! |
|
122 |
||
123 |
!AbstractSourceFileWriter methodsFor:'source writing'! |
|
124 |
||
16881
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
125 |
fileOut: class on:stream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter:methodFilter |
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
126 |
|
17334
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
127 |
^ self |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
128 |
fileOut: class |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
129 |
on:stream |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
130 |
withTimeStamp: stampIt |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
131 |
withInitialize: initIt |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
132 |
withDefinition: withDefinition |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
133 |
methodFilter:methodFilter |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
134 |
encoder:nil |
16881
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
135 |
|
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
136 |
"Created: / 04-10-2014 / 12:10:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
137 |
! |
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
138 |
|
11962 | 139 |
fileOut: class on:stream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter:methodFilter encoder:encoderOrNil |
140 |
"raise an error: must be redefined in concrete subclass(es)" |
|
141 |
||
142 |
^ self subclassResponsibility |
|
143 |
||
144 |
"Modified: / 16-08-2009 / 09:59:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
13406 | 145 |
! |
146 |
||
147 |
fileOutMethods: methods on:stream |
|
148 |
||
149 |
"Files out a bunch of methods. This is used to file-out extension methods" |
|
150 |
||
151 |
self subclassResponsibility |
|
152 |
||
153 |
"Modified: / 16-08-2009 / 09:59:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
154 |
"Created: / 30-12-2009 / 18:34:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
155 |
! |
|
156 |
||
157 |
fileOutPackageDefinition:packageId on:stream |
|
158 |
"Files out a package definition on the stream, so all subsequent |
|
159 |
code entities will be placed in that package" |
|
160 |
||
161 |
self subclassResponsibility |
|
162 |
||
163 |
"Modified: / 16-08-2009 / 09:59:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
164 |
"Created: / 30-12-2009 / 18:34:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11962 | 165 |
! ! |
166 |
||
167 |
!AbstractSourceFileWriter methodsFor:'source writing - comments'! |
|
168 |
||
169 |
fileOutComment: aStringOrStringCollection on: aStream |
|
12109
1e360b1a1062
comment/format in: #fileOutComment:on:
Claus Gittinger <cg@exept.de>
parents:
12053
diff
changeset
|
170 |
"Writes a comment to a stream using proper syntax" |
11962 | 171 |
|
172 |
self fileOutCommentStartOn: aStream. |
|
173 |
aStringOrStringCollection isStringCollection |
|
17334
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
174 |
ifTrue:[ |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
175 |
aStringOrStringCollection |
11962 | 176 |
do:[:line|self fileOutCommentLine: line on: aStream] |
177 |
separatedBy: [aStream cr]] |
|
17334
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
178 |
ifFalse:[ |
5c901455163b
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
16881
diff
changeset
|
179 |
(aStringOrStringCollection includes: Character cr) |
11962 | 180 |
ifTrue:"/hmm...multiline comment as string |
181 |
[aStringOrStringCollection asStringCollection |
|
182 |
do:[:line|self fileOutCommentLine: line on: aStream] |
|
183 |
separatedBy: [aStream cr]] |
|
184 |
ifFalse: |
|
185 |
[self fileOutCommentLine: aStringOrStringCollection on: aStream]]. |
|
186 |
self fileOutCommentEndOn: aStream. |
|
187 |
||
188 |
"Created: / 21-08-2009 / 09:36:03 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
189 |
! |
|
190 |
||
191 |
fileOutCommentEndOn: aStream |
|
192 |
" |
|
193 |
Writes a comment end mark on aStream. |
|
194 |
" |
|
195 |
||
196 |
^self subclassResponsibility |
|
197 |
||
198 |
"Created: / 21-08-2009 / 09:40:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
199 |
! |
|
200 |
||
201 |
fileOutCommentLine: aString on: aStream |
|
202 |
||
203 |
" |
|
204 |
Writes a single line of comment on a comment to a stream. |
|
205 |
Should not put an cr to the stream!! |
|
206 |
" |
|
207 |
||
208 |
^self subclassResponsibility |
|
209 |
||
210 |
"Created: / 21-08-2009 / 09:42:23 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
211 |
! |
|
212 |
||
213 |
fileOutCommentStartOn: aStream |
|
214 |
" |
|
215 |
Writes a comment start mark on aStream. |
|
216 |
" |
|
217 |
||
218 |
^self subclassResponsibility |
|
219 |
||
220 |
"Created: / 21-08-2009 / 09:40:28 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
221 |
! ! |
|
222 |
||
23546
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
223 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
224 |
!AbstractSourceFileWriter::ClassSourceRewriteQuery methodsFor:'accessing'! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
225 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
226 |
klass |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
227 |
^ klass |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
228 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
229 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
230 |
klass:aClass |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
231 |
klass := aClass. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
232 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
233 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
234 |
klass:aClass source: aString |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
235 |
klass := aClass. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
236 |
source := aString. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
237 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
238 |
"Created: / 24-10-2018 / 11:10:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
239 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
240 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
241 |
source |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
242 |
^ source |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
243 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
244 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
245 |
source:aString |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
246 |
source := aString. |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
247 |
! ! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
248 |
|
12041 | 249 |
!AbstractSourceFileWriter::MethodSourceRewriteQuery class methodsFor:'documentation'! |
250 |
||
251 |
documentation |
|
252 |
" |
|
253 |
hook to allow for just-in-time rewriting of a method's sourceCode while filing out |
|
254 |
used when saving version_XXX methods in a non-XXX sourceCodeManager |
|
255 |
(i.e. to rewrite all non-CVS version methods while saving into a CVS repository) |
|
256 |
this is required because we cannot save an SVN version method (dollar-ID-...-dollar) into a |
|
257 |
CVS repository without loosing the original string with the next checkout, because it also gets |
|
258 |
expanded by CVS. The same is true vice-versa for CVS-Ids, which get clobbered by SVN. |
|
259 |
||
260 |
see SmalltalkChunkFileSourceWriter fileOutMethod:on: |
|
261 |
" |
|
262 |
! ! |
|
263 |
||
264 |
!AbstractSourceFileWriter::MethodSourceRewriteQuery methodsFor:'accessing'! |
|
265 |
||
266 |
method |
|
267 |
^ method |
|
268 |
! |
|
269 |
||
270 |
method:methodArg source:sourceArg |
|
271 |
method := methodArg. |
|
272 |
source := sourceArg. |
|
273 |
! |
|
274 |
||
275 |
source |
|
276 |
^ source |
|
277 |
! ! |
|
278 |
||
11962 | 279 |
!AbstractSourceFileWriter class methodsFor:'documentation'! |
280 |
||
16881
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
281 |
version |
18913 | 282 |
^ '$Header$' |
16881
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
283 |
! |
0971640d795b
Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16879
diff
changeset
|
284 |
|
12041 | 285 |
version_CVS |
18913 | 286 |
^ '$Header$' |
12041 | 287 |
! |
288 |
||
23546
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
289 |
version_HG |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
290 |
|
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
291 |
^ '$Changeset: <not expanded> $' |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
292 |
! |
0bb5e8a11f90
Add "hook query" tp allow for on-the-fly rewriting of class definitions while filing out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23107
diff
changeset
|
293 |
|
12041 | 294 |
version_SVN |
15419
a1da7568bcfe
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
14407
diff
changeset
|
295 |
^ '$ Id: AbstractSourceFileWriter.st 10643 2011-06-08 21:53:07Z vranyj1 $' |
11962 | 296 |
! ! |
15419
a1da7568bcfe
class: AbstractSourceFileWriter
Claus Gittinger <cg@exept.de>
parents:
14407
diff
changeset
|
297 |