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