TextCollectingCompilationErrorHandler.st
author Claus Gittinger <cg@exept.de>
Tue, 02 Nov 2010 13:01:10 +0100
changeset 2444 e6b39d346228
parent 2434 d4382efb6b9b
child 2446 6c2edf41aae9
permissions -rw-r--r--
changed: #correctableError:position:to:from: #correctableSelectorWarning:position:to:from:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2434
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2010 by Claus Gittinger
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libcomp' }"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
CompilationErrorHandler subclass:#TextCollectingCompilationErrorHandler
2444
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    15
	instanceVariableNames:'lines'
2434
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Compiler'
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!TextCollectingCompilationErrorHandler class methodsFor:'documentation'!
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2010 by Claus Gittinger
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
documentation
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    collects messages - for check before checking in
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
! !
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
!TextCollectingCompilationErrorHandler methodsFor:'error handling'!
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
error:aMessage position:position to:endPos from:aCompiler
2444
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    46
    (lines includes:aMessage) ifTrue:[^ self ].
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    47
    lines add:aMessage.
2434
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    myStream nextPutLine:(aMessage allBold colorizeAllWith:Color red darkened).
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "Created: / 02-11-2010 / 12:52:23 / cg"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
warning:aMessage position:position to:endPos from:aCompiler
2444
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    54
    (lines includes:aMessage) ifTrue:[^ self ].
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    55
    lines add:aMessage.
2434
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    myStream nextPutLine:aMessage.
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "Created: / 02-11-2010 / 12:51:30 / cg"
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
! !
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
2444
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    61
!TextCollectingCompilationErrorHandler methodsFor:'initialization'!
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    62
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    63
initialize
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    64
    lines := OrderedCollection new.
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    65
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    66
    "Created: / 02-11-2010 / 13:00:55 / cg"
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    67
! !
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    68
2434
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!TextCollectingCompilationErrorHandler class methodsFor:'documentation'!
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
version_CVS
2444
e6b39d346228 changed:
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    72
    ^ '$Header: /cvs/stx/stx/libcomp/TextCollectingCompilationErrorHandler.st,v 1.2 2010-11-02 12:01:10 cg Exp $'
2434
d4382efb6b9b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
! !