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