SyntaxHighlighter.st
author Claus Gittinger <cg@exept.de>
Tue, 08 Aug 2006 23:38:47 +0200
changeset 1802 e0b32dc71dac
parent 1757 c1edf49e8f9f
child 1857 4d7e1edb44cd
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
1110
3e08a12956fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    15
"{ Package: 'stx:libcomp' }"
3e08a12956fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    16
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
Parser subclass:#SyntaxHighlighter
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
    18
	instanceVariableNames:'sourceText preferences currentSuperclasses currentSubclasses
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
    19
		fullSelectorCheck cachedLocalIdentifierEmphasis
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
    20
		cachedLocalIdentifierColor cachedStringEmphasis cachedStringColor'
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	classVariableNames:''
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	poolDictionaries:''
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	category:'System-Compiler'
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!SyntaxHighlighter class methodsFor:'documentation'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
copyright
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 COPYRIGHT (c) 1998 by eXept Software AG
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
              All Rights Reserved
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 This software is furnished under a license and may be used
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 only in accordance with the terms of that license and with the
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 be provided or otherwise made available to, or used by, any
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 other person.  No title to or ownership of the software is
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 hereby transferred.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
681
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    42
!
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    43
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    44
documentation
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    45
"
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    46
    colors a method.
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    47
"
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    48
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    49
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
!SyntaxHighlighter class methodsFor:'highlighting'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
1527
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    54
formatClassDefinition:aString in:aClass
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    55
    "format (recolor) a class definition expression in a given class.
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    56
     Return the text containing font changes and color information."
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    57
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    58
    ^ self formatExpression:aString in:aClass
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    59
!
7ab05c80445b *** empty log message ***
ca
parents: 1526
diff changeset
    60
684
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    61
formatExpression:aString in:aClass
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    62
    "format (recolor) an expression in a given class.
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    63
     Return the text containing font changes and color information."
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    64
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    65
    |parser tree text endPos|
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    66
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    67
    aString isNil ifTrue:[^ nil].
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    68
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    69
    parser := self for:(ReadStream on:aString string) in:aClass.
1365
19b74038d133 ignoreErrors / ignoreWarnings are not getters.
penk
parents: 1308
diff changeset
    70
    parser ignoreErrors:true.
19b74038d133 ignoreErrors / ignoreWarnings are not getters.
penk
parents: 1308
diff changeset
    71
    parser ignoreWarnings:true.
684
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    72
    parser sourceText:(text := aString string asText).
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    73
    "/ use an array here - this can be changed much faster using #at:put:
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    74
    text emphasisCollection:(Array new:aString size).
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    75
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    76
    parser nextToken.
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    77
    tree := parser expression.
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    78
    "/ now, convert the emphasis-array to a runArray
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    79
    text emphasisCollection:(text emphasis asRunArray).
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    80
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    81
    tree == #Error ifTrue:[
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    82
        "/ mhmh - which is better ...
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    83
        "/ alternative1: color rest after error in red
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    84
"/        text 
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    85
"/            emphasizeFrom:(parser sourceStream position) 
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    86
"/            to:text size 
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    87
"/            with:(#color->Color red).
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    88
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    89
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    90
        "/ alternative2: take original emphasis for rest
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    91
1371
de4c37ac12fc code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 1365
diff changeset
    92
        endPos := parser sourceStream position1Based.
684
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    93
        endPos >= text size ifTrue:[
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    94
            ^ text
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    95
        ].
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    96
        ^ (text copyTo:endPos) , (aString copyFrom:(endPos+1))
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    97
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    98
        "/ alternative3: no emphasis for rest.
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
    99
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   100
"/        ^ text "/ aString
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   101
    ].
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   102
    ^ text
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   103
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   104
    "
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   105
     self
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   106
        formatExpression:'(1 + 2) max:5' 
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   107
        in:UndefinedObject
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   108
    "
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   109
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   110
    "Modified: / 7.4.1998 / 09:57:19 / cg"
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   111
    "Created: / 9.4.1998 / 16:57:16 / cg"
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   112
!
dd691ac07f90 added entry to color an expression
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   113
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
formatMethod:aString in:aClass
680
ebc432c71aec much faster (due to runArray changes.
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   115
    "format (recolor) a method in a given class.
ebc432c71aec much faster (due to runArray changes.
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   116
     Return the text containing font changes and color information."
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   118
    ^ self formatMethod:aString in:aClass using:nil
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   119
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   120
    "
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   121
     self
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   122
        formatMethod:'foo 
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   123
    ^ self bar:''hello''.
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   124
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   125
    ' , (Character doubleQuote asString) , 'some comment' , (Character doubleQuote asString) , '
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   126
'
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   127
        in:UndefinedObject
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   128
    "
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   129
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   130
    "Modified: / 23.10.1998 / 22:48:45 / cg"
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   131
!
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   132
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   133
formatMethod:aString in:aClass using:preferencesOrNil
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   134
    "format (recolor) a method in a given class.
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   135
     Return the text containing font changes and color information."
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   136
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   137
    |highlighter tree text endPos eColor|
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    aString isNil ifTrue:[^ nil].
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
1110
3e08a12956fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
   141
    Error handle:[:ex |
1396
5306bf9b9174 #errorSignal -> #description
Stefan Vogel <sv@exept.de>
parents: 1371
diff changeset
   142
        ('SyntaxHighlighter [info]: error during highlight: ' , ex description) infoPrintCR.
1170
b693bfbf8598 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   143
        "/ ex suspendedContext fullPrintAll.
689
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   144
        ^ aString
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   145
    ] do:[
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   146
        highlighter := self for:(ReadStream on:aString string) in:aClass.
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   147
        preferencesOrNil notNil ifTrue:[highlighter preferences:preferencesOrNil].
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   148
        highlighter ignoreErrors:true.
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   149
        highlighter ignoreWarnings:true.
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   150
        highlighter sourceText:(text := aString string asText).
689
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   151
        "/ use an array here - this can be changed much faster using #at:put:
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   152
        text emphasisCollection:(Array new:aString size).
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   154
        tree := highlighter parseMethod.
689
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   155
        "/ now, convert the emphasis-array to a runArray
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   156
        text emphasisCollection:(text emphasis asRunArray).
680
ebc432c71aec much faster (due to runArray changes.
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   157
689
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   158
        tree == #Error ifTrue:[
889
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   159
            eColor := UserPreferences current errorColor.
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   160
            eColor notNil ifTrue:[
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   161
                "/ mhmh - which is better ...
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   162
                "/ alternative1: color rest after error in red
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   163
                text 
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   164
                    emphasizeFrom:(highlighter sourceStream position1Based) 
889
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   165
                    to:text size 
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   166
                    with:(#color->eColor).
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   167
            ] ifFalse:[
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   168
                "/ alternative2: take original emphasis for rest
680
ebc432c71aec much faster (due to runArray changes.
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
   169
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   170
                endPos := highlighter sourceStream position1Based.
889
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   171
                endPos >= text size ifTrue:[
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   172
                    ^ text
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   173
                ].
554145ef6046 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 884
diff changeset
   174
                ^ (text copyTo:endPos) , (aString copyFrom:(endPos+1))
689
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   175
            ].
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   176
            "/ alternative3: no emphasis for rest.
678
da6c65951755 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   177
        ].
689
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   178
        ^ text
42a774852fed care for errors ...
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   179
    ]
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
     self
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
        formatMethod:'foo 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    ^ self bar:''hello''.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    ' , (Character doubleQuote asString) , 'some comment' , (Character doubleQuote asString) , '
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
'
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
        in:UndefinedObject
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    "
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
794
459868dcb591 highlight text after any error in red color.
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
   190
    "Modified: / 23.10.1998 / 22:48:45 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!SyntaxHighlighter methodsFor:'accessing'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   195
preferences:something
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   196
    preferences := something.
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   197
!
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   198
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
sourceText
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    "return the value of the instance variable 'sourceText' (automatically generated)"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    ^ sourceText
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    "Created: / 31.3.1998 / 11:49:05 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
sourceText:something
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    "set the value of the instance variable 'sourceText' (automatically generated)"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
    sourceText := something.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    "Created: / 31.3.1998 / 11:49:05 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   215
!SyntaxHighlighter methodsFor:'error handling'!
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   216
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   217
parseError:aMessage position:position to:endPos
1174
30ff886ef43e remove error output on Transcript
Claus Gittinger <cg@exept.de>
parents: 1170
diff changeset
   218
"/ Transcript showCR:aMessage.
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   219
    super parseError:aMessage position:position to:endPos.
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   220
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   221
    self 
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   222
        markFrom:position to:endPos 
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   223
        withEmphasis:nil color:UserPreferences current errorColor
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   224
!
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   225
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   226
showErrorMessage:aMessage position:pos
1174
30ff886ef43e remove error output on Transcript
Claus Gittinger <cg@exept.de>
parents: 1170
diff changeset
   227
"/ Transcript showCR:aMessage.
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   228
    super showErrorMessage:aMessage position:pos.
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   229
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   230
    self 
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   231
        markFrom:pos to:nil 
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   232
        withEmphasis:nil color:UserPreferences current errorColor
978
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   233
!
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   234
1169
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   235
syntaxError:aMessage position:position to:endPos
1174
30ff886ef43e remove error output on Transcript
Claus Gittinger <cg@exept.de>
parents: 1170
diff changeset
   236
"/ Transcript showCR:aMessage.
1169
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   237
    super syntaxError:aMessage position:position to:endPos.
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   238
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   239
    self 
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   240
        markFrom:position to:endPos 
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   241
        withEmphasis:nil color:UserPreferences current errorColor
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   242
!
7204e72c7c3c better error message with bad parentNesting in a block.
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   243
978
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   244
warning:msg position:pos1 to:pos2
979
2f20ef7dc8c0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   245
"/    self markUnknownIdentifierFrom:pos1 to:pos2
2f20ef7dc8c0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   246
978
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   247
"/    self
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   248
"/        markFrom:pos1 to:pos2 
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   249
"/        withEmphasis:nil color:UserPreferences current errorColor
9c62352be67b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
   250
979
2f20ef7dc8c0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   251
    "Modified: / 25.9.1999 / 18:42:30 / cg"
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   252
! !
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   253
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
!SyntaxHighlighter methodsFor:'initialization'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
initialize
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    super initialize.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
990
cd1aa00086fd dont care to fold constants during syntaxHighlight
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   259
    foldConstants := false.
1636
98afdcdacde8 compilerflags separated into ParserFlags.
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
   260
"/    parserFlags allowDollarInIdentifier:true.
990
cd1aa00086fd dont care to fold constants during syntaxHighlight
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
   261
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   262
    preferences := UserPreferences current.
868
f49c96b8c843 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   263
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   264
    fullSelectorCheck := preferences fullSelectorCheck.
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
    "Created: / 31.3.1998 / 15:12:55 / cg"
838
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   267
    "Modified: / 5.1.1980 / 00:44:03 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
788
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   270
!SyntaxHighlighter methodsFor:'misc'!
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   271
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   272
defineAsUndeclaredVariable:aName
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   273
    "redefined to NOT declare undefined vars"
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   274
1308
4a5853596d8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   275
    ^ VariableNode globalNamed:aName
788
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   276
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   277
    "Modified: / 19.10.1998 / 19:38:12 / cg"
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   278
!
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   279
884
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   280
isSyntaxHighlighter
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   281
    ^ true
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   282
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   283
!
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   284
788
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   285
plausibilityCheck:aNode
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   286
    "redefined to NOT do checks"
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   287
902
4ceee83e5e07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
   288
    ^ nil
788
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   289
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   290
    "Modified: / 19.10.1998 / 19:38:12 / cg"
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   291
    "Created: / 19.10.1998 / 19:57:18 / cg"
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   292
! !
5307f69829c6 do not enter undeclared vars into Undeclared.
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   293
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
!SyntaxHighlighter methodsFor:'syntax detection'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
markArgumentIdentifierFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   299
        withEmphasis:(preferences argumentIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   300
        color:(preferences argumentIdentifierColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    "Modified: / 31.3.1998 / 18:01:27 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
884
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   305
markBadIdentifierFrom:pos1 to:pos2
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   306
    self 
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   307
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   308
        withEmphasis:(preferences badIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   309
        color:(preferences badIdentifierColor)
884
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   310
!
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   311
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
markBooleanConstantFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   315
        withEmphasis:(preferences booleanConstantEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   316
        color:(preferences booleanConstantColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    "Created: / 31.3.1998 / 18:09:01 / cg"
665
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   319
    "Modified: / 31.3.1998 / 19:36:44 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
673
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   322
markBracketAt:pos
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   323
    self 
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   324
        markFrom:pos to:pos 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   325
        withEmphasis:(preferences bracketEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   326
        color:(preferences bracketColor)
673
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   327
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   328
    "Created: / 31.3.1998 / 18:09:01 / cg"
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   329
    "Modified: / 31.3.1998 / 19:36:44 / cg"
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   330
!
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   331
870
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   332
markClassVariableIdentifierFrom:pos1 to:pos2
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   333
    self 
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   334
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   335
        withEmphasis:(preferences classVariableIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   336
        color:(preferences classVariableIdentifierColor)
870
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   337
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   338
    "Modified: / 31.3.1998 / 18:02:14 / cg"
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   339
!
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   340
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
markCommentFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   344
        withEmphasis:(preferences commentEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   345
        color:(preferences commentColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
1550
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   347
    "
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   348
     UserPreferences current commentEmphasis
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   349
    "
aed158a284b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
   350
    "Modified: / 31.3.1998 / 18:01:55 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
markConstantFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   356
        withEmphasis:(preferences constantEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   357
        color:(preferences constantColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
    "Modified: / 31.3.1998 / 18:01:44 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
    "Created: / 31.3.1998 / 18:09:22 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
987
49a05e400448 aquire device colors - faster on pseudoColor devices.
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   363
markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
49a05e400448 aquire device colors - faster on pseudoColor devices.
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   364
    |e p2 clr|
49a05e400448 aquire device colors - faster on pseudoColor devices.
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   365
49a05e400448 aquire device colors - faster on pseudoColor devices.
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   366
    clr := clrIn onDevice:Screen current.
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
669
5ef61aacc5d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   368
    clr = Color black ifTrue:[
5ef61aacc5d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   369
        e := fontEmp
5ef61aacc5d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   370
    ] ifFalse:[
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   371
        fontEmp isNil ifTrue:[
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   372
            e := (#color->clr)
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   373
        ] ifFalse:[
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   374
            e := Text addEmphasis:fontEmp to:(#color->clr).
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   375
        ]
669
5ef61aacc5d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   376
    ].
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   377
    (p2 := pos2) isNil ifTrue:[
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   378
        p2 := sourceText size
1143
3a9ddfa26b16 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
   379
    ] ifFalse:[
3a9ddfa26b16 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
   380
        p2 := p2 min:sourceText size
948
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   381
    ].
6ba29fe774f2 show earliest possible error position.
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
   382
    sourceText emphasizeFrom:pos1 to:p2 with:e
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
    "Created: / 31.3.1998 / 13:26:53 / cg"
669
5ef61aacc5d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
   385
    "Modified: / 1.4.1998 / 12:51:56 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   388
markGlobalClassIdentifierFrom:pos1 to:pos2
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   389
    self 
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   390
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   391
        withEmphasis:(preferences globalClassIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   392
        color:(preferences globalClassIdentifierColor)
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   393
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   394
    "Modified: / 31.3.1998 / 18:02:14 / cg"
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   395
    "Created: / 4.3.1999 / 12:53:02 / cg"
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   396
!
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   397
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
markGlobalIdentifierFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   401
        withEmphasis:(preferences globalIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   402
        color:(preferences globalIdentifierColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
    "Modified: / 31.3.1998 / 18:02:14 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
markHereFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   410
        withEmphasis:(preferences hereEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   411
        color:(preferences hereColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
    "Modified: / 31.3.1998 / 18:02:25 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
markIdentifierFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   419
        withEmphasis:(preferences identifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   420
        color:(preferences identifierColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
    "Modified: / 31.3.1998 / 18:02:39 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
    "Created: / 31.3.1998 / 18:04:56 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   426
markInstVarIdentifierFrom:pos1 to:pos2
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   427
    self 
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   428
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   429
        withEmphasis:(preferences instVarIdentifierEmphasis)    
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   430
        color:(preferences instVarIdentifierColor)
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   431
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   432
    "Created: / 16.4.1998 / 18:35:40 / cg"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   433
    "Modified: / 16.4.1998 / 18:37:30 / cg"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   434
!
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   435
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
markLocalIdentifierFrom:pos1 to:pos2
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   437
    cachedLocalIdentifierEmphasis isNil ifTrue:[
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   438
        cachedLocalIdentifierEmphasis := preferences localIdentifierEmphasis.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   439
        cachedLocalIdentifierColor := preferences localIdentifierColor.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   440
    ].
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
        markFrom:pos1 to:pos2 
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   443
        withEmphasis:cachedLocalIdentifierEmphasis 
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   444
        color:cachedLocalIdentifierColor
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
    "Modified: / 31.3.1998 / 18:02:39 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
markMethodSelectorFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   452
        withEmphasis:(preferences methodSelectorEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   453
        color:(preferences methodSelectorColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
    "Modified: / 31.3.1998 / 18:02:52 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
1684
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   458
markNumberConstantFrom:pos1 to:pos2
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   459
    self 
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   460
        markFrom:pos1 to:pos2 
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   461
        withEmphasis:(preferences numberConstantEmphasis) 
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   462
        color:(preferences numberConstantColor)
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   463
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   464
    "Modified: / 31.3.1998 / 18:01:44 / cg"
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   465
    "Created: / 31.3.1998 / 18:09:22 / cg"
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   466
!
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   467
1640
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   468
markParenthesisAt:pos
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   469
    |colors clr em|
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   470
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   471
    preferences emphasizeParenthesisLevel ifFalse:[^ self].
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   472
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   473
    colors := Array 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   474
                with:(Color black)
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   475
                with:(Color blue)
1757
c1edf49e8f9f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1684
diff changeset
   476
                with:(Color green blendWith:(Color grey:30))
c1edf49e8f9f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1684
diff changeset
   477
                with:(Color red blendWith:(Color grey:30))
1640
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   478
                with:(Color yellow darkened).
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   479
                        
1757
c1edf49e8f9f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1684
diff changeset
   480
    clr := colors at:((parenthesisLevel-1) \\ colors size + 1).
1640
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   481
    em := #normal.
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   482
    parenthesisLevel > 1 ifTrue:[
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   483
        em := #bold.
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   484
    ].
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   485
    self 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   486
        markFrom:pos to:pos 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   487
        withEmphasis:em 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   488
        color:clr
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   489
!
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   490
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   491
markPoolVariableIdentifierFrom:pos1 to:pos2
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   492
    self 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   493
        markFrom:pos1 to:pos2 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   494
        withEmphasis:(preferences poolVariableIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   495
        color:(preferences poolVariableIdentifierColor)
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   496
!
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   497
838
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   498
markReturnAt:pos
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   499
    self 
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   500
        markFrom:pos to:pos 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   501
        withEmphasis:(preferences returnEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   502
        color:(preferences returnColor)
838
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   503
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   504
    "Modified: / 31.3.1998 / 19:36:44 / cg"
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   505
    "Created: / 5.1.1980 / 00:44:27 / cg"
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   506
!
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   507
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   508
markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   509
    |fg selectorSymbol check ok rec em|
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   510
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   511
"/ uncommenting the code below
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   512
"/ will suppress highlighting of common selectors ...
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   513
"/
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   514
"/    (#(
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   515
"/        'ifTrue:' 
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   516
"/        'ifFalse:'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   517
"/        'not'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   518
"/        'and:'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   519
"/        'or:'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   520
"/        '='
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   521
"/        '=='
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   522
"/        '~='
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   523
"/        '~~'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   524
"/    ) includes:sel) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   525
"/        ^ self
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   526
"/    ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   527
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   528
    fg := preferences selectorColor.
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   529
    em := preferences selectorEmphasis.
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   530
    selectorSymbol := selectorString asSymbolIfInterned.
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   531
    selectorSymbol isNil ifTrue:[
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   532
        fg := Color red.
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   533
    ] ifFalse:[
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   534
        fullSelectorCheck == true ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   535
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   536
            check := [:cls | (cls includesSelector:selectorSymbol)
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   537
                             or:[cls class includesSelector:selectorSymbol]].
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   538
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   539
            ok := false.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   540
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   541
            "/ limit search if possible
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   542
            (classToCompileFor notNil
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   543
             and:[aReceiverNode isSelf or:[aReceiverNode isSuper]]) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   544
                currentSuperclasses isNil ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   545
                    currentSuperclasses := classToCompileFor withAllSuperclasses.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   546
                ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   547
                ok := currentSuperclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   548
                (ok not and:[aReceiverNode isSelf]) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   549
                    currentSubclasses isNil ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   550
                        currentSubclasses := classToCompileFor allSubclasses.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   551
                    ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   552
                    ok := currentSubclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   553
                ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   554
            ] ifFalse:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   555
                aReceiverNode isConstant ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   556
                    ok := aReceiverNode evaluate class withAllSuperclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   557
                ] ifFalse:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   558
                    (aReceiverNode isGlobal 
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   559
                    and:[(rec := aReceiverNode evaluate) isBehavior]) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   560
                        ok := rec class withAllSuperclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   561
                    ] ifFalse:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   562
                        ok := Smalltalk allClasses contains:check
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   563
                    ]
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   564
                ]
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   565
            ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   566
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   567
            ok ifFalse:[
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   568
                em := preferences unimplementedSelectorEmphasis.
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   569
                fg := preferences unimplementedSelectorColor.
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   570
            ]
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   571
        ]
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   572
    ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   573
    self
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   574
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   575
        withEmphasis:em 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   576
        color:fg
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   577
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   578
    "Modified: / 1.4.1998 / 13:14:43 / cg"
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   579
!
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   580
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
markSelfFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   584
        withEmphasis:(preferences selfEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   585
        color:(preferences selfColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
    "Modified: / 31.3.1998 / 18:03:10 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
markStringFrom:pos1 to:pos2
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   591
    cachedStringEmphasis isNil ifTrue:[
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   592
        cachedStringEmphasis := preferences stringEmphasis.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   593
        cachedStringColor := preferences stringColor.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   594
    ].
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
        markFrom:pos1 to:pos2 
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   597
        withEmphasis:cachedStringEmphasis 
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   598
        color:cachedStringColor
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
    "Modified: / 31.3.1998 / 18:03:18 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
markSuperFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   606
        withEmphasis:(preferences superEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   607
        color:(preferences superColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
    "Modified: / 31.3.1998 / 18:03:26 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
672
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   612
markSymbolFrom:pos1 to:pos2
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   613
    self 
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   614
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   615
        withEmphasis:(preferences symbolEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   616
        color:(preferences symbolColor)
672
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   617
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   618
    "Created: / 1.4.1998 / 12:56:47 / cg"
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   619
    "Modified: / 1.4.1998 / 12:58:00 / cg"
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   620
!
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   621
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
markThisContextFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   625
        withEmphasis:(preferences thisContextEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   626
        color:(preferences thisContextColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
    "Modified: / 31.3.1998 / 18:03:36 / cg"
665
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   629
!
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   630
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   631
markUnknownIdentifierFrom:pos1 to:pos2
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   632
    self 
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   633
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   634
        withEmphasis:(preferences unknownIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   635
        color:(preferences unknownIdentifierColor)
665
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   636
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   637
    "Created: / 31.3.1998 / 19:09:26 / cg"
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   638
    "Modified: / 31.3.1998 / 19:10:30 / cg"
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   639
!
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   640
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   641
markVariable:v
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   642
    "support for syntaxColoring"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   643
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   644
    |pos endPos|
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   645
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   646
    pos := tokenPosition.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   647
    endPos := pos+tokenName size-1.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   648
    self markVariable:v from:pos to:endPos
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   649
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   650
    "Modified: / 16.4.1998 / 18:49:51 / cg"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   651
!
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   652
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   653
markVariable:v from:pos to:endPos
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   654
    "support for syntaxColoring"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   655
823
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   656
    |type globalValue nameSym|
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   657
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   658
    type := v type.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   659
    (type == #BlockArg
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   660
    or:[type == #MethodArg]) ifTrue:[
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   661
        self markArgumentIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   662
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   663
    ].
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   664
    (type == #BlockVariable
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   665
    or:[type == #MethodVariable]) ifTrue:[
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   666
        self markLocalIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   667
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   668
    ].
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   669
    (type == #GlobalVariable) ifTrue:[
823
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   670
        nameSym := v name asSymbolIfInterned.
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   671
        nameSym notNil ifTrue:[
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   672
            globalValue := Smalltalk at:nameSym ifAbsent:nil.
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   673
        ].
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   674
        globalValue isBehavior ifTrue:[
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   675
            self markGlobalClassIdentifierFrom:pos to:endPos.
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   676
        ] ifFalse:[
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   677
            self markGlobalIdentifierFrom:pos to:endPos.
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   678
        ].
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   679
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   680
    ].
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   681
    (type == #PoolVariable) ifTrue:[
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   682
        self markPoolVariableIdentifierFrom:pos to:endPos.
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   683
        ^ self
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   684
    ].
870
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   685
    (type == #ClassVariable) ifTrue:[
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   686
        self markClassVariableIdentifierFrom:pos to:endPos.
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   687
        ^ self
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   688
    ].
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   689
    (type == #InstanceVariable) ifTrue:[
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   690
        self markInstVarIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   691
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   692
    ].
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   693
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   694
    self markIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   695
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   696
    "Created: / 16.4.1998 / 18:49:34 / cg"
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   697
    "Modified: / 4.3.1999 / 12:56:13 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   700
!SyntaxHighlighter class methodsFor:'documentation'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
version
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   703
    ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.52 2006-08-08 21:38:47 cg Exp $'
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   704
! !