SyntaxHighlighter.st
author Claus Gittinger <cg@exept.de>
Sun, 24 May 2020 03:18:13 +0200
changeset 4670 4ec715f14ddd
parent 4668 ddbc1fbebe8e
child 4723 524785227024
permissions -rw-r--r--
#BUGFIX by cg class: Parser changed: #selectorCheck:for:positions:
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
"
1110
3e08a12956fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    12
"{ Package: 'stx:libcomp' }"
3e08a12956fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
    13
3560
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
    14
"{ NameSpace: Smalltalk }"
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
    15
2373
5705835046a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2289
diff changeset
    16
AbstractSyntaxHighlighter subclass:#SyntaxHighlighter
5705835046a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2289
diff changeset
    17
	instanceVariableNames:'currentSuperclasses currentSubclasses
5705835046a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2289
diff changeset
    18
		cachedLocalIdentifierEmphasis cachedLocalIdentifierColor
4668
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    19
		cachedStringEmphasis cachedStringColor unknownVariableResolver'
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'System-Compiler'
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!SyntaxHighlighter class methodsFor:'documentation'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 1998 by eXept Software AG
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
              All Rights Reserved
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
681
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    41
!
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
documentation
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    44
"
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    45
    colors a method.
3add270b9c1e documentation added
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    46
"
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
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
4211
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    51
!SyntaxHighlighter class methodsFor:'constants'!
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    52
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    53
codeAspectClassDefinition
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    54
    ^ #classDefinition
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    55
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    56
    "Created: / 27-07-2012 / 22:17:24 / cg"
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    57
!
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    58
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    59
codeAspectExpression
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    60
    ^ #expression
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    61
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    62
    "Created: / 27-07-2012 / 22:01:26 / cg"
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    63
!
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    64
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    65
codeAspectFile
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    66
    ^ #file
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    67
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    68
    "Created: / 21-10-2017 / 13:25:14 / cg"
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    69
!
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    70
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    71
codeAspectMethod
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    72
    ^ #method
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    73
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    74
    "Created: / 27-07-2012 / 22:01:42 / cg"
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    75
! !
5ecadf00f515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4203
diff changeset
    76
4668
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    77
!SyntaxHighlighter methodsFor:'accessing'!
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    78
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    79
unknownVariableResolver
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    80
    ^ unknownVariableResolver
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    81
! !
ddbc1fbebe8e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4643
diff changeset
    82
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
!SyntaxHighlighter methodsFor:'initialization'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
initialize
4113
2542528ec54a #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3816
diff changeset
    86
    <modifier: #super> "must be called if redefined"
2542528ec54a #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3816
diff changeset
    87
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    super initialize.
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
990
cd1aa00086fd dont care to fold constants during syntaxHighlight
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
    90
    foldConstants := false.
1636
98afdcdacde8 compilerflags separated into ParserFlags.
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
    91
"/    parserFlags allowDollarInIdentifier:true.
990
cd1aa00086fd dont care to fold constants during syntaxHighlight
Claus Gittinger <cg@exept.de>
parents: 987
diff changeset
    92
4203
9b35cbc718a2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4199
diff changeset
    93
    self preferences:(UserPreferences current).
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
    94
    fullSelectorCheck := preferences fullSelectorCheck.
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
4113
2542528ec54a #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3816
diff changeset
    96
    "Created: / 31-03-1998 / 15:12:55 / cg"
4203
9b35cbc718a2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4199
diff changeset
    97
    "Modified: / 21-10-2017 / 14:20:27 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!SyntaxHighlighter methodsFor:'syntax detection'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
markArgumentIdentifierFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   105
        withEmphasis:(preferences argumentIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   106
        color:(preferences argumentIdentifierColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    "Modified: / 31.3.1998 / 18:01:27 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   111
markAssignedClassVariableIdentifierFrom:pos1 to:pos2
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   112
    self 
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   113
        markFrom:pos1 to:pos2 
3560
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   114
        withEmphasis:(preferences sideEffectAssignmentEmphasis) ifNil:(preferences classVariableIdentifierEmphasis)
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   115
        color:(preferences sideEffectAssignmentColor) ifNil:(preferences classVariableIdentifierColor)
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   116
        backgroundColor:(preferences sideEffectAssignmentBackgroundColor)
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   117
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   118
    "Created: / 13-02-2012 / 11:49:59 / cg"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   119
!
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   120
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   121
markAssignedGlobalIdentifierFrom:pos1 to:pos2
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   122
    self 
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   123
        markFrom:pos1 to:pos2 
3560
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   124
        withEmphasis:(preferences sideEffectAssignmentEmphasis) ifNil:(preferences globalIdentifierEmphasis)
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   125
        color:(preferences sideEffectAssignmentColor) ifNil:(preferences globalIdentifierColor)
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   126
        backgroundColor:(preferences sideEffectAssignmentBackgroundColor)
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   127
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   128
    "Modified: / 31-03-1998 / 18:02:14 / cg"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   129
    "Created: / 13-02-2012 / 11:44:33 / cg"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   130
!
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   131
2997
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   132
markAssignedIdentifierFrom:pos1 to:pos2
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   133
    "any other identifier (PrivateClass, Workspace, Doit, etc.)"
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   134
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   135
    self markAssignedGlobalIdentifierFrom:pos1 to:pos2
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   136
!
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   137
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   138
markAssignedInstVarIdentifierFrom:pos1 to:pos2
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   139
    self 
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   140
        markFrom:pos1 to:pos2 
3560
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   141
        withEmphasis:(preferences sideEffectAssignmentEmphasis) ifNil:(preferences instVarIdentifierEmphasis)
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   142
        color:(preferences sideEffectAssignmentColor) ifNil:(preferences instVarIdentifierColor)
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   143
        backgroundColor:(preferences sideEffectAssignmentBackgroundColor)
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   144
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   145
    "Created: / 13-02-2012 / 11:50:19 / cg"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   146
!
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   147
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   148
markAssignedPoolVariableIdentifierFrom:pos1 to:pos2
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   149
    self 
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   150
        markFrom:pos1 to:pos2 
3560
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   151
        withEmphasis:(preferences sideEffectAssignmentEmphasis) ifNil:(preferences poolVariableIdentifierEmphasis)
b0c86d7cb860 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3353
diff changeset
   152
        color:(preferences sideEffectAssignmentColor) ifNil:(preferences poolVariableIdentifierColor)
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   153
        backgroundColor:(preferences sideEffectAssignmentBackgroundColor)
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   154
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   155
    "Created: / 13-02-2012 / 11:49:14 / cg"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   156
!
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   157
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   158
markAssignedVariable:v from:pos to:endPos
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   159
    "support for syntaxColoring"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   160
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   161
    |type|
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   162
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   163
    type := v type.
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   164
    (type == #BlockArg
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   165
    or:[ type == #MethodArg
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   166
    or:[ type == #BlockVariable
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   167
    or:[ type == #MethodVariable]]]) ifTrue:[
3187
7aa3c1a58647 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3147
diff changeset
   168
        self markVariable:v from:pos to:endPos assigned:true.
2811
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   169
        ^ self
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   170
    ].
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   171
    (type == #GlobalVariable) ifTrue:[
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   172
        self markAssignedGlobalIdentifierFrom:pos to:endPos.
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   173
        ^ self
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   174
    ].
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   175
    (type == #PoolVariable) ifTrue:[
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   176
        self markAssignedPoolVariableIdentifierFrom:pos to:endPos.
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   177
        ^ self
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   178
    ].
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   179
    (type == #ClassVariable) ifTrue:[
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   180
        self markAssignedClassVariableIdentifierFrom:pos to:endPos.
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   181
        ^ self
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   182
    ].
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   183
    (type == #InstanceVariable) ifTrue:[
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   184
        self markAssignedInstVarIdentifierFrom:pos to:endPos.
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   185
        ^ self
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   186
    ].
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   187
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   188
    self markAssignedIdentifierFrom:pos to:endPos.
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   189
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   190
    "Created: / 13-02-2012 / 11:42:23 / cg"
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   191
!
88582e700b37 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2807
diff changeset
   192
884
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   193
markBadIdentifierFrom:pos1 to:pos2
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   194
    self 
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   195
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   196
        withEmphasis:(preferences badIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   197
        color:(preferences badIdentifierColor)
884
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   198
!
5ec4b67dce33 mark bad identifiers
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
   199
2055
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   200
markBlockFrom:pos1 to:pos2
2228
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   201
    "an experiment (which does not look too good, after all):
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   202
     the deeper the nesting of the block, the darker the background color."
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   203
2055
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   204
"/    |level color|
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   205
"/
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   206
"/    level := currentBlock isNil ifTrue:[1] ifFalse:[currentBlock nestingLevel+1].
2228
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   207
"/    level > 5 ifTrue:[
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   208
"/        color := Color yellow darkened.
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   209
"/    ] ifFalse:[
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   210
"/        color := {
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   211
"/                    Color yellow lightened lightened.
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   212
"/                    Color yellow lightened          .
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   213
"/                    Color yellow                    .
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   214
"/                    Color yellow slightlyDarkened   .
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   215
"/                    Color yellow darkened           .
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   216
"/                } at:level.
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   217
"/    ].
2055
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   218
"/    self 
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   219
"/        markFrom:pos1 to:pos2 
2228
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   220
"/        withAddedEmphasis:(#backgroundColor->color).
2055
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   221
!
b04faf4243fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
   222
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
markBooleanConstantFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   226
        withEmphasis:(preferences booleanConstantEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   227
        color:(preferences booleanConstantColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    "Created: / 31.3.1998 / 18:09:01 / cg"
665
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   230
    "Modified: / 31.3.1998 / 19:36:44 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
673
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   233
markBracketAt:pos
2070
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   234
    |level colors clr em|
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   235
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   236
    preferences emphasizeParenthesisLevel ifFalse:[
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   237
        self 
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   238
            markFrom:pos to:pos 
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   239
            withEmphasis:(preferences bracketEmphasis) 
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   240
            color:(preferences bracketColor).
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   241
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   242
        ^ self
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   243
    ].
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   244
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   245
    level := currentBlock isNil ifTrue:[1] ifFalse:[currentBlock nestingLevel + 2].
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   246
    (sourceText at:pos) = $] ifTrue:[
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   247
        level := level - 1.
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   248
    ].
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   249
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   250
    colors := Array 
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   251
                with:(Color black)
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   252
                with:(Color blue)
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   253
                with:(Color green blendWith:(Color grey:30))
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   254
                with:(Color red blendWith:(Color grey:30))
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   255
                with:(Color yellow darkened).
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   256
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   257
    clr := colors at:((level-1) \\ colors size + 1).
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   258
    em := #normal.
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   259
    level > 1 ifTrue:[
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   260
        em := #bold.
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   261
    ].
673
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   262
    self 
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   263
        markFrom:pos to:pos 
2070
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   264
        withEmphasis:em 
1f4574d55b53 bracket level
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   265
        color:clr
673
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   266
!
0c66b7cb1d2f checkin from browser
ca
parents: 672
diff changeset
   267
870
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   268
markClassVariableIdentifierFrom:pos1 to:pos2
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   269
    self 
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   270
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   271
        withEmphasis:(preferences classVariableIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   272
        color:(preferences classVariableIdentifierColor)
870
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   273
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   274
    "Modified: / 31.3.1998 / 18:02:14 / cg"
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   275
!
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   276
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   277
markGlobalClassIdentifierFrom:pos1 to:pos2
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   278
    self 
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   279
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   280
        withEmphasis:(preferences globalClassIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   281
        color:(preferences globalClassIdentifierColor)
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   282
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   283
    "Modified: / 31.3.1998 / 18:02:14 / cg"
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   284
    "Created: / 4.3.1999 / 12:53:02 / cg"
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   285
!
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   286
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
markGlobalIdentifierFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   290
        withEmphasis:(preferences globalIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   291
        color:(preferences globalIdentifierColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
    "Modified: / 31.3.1998 / 18:02:14 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
markHereFrom: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 hereEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   300
        color:(preferences hereColor)
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:02:25 / 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
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
markIdentifierFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   308
        withEmphasis:(preferences identifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   309
        color:(preferences identifierColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
    "Modified: / 31.3.1998 / 18:02:39 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    "Created: / 31.3.1998 / 18:04:56 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   315
markInstVarIdentifierFrom:pos1 to:pos2
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   316
    self 
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   317
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   318
        withEmphasis:(preferences instVarIdentifierEmphasis)    
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   319
        color:(preferences instVarIdentifierColor)
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   320
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   321
    "Created: / 16.4.1998 / 18:35:40 / cg"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   322
    "Modified: / 16.4.1998 / 18:37:30 / cg"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   323
!
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   324
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
markLocalIdentifierFrom:pos1 to:pos2
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   326
    cachedLocalIdentifierEmphasis isNil ifTrue:[
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   327
        cachedLocalIdentifierEmphasis := preferences localIdentifierEmphasis.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   328
        cachedLocalIdentifierColor := preferences localIdentifierColor.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   329
    ].
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
        markFrom:pos1 to:pos2 
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   332
        withEmphasis:cachedLocalIdentifierEmphasis 
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   333
        color:cachedLocalIdentifierColor
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
    "Modified: / 31.3.1998 / 18:02:39 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
markMethodSelectorFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   341
        withEmphasis:(preferences methodSelectorEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   342
        color:(preferences methodSelectorColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
    "Modified: / 31.3.1998 / 18:02:52 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
1684
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   347
markNumberConstantFrom:pos1 to:pos2
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   348
    self 
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   349
        markFrom:pos1 to:pos2 
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   350
        withEmphasis:(preferences numberConstantEmphasis) 
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   351
        color:(preferences numberConstantColor)
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   352
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   353
    "Modified: / 31.3.1998 / 18:01:44 / cg"
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   354
    "Created: / 31.3.1998 / 18:09:22 / cg"
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   355
!
e9d1d09ca914 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
   356
1640
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   357
markParenthesisAt:pos
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   358
    |colors clr em|
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   359
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   360
    preferences emphasizeParenthesisLevel ifFalse:[^ self].
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   361
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   362
    colors := Array 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   363
                with:(Color black)
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   364
                with:(Color blue)
1757
c1edf49e8f9f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1684
diff changeset
   365
                with:(Color green blendWith:(Color grey:30))
c1edf49e8f9f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1684
diff changeset
   366
                with:(Color red blendWith:(Color grey:30))
1640
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   367
                with:(Color yellow darkened).
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   368
                        
1757
c1edf49e8f9f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1684
diff changeset
   369
    clr := colors at:((parenthesisLevel-1) \\ colors size + 1).
1640
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   370
    em := #normal.
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   371
    parenthesisLevel > 1 ifTrue:[
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   372
        em := #bold.
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   373
    ].
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   374
    self 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   375
        markFrom:pos to:pos 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   376
        withEmphasis:em 
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   377
        color:clr
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   378
!
261459ccc704 emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents: 1636
diff changeset
   379
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   380
markPoolVariableIdentifierFrom:pos1 to:pos2
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   381
    self 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   382
        markFrom:pos1 to:pos2 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   383
        withEmphasis:(preferences poolVariableIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   384
        color:(preferences poolVariableIdentifierColor)
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   385
!
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   386
838
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   387
markReturnAt:pos
3598
72fc8ed7472e some code cleanup
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   388
    "/ sourceText := (sourceText copyTo:pos-1),(Character value:16r21e7),(sourceText copyFrom:pos+1).
838
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   389
    self 
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   390
        markFrom:pos to:pos 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   391
        withEmphasis:(preferences returnEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   392
        color:(preferences returnColor)
838
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   393
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   394
    "Modified: / 31.3.1998 / 19:36:44 / cg"
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   395
    "Created: / 5.1.1980 / 00:44:27 / cg"
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   396
!
fd3286584da6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   397
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   398
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
   399
    |fg selectorSymbol check ok rec em|
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   400
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   401
"/ uncommenting the code below
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   402
"/ will suppress highlighting of common selectors ...
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   403
"/
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   404
"/    (#(
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   405
"/        'ifTrue:' 
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   406
"/        'ifFalse:'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   407
"/        'not'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   408
"/        'and:'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   409
"/        'or:'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   410
"/        '='
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   411
"/        '=='
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   412
"/        '~='
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   413
"/        '~~'
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   414
"/    ) includes:sel) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   415
"/        ^ self
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   416
"/    ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   417
1526
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   418
    fg := preferences selectorColor.
e3b13dd2f034 *** empty log message ***
ca
parents: 1498
diff changeset
   419
    em := preferences selectorEmphasis.
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   420
    selectorSymbol := selectorString asSymbolIfInterned.
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   421
    selectorSymbol isNil ifTrue:[
1905
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   422
        em := preferences unimplementedSelectorEmphasis.
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   423
        fg := preferences unimplementedSelectorColor.
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   424
    ] ifFalse:[
1905
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   425
        ok := true.
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   426
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   427
        fullSelectorCheck == true ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   428
1498
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   429
            check := [:cls | (cls includesSelector:selectorSymbol)
9b4366551a2a speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents: 1396
diff changeset
   430
                             or:[cls class includesSelector:selectorSymbol]].
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   431
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   432
            ok := false.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   433
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   434
            "/ limit search if possible
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   435
            (classToCompileFor notNil
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   436
             and:[aReceiverNode isSelf or:[aReceiverNode isSuper]]) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   437
                currentSuperclasses isNil ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   438
                    currentSuperclasses := classToCompileFor withAllSuperclasses.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   439
                ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   440
                ok := currentSuperclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   441
                (ok not and:[aReceiverNode isSelf]) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   442
                    currentSubclasses isNil ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   443
                        currentSubclasses := classToCompileFor allSubclasses.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   444
                    ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   445
                    ok := currentSubclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   446
                ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   447
            ] ifFalse:[
3816
cfa6ac81379f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3598
diff changeset
   448
                aReceiverNode isLiteral ifTrue:[
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   449
                    ok := aReceiverNode evaluate class withAllSuperclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   450
                ] ifFalse:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   451
                    (aReceiverNode isGlobal 
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   452
                    and:[(rec := aReceiverNode evaluate) isBehavior]) ifTrue:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   453
                        ok := rec class withAllSuperclasses contains:check.
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   454
                    ] ifFalse:[
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   455
                        ok := Smalltalk allClasses contains:check
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   456
                    ]
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   457
                ]
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   458
            ].
1905
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   459
        ].
3232
351760212601 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
   460
1905
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   461
        ok ifFalse:[
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   462
            em := preferences unimplementedSelectorEmphasis.
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   463
            fg := preferences unimplementedSelectorColor.
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   464
        ] ifTrue:[
3343
61cec2951288 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3263
diff changeset
   465
            (self class isControlFlowSelector:selectorSymbol) ifTrue:[
1905
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   466
                em := preferences controlFlowSelectorEmphasis.
2816
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   467
                fg := preferences controlFlowSelectorColor
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   468
            ] ifFalse:[
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   469
                (self collectionEnumerationSelectors includesIdentical:selectorSymbol) ifTrue:[
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   470
                    em := preferences collectionEnumerationSelectorEmphasis.
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   471
                    fg := preferences collectionEnumerationSelectorColor
3229
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   472
                ] ifFalse:[
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   473
                    (self debugSelectors includesIdentical:selectorSymbol) ifTrue:[
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   474
                        em := preferences debugSelectorEmphasis.
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   475
                        fg := preferences debugSelectorColor
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   476
                    ] ifFalse:[
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   477
                        (self errorRaisingSelectors includesIdentical:selectorSymbol) ifTrue:[
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   478
                            em := preferences errorRaisingSelectorEmphasis.
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   479
                            fg := preferences errorRaisingSelectorColor
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   480
                        ].
379d4b04f7cf class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3187
diff changeset
   481
                    ].
2816
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   482
                ].
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   483
            ].
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   484
            em isNil ifTrue:[
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   485
                em := preferences selectorEmphasis
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   486
            ].
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   487
            fg isNil ifTrue:[
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   488
                fg := preferences selectorColor
1905
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   489
            ].
fba079d9d509 control flow color&emphasis
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
   490
        ].
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   491
    ].
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   492
    self
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   493
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   494
        withEmphasis:em 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   495
        color:fg
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   496
2816
e8b84f6d7462 changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents: 2811
diff changeset
   497
    "Modified: / 14-02-2012 / 16:03:52 / cg"
863
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   498
!
4e8b99196457 better selector checks
Claus Gittinger <cg@exept.de>
parents: 838
diff changeset
   499
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
markSelfFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   503
        withEmphasis:(preferences selfEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   504
        color:(preferences selfColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    "Modified: / 31.3.1998 / 18:03:10 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
markStringFrom:pos1 to:pos2
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   510
    cachedStringEmphasis isNil ifTrue:[
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   511
        cachedStringEmphasis := preferences stringEmphasis.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   512
        cachedStringColor := preferences stringColor.
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   513
    ].
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
        markFrom:pos1 to:pos2 
1802
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   516
        withEmphasis:cachedStringEmphasis 
e0b32dc71dac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
   517
        color:cachedStringColor
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
    "Modified: / 31.3.1998 / 18:03:18 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
markSuperFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   525
        withEmphasis:(preferences superEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   526
        color:(preferences superColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    "Modified: / 31.3.1998 / 18:03:26 / cg"
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
672
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   531
markSymbolFrom:pos1 to:pos2
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   532
    self 
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   533
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   534
        withEmphasis:(preferences symbolEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   535
        color:(preferences symbolColor)
672
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   536
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   537
    "Created: / 1.4.1998 / 12:56:47 / cg"
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   538
    "Modified: / 1.4.1998 / 12:58:00 / cg"
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   539
!
392927bad277 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   540
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
markThisContextFrom:pos1 to:pos2
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
    self 
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   544
        withEmphasis:(preferences thisContextEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   545
        color:(preferences thisContextColor)
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
    "Modified: / 31.3.1998 / 18:03:36 / cg"
665
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   548
!
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   549
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   550
markUnknownIdentifierFrom:pos1 to:pos2
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   551
    self 
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   552
        markFrom:pos1 to:pos2 
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   553
        withEmphasis:(preferences unknownIdentifierEmphasis) 
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   554
        color:(preferences unknownIdentifierColor)
665
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   555
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   556
    "Created: / 31.3.1998 / 19:09:26 / cg"
14114d1e653c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
   557
    "Modified: / 31.3.1998 / 19:10:30 / cg"
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   558
!
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   559
3187
7aa3c1a58647 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 3147
diff changeset
   560
markVariable:v from:pos to:endPos assigned:assigned
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   561
    "support for syntaxColoring"
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   562
823
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   563
    |type globalValue nameSym|
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   564
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   565
    type := v type.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   566
    (type == #BlockArg
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   567
    or:[type == #MethodArg]) ifTrue:[
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   568
        self markArgumentIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   569
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   570
    ].
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   571
    (type == #BlockVariable
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   572
    or:[type == #MethodVariable]) ifTrue:[
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   573
        self markLocalIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   574
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   575
    ].
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   576
    (type == #GlobalVariable) ifTrue:[
823
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   577
        nameSym := v name asSymbolIfInterned.
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   578
        nameSym notNil ifTrue:[
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   579
            globalValue := Smalltalk at:nameSym ifAbsent:nil.
a05ffe57b1b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
   580
        ].
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   581
        globalValue isBehavior ifTrue:[
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   582
            self markGlobalClassIdentifierFrom:pos to:endPos.
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   583
        ] ifFalse:[
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   584
            self markGlobalIdentifierFrom:pos to:endPos.
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   585
        ].
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   586
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   587
    ].
1553
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   588
    (type == #PoolVariable) ifTrue:[
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   589
        self markPoolVariableIdentifierFrom:pos to:endPos.
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   590
        ^ self
1657d0843c64 sharedPools
ca
parents: 1550
diff changeset
   591
    ].
870
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   592
    (type == #ClassVariable) ifTrue:[
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   593
        self markClassVariableIdentifierFrom:pos to:endPos.
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   594
        ^ self
1db26e4ce4c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   595
    ].
686
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   596
    (type == #InstanceVariable) ifTrue:[
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   597
        self markInstVarIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   598
        ^ self
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   599
    ].
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   600
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   601
    self markIdentifierFrom:pos to:endPos.
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   602
067a8c8be462 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   603
    "Created: / 16.4.1998 / 18:49:34 / cg"
822
a773bb72cbd6 added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents: 794
diff changeset
   604
    "Modified: / 4.3.1999 / 12:56:13 / cg"
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
! !
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
!SyntaxHighlighter class methodsFor:'documentation'!
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
version
3816
cfa6ac81379f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3598
diff changeset
   610
    ^ '$Header$'
2228
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   611
!
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   612
a4fefd07cf25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2177
diff changeset
   613
version_CVS
3816
cfa6ac81379f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3598
diff changeset
   614
    ^ '$Header$'
662
5a0a832ac06c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
! !
2997
c9e4109b6420 class: SyntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 2892
diff changeset
   616