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