4317
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
2434
|
3 |
"
|
|
4 |
COPYRIGHT (c) 2010 by Claus Gittinger
|
|
5 |
All Rights Reserved
|
|
6 |
|
|
7 |
This software is furnished under a license and may be used
|
|
8 |
only in accordance with the terms of that license and with the
|
|
9 |
inclusion of the above copyright notice. This software may not
|
|
10 |
be provided or otherwise made available to, or used by, any
|
|
11 |
other person. No title to or ownership of the software is
|
|
12 |
hereby transferred.
|
|
13 |
"
|
|
14 |
"{ Package: 'stx:libcomp' }"
|
|
15 |
|
3863
|
16 |
"{ NameSpace: Smalltalk }"
|
|
17 |
|
2434
|
18 |
CompilationErrorHandler subclass:#TextCollectingCompilationErrorHandler
|
2446
|
19 |
instanceVariableNames:'lines collectWarnings'
|
2434
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'System-Compiler'
|
|
23 |
!
|
|
24 |
|
|
25 |
!TextCollectingCompilationErrorHandler class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 2010 by Claus Gittinger
|
|
30 |
All Rights Reserved
|
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
|
41 |
documentation
|
|
42 |
"
|
4317
|
43 |
collects messages - used eg. for check before checking in
|
2434
|
44 |
"
|
|
45 |
! !
|
|
46 |
|
2446
|
47 |
!TextCollectingCompilationErrorHandler methodsFor:'accessing'!
|
|
48 |
|
|
49 |
errorsOnly:aBoolean
|
|
50 |
collectWarnings := aBoolean not
|
|
51 |
|
|
52 |
"Created: / 02-11-2010 / 13:09:34 / cg"
|
|
53 |
! !
|
|
54 |
|
2434
|
55 |
!TextCollectingCompilationErrorHandler methodsFor:'error handling'!
|
|
56 |
|
|
57 |
error:aMessage position:position to:endPos from:aCompiler
|
2444
|
58 |
(lines includes:aMessage) ifTrue:[^ self ].
|
|
59 |
lines add:aMessage.
|
2454
|
60 |
|
|
61 |
myStream nextPutLine:('Error: [' ,
|
|
62 |
aCompiler classToCompileFor name
|
|
63 |
, '>>',
|
|
64 |
(aCompiler selector ? '???')
|
4393
|
65 |
, '] ' , (aMessage allBold withColor:Color darkRed)).
|
2434
|
66 |
|
|
67 |
"Created: / 02-11-2010 / 12:52:23 / cg"
|
2454
|
68 |
"Modified: / 03-11-2010 / 12:28:49 / cg"
|
4393
|
69 |
"Modified: / 13-03-2019 / 21:18:11 / Claus Gittinger"
|
2434
|
70 |
!
|
|
71 |
|
|
72 |
warning:aMessage position:position to:endPos from:aCompiler
|
2446
|
73 |
collectWarnings ifTrue:[
|
|
74 |
(lines includes:aMessage) ifTrue:[^ self ].
|
|
75 |
lines add:aMessage.
|
2454
|
76 |
|
|
77 |
myStream nextPutLine:('Warning: [' ,
|
|
78 |
aCompiler classToCompileFor name
|
|
79 |
, '>>',
|
|
80 |
(aCompiler selector ? '???')
|
|
81 |
, '] ' , aMessage).
|
2446
|
82 |
].
|
2434
|
83 |
|
|
84 |
"Created: / 02-11-2010 / 12:51:30 / cg"
|
2454
|
85 |
"Modified: / 03-11-2010 / 12:28:45 / cg"
|
2434
|
86 |
! !
|
|
87 |
|
2444
|
88 |
!TextCollectingCompilationErrorHandler methodsFor:'initialization'!
|
|
89 |
|
|
90 |
initialize
|
|
91 |
lines := OrderedCollection new.
|
2446
|
92 |
collectWarnings := true.
|
2444
|
93 |
|
|
94 |
"Created: / 02-11-2010 / 13:00:55 / cg"
|
|
95 |
! !
|
|
96 |
|
2434
|
97 |
!TextCollectingCompilationErrorHandler class methodsFor:'documentation'!
|
|
98 |
|
|
99 |
version_CVS
|
3863
|
100 |
^ '$Header$'
|
2434
|
101 |
! !
|
3863
|
102 |
|