author | Claus Gittinger <cg@exept.de> |
Fri, 19 Apr 2013 11:40:10 +0200 | |
changeset 3147 | 09878a1be040 |
parent 3068 | bdd2d2d35773 |
child 3187 | 7aa3c1a58647 |
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 | |
3147
09878a1be040
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
159 |
ex creator isHandled ifTrue:[ |
1857 | 160 |
ex reject. |
161 |
]. |
|
3068 | 162 |
(ParseError handles:ex) ifFalse:[ |
2087
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 |
||
2997 | 266 |
markAssignedIdentifierFrom:pos1 to:pos2 |
267 |
"any other identifier (PrivateClass, Workspace, Doit, etc.)" |
|
268 |
||
269 |
self markAssignedGlobalIdentifierFrom:pos1 to:pos2 |
|
270 |
! |
|
271 |
||
2811 | 272 |
markAssignedInstVarIdentifierFrom:pos1 to:pos2 |
273 |
self |
|
274 |
markFrom:pos1 to:pos2 |
|
275 |
withEmphasis:(preferences instVarIdentifierEmphasis) |
|
276 |
color:(preferences sideEffectAssignmentColor) |
|
277 |
ifNil:(preferences instVarIdentifierColor) |
|
278 |
backgroundColor:(preferences sideEffectAssignmentBackgroundColor) |
|
279 |
||
280 |
"Created: / 13-02-2012 / 11:50:19 / cg" |
|
281 |
! |
|
282 |
||
283 |
markAssignedPoolVariableIdentifierFrom:pos1 to:pos2 |
|
284 |
self |
|
285 |
markFrom:pos1 to:pos2 |
|
286 |
withEmphasis:(preferences poolVariableIdentifierEmphasis) |
|
287 |
color:(preferences sideEffectAssignmentColor) |
|
288 |
ifNil:(preferences poolVariableIdentifierColor) |
|
289 |
backgroundColor:(preferences sideEffectAssignmentBackgroundColor) |
|
290 |
||
291 |
"Created: / 13-02-2012 / 11:49:14 / cg" |
|
292 |
! |
|
293 |
||
294 |
markAssignedVariable:v from:pos to:endPos |
|
295 |
"support for syntaxColoring" |
|
296 |
||
297 |
|type| |
|
298 |
||
299 |
type := v type. |
|
300 |
(type == #BlockArg |
|
301 |
or:[ type == #MethodArg |
|
302 |
or:[ type == #BlockVariable |
|
303 |
or:[ type == #MethodVariable]]]) ifTrue:[ |
|
304 |
self markVariable:v from:pos to:endPos. |
|
305 |
^ self |
|
306 |
]. |
|
307 |
(type == #GlobalVariable) ifTrue:[ |
|
308 |
self markAssignedGlobalIdentifierFrom:pos to:endPos. |
|
309 |
^ self |
|
310 |
]. |
|
311 |
(type == #PoolVariable) ifTrue:[ |
|
312 |
self markAssignedPoolVariableIdentifierFrom:pos to:endPos. |
|
313 |
^ self |
|
314 |
]. |
|
315 |
(type == #ClassVariable) ifTrue:[ |
|
316 |
self markAssignedClassVariableIdentifierFrom:pos to:endPos. |
|
317 |
^ self |
|
318 |
]. |
|
319 |
(type == #InstanceVariable) ifTrue:[ |
|
320 |
self markAssignedInstVarIdentifierFrom:pos to:endPos. |
|
321 |
^ self |
|
322 |
]. |
|
323 |
||
324 |
self markAssignedIdentifierFrom:pos to:endPos. |
|
325 |
||
326 |
"Created: / 13-02-2012 / 11:42:23 / cg" |
|
327 |
! |
|
328 |
||
884 | 329 |
markBadIdentifierFrom:pos1 to:pos2 |
330 |
self |
|
331 |
markFrom:pos1 to:pos2 |
|
1553 | 332 |
withEmphasis:(preferences badIdentifierEmphasis) |
333 |
color:(preferences badIdentifierColor) |
|
884 | 334 |
! |
335 |
||
2055 | 336 |
markBlockFrom:pos1 to:pos2 |
2228 | 337 |
"an experiment (which does not look too good, after all): |
338 |
the deeper the nesting of the block, the darker the background color." |
|
339 |
||
2055 | 340 |
"/ |level color| |
341 |
"/ |
|
342 |
"/ level := currentBlock isNil ifTrue:[1] ifFalse:[currentBlock nestingLevel+1]. |
|
2228 | 343 |
"/ level > 5 ifTrue:[ |
344 |
"/ color := Color yellow darkened. |
|
345 |
"/ ] ifFalse:[ |
|
346 |
"/ color := { |
|
347 |
"/ Color yellow lightened lightened. |
|
348 |
"/ Color yellow lightened . |
|
349 |
"/ Color yellow . |
|
350 |
"/ Color yellow slightlyDarkened . |
|
351 |
"/ Color yellow darkened . |
|
352 |
"/ } at:level. |
|
353 |
"/ ]. |
|
2055 | 354 |
"/ self |
355 |
"/ markFrom:pos1 to:pos2 |
|
2228 | 356 |
"/ withAddedEmphasis:(#backgroundColor->color). |
2055 | 357 |
! |
358 |
||
662 | 359 |
markBooleanConstantFrom:pos1 to:pos2 |
360 |
self |
|
361 |
markFrom:pos1 to:pos2 |
|
1553 | 362 |
withEmphasis:(preferences booleanConstantEmphasis) |
363 |
color:(preferences booleanConstantColor) |
|
662 | 364 |
|
365 |
"Created: / 31.3.1998 / 18:09:01 / cg" |
|
665 | 366 |
"Modified: / 31.3.1998 / 19:36:44 / cg" |
662 | 367 |
! |
368 |
||
673 | 369 |
markBracketAt:pos |
2070 | 370 |
|level colors clr em| |
371 |
||
372 |
preferences emphasizeParenthesisLevel ifFalse:[ |
|
373 |
self |
|
374 |
markFrom:pos to:pos |
|
375 |
withEmphasis:(preferences bracketEmphasis) |
|
376 |
color:(preferences bracketColor). |
|
377 |
||
378 |
^ self |
|
379 |
]. |
|
380 |
||
381 |
level := currentBlock isNil ifTrue:[1] ifFalse:[currentBlock nestingLevel + 2]. |
|
382 |
(sourceText at:pos) = $] ifTrue:[ |
|
383 |
level := level - 1. |
|
384 |
]. |
|
385 |
||
386 |
colors := Array |
|
387 |
with:(Color black) |
|
388 |
with:(Color blue) |
|
389 |
with:(Color green blendWith:(Color grey:30)) |
|
390 |
with:(Color red blendWith:(Color grey:30)) |
|
391 |
with:(Color yellow darkened). |
|
392 |
||
393 |
clr := colors at:((level-1) \\ colors size + 1). |
|
394 |
em := #normal. |
|
395 |
level > 1 ifTrue:[ |
|
396 |
em := #bold. |
|
397 |
]. |
|
673 | 398 |
self |
399 |
markFrom:pos to:pos |
|
2070 | 400 |
withEmphasis:em |
401 |
color:clr |
|
673 | 402 |
! |
403 |
||
870 | 404 |
markClassVariableIdentifierFrom:pos1 to:pos2 |
405 |
self |
|
406 |
markFrom:pos1 to:pos2 |
|
1553 | 407 |
withEmphasis:(preferences classVariableIdentifierEmphasis) |
408 |
color:(preferences classVariableIdentifierColor) |
|
870 | 409 |
|
410 |
"Modified: / 31.3.1998 / 18:02:14 / cg" |
|
411 |
! |
|
412 |
||
662 | 413 |
markCommentFrom:pos1 to:pos2 |
414 |
self |
|
415 |
markFrom:pos1 to:pos2 |
|
1553 | 416 |
withEmphasis:(preferences commentEmphasis) |
417 |
color:(preferences commentColor) |
|
662 | 418 |
|
1550 | 419 |
" |
420 |
UserPreferences current commentEmphasis |
|
421 |
" |
|
422 |
"Modified: / 31.3.1998 / 18:01:55 / cg" |
|
662 | 423 |
! |
424 |
||
425 |
markConstantFrom:pos1 to:pos2 |
|
426 |
self |
|
427 |
markFrom:pos1 to:pos2 |
|
1553 | 428 |
withEmphasis:(preferences constantEmphasis) |
429 |
color:(preferences constantColor) |
|
662 | 430 |
|
431 |
"Modified: / 31.3.1998 / 18:01:44 / cg" |
|
432 |
"Created: / 31.3.1998 / 18:09:22 / cg" |
|
433 |
! |
|
434 |
||
822
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
435 |
markGlobalClassIdentifierFrom:pos1 to:pos2 |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
436 |
self |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
437 |
markFrom:pos1 to:pos2 |
1553 | 438 |
withEmphasis:(preferences globalClassIdentifierEmphasis) |
439 |
color:(preferences globalClassIdentifierColor) |
|
822
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
440 |
|
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
441 |
"Modified: / 31.3.1998 / 18:02:14 / cg" |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
442 |
"Created: / 4.3.1999 / 12:53:02 / cg" |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
443 |
! |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
444 |
|
662 | 445 |
markGlobalIdentifierFrom:pos1 to:pos2 |
446 |
self |
|
447 |
markFrom:pos1 to:pos2 |
|
1553 | 448 |
withEmphasis:(preferences globalIdentifierEmphasis) |
449 |
color:(preferences globalIdentifierColor) |
|
662 | 450 |
|
451 |
"Modified: / 31.3.1998 / 18:02:14 / cg" |
|
452 |
! |
|
453 |
||
454 |
markHereFrom:pos1 to:pos2 |
|
455 |
self |
|
456 |
markFrom:pos1 to:pos2 |
|
1553 | 457 |
withEmphasis:(preferences hereEmphasis) |
458 |
color:(preferences hereColor) |
|
662 | 459 |
|
460 |
"Modified: / 31.3.1998 / 18:02:25 / cg" |
|
461 |
! |
|
462 |
||
463 |
markIdentifierFrom:pos1 to:pos2 |
|
464 |
self |
|
465 |
markFrom:pos1 to:pos2 |
|
1553 | 466 |
withEmphasis:(preferences identifierEmphasis) |
467 |
color:(preferences identifierColor) |
|
662 | 468 |
|
469 |
"Modified: / 31.3.1998 / 18:02:39 / cg" |
|
470 |
"Created: / 31.3.1998 / 18:04:56 / cg" |
|
471 |
! |
|
472 |
||
686 | 473 |
markInstVarIdentifierFrom:pos1 to:pos2 |
474 |
self |
|
475 |
markFrom:pos1 to:pos2 |
|
1553 | 476 |
withEmphasis:(preferences instVarIdentifierEmphasis) |
477 |
color:(preferences instVarIdentifierColor) |
|
686 | 478 |
|
479 |
"Created: / 16.4.1998 / 18:35:40 / cg" |
|
480 |
"Modified: / 16.4.1998 / 18:37:30 / cg" |
|
481 |
! |
|
482 |
||
662 | 483 |
markLocalIdentifierFrom:pos1 to:pos2 |
1802 | 484 |
cachedLocalIdentifierEmphasis isNil ifTrue:[ |
485 |
cachedLocalIdentifierEmphasis := preferences localIdentifierEmphasis. |
|
486 |
cachedLocalIdentifierColor := preferences localIdentifierColor. |
|
487 |
]. |
|
662 | 488 |
self |
489 |
markFrom:pos1 to:pos2 |
|
1802 | 490 |
withEmphasis:cachedLocalIdentifierEmphasis |
491 |
color:cachedLocalIdentifierColor |
|
662 | 492 |
|
493 |
"Modified: / 31.3.1998 / 18:02:39 / cg" |
|
494 |
! |
|
495 |
||
496 |
markMethodSelectorFrom:pos1 to:pos2 |
|
497 |
self |
|
498 |
markFrom:pos1 to:pos2 |
|
1553 | 499 |
withEmphasis:(preferences methodSelectorEmphasis) |
500 |
color:(preferences methodSelectorColor) |
|
662 | 501 |
|
502 |
"Modified: / 31.3.1998 / 18:02:52 / cg" |
|
503 |
! |
|
504 |
||
1684 | 505 |
markNumberConstantFrom:pos1 to:pos2 |
506 |
self |
|
507 |
markFrom:pos1 to:pos2 |
|
508 |
withEmphasis:(preferences numberConstantEmphasis) |
|
509 |
color:(preferences numberConstantColor) |
|
510 |
||
511 |
"Modified: / 31.3.1998 / 18:01:44 / cg" |
|
512 |
"Created: / 31.3.1998 / 18:09:22 / cg" |
|
513 |
! |
|
514 |
||
1640
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
515 |
markParenthesisAt:pos |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
516 |
|colors clr em| |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
517 |
|
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
518 |
preferences emphasizeParenthesisLevel ifFalse:[^ self]. |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
519 |
|
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
520 |
colors := Array |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
521 |
with:(Color black) |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
522 |
with:(Color blue) |
1757 | 523 |
with:(Color green blendWith:(Color grey:30)) |
524 |
with:(Color red blendWith:(Color grey:30)) |
|
1640
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
525 |
with:(Color yellow darkened). |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
526 |
|
1757 | 527 |
clr := colors at:((parenthesisLevel-1) \\ colors size + 1). |
1640
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
528 |
em := #normal. |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
529 |
parenthesisLevel > 1 ifTrue:[ |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
530 |
em := #bold. |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
531 |
]. |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
532 |
self |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
533 |
markFrom:pos to:pos |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
534 |
withEmphasis:em |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
535 |
color:clr |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
536 |
! |
261459ccc704
emphasize parenthesis nesting
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
537 |
|
1553 | 538 |
markPoolVariableIdentifierFrom:pos1 to:pos2 |
539 |
self |
|
540 |
markFrom:pos1 to:pos2 |
|
541 |
withEmphasis:(preferences poolVariableIdentifierEmphasis) |
|
542 |
color:(preferences poolVariableIdentifierColor) |
|
543 |
! |
|
544 |
||
838 | 545 |
markReturnAt:pos |
546 |
self |
|
547 |
markFrom:pos to:pos |
|
1553 | 548 |
withEmphasis:(preferences returnEmphasis) |
549 |
color:(preferences returnColor) |
|
838 | 550 |
|
551 |
"Modified: / 31.3.1998 / 19:36:44 / cg" |
|
552 |
"Created: / 5.1.1980 / 00:44:27 / cg" |
|
553 |
! |
|
554 |
||
863 | 555 |
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
|
556 |
|fg selectorSymbol check ok rec em| |
863 | 557 |
|
558 |
"/ uncommenting the code below |
|
559 |
"/ will suppress highlighting of common selectors ... |
|
560 |
"/ |
|
561 |
"/ (#( |
|
562 |
"/ 'ifTrue:' |
|
563 |
"/ 'ifFalse:' |
|
564 |
"/ 'not' |
|
565 |
"/ 'and:' |
|
566 |
"/ 'or:' |
|
567 |
"/ '=' |
|
568 |
"/ '==' |
|
569 |
"/ '~=' |
|
570 |
"/ '~~' |
|
571 |
"/ ) includes:sel) ifTrue:[ |
|
572 |
"/ ^ self |
|
573 |
"/ ]. |
|
574 |
||
1526 | 575 |
fg := preferences selectorColor. |
576 |
em := preferences selectorEmphasis. |
|
1498
9b4366551a2a
speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents:
1396
diff
changeset
|
577 |
selectorSymbol := selectorString asSymbolIfInterned. |
9b4366551a2a
speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents:
1396
diff
changeset
|
578 |
selectorSymbol isNil ifTrue:[ |
1905 | 579 |
em := preferences unimplementedSelectorEmphasis. |
580 |
fg := preferences unimplementedSelectorColor. |
|
1498
9b4366551a2a
speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents:
1396
diff
changeset
|
581 |
] ifFalse:[ |
1905 | 582 |
ok := true. |
583 |
||
863 | 584 |
fullSelectorCheck == true ifTrue:[ |
585 |
||
1498
9b4366551a2a
speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents:
1396
diff
changeset
|
586 |
check := [:cls | (cls includesSelector:selectorSymbol) |
9b4366551a2a
speed up symbol checking and generation
Stefan Vogel <sv@exept.de>
parents:
1396
diff
changeset
|
587 |
or:[cls class includesSelector:selectorSymbol]]. |
863 | 588 |
|
589 |
ok := false. |
|
590 |
||
591 |
"/ limit search if possible |
|
592 |
(classToCompileFor notNil |
|
593 |
and:[aReceiverNode isSelf or:[aReceiverNode isSuper]]) ifTrue:[ |
|
594 |
currentSuperclasses isNil ifTrue:[ |
|
595 |
currentSuperclasses := classToCompileFor withAllSuperclasses. |
|
596 |
]. |
|
597 |
ok := currentSuperclasses contains:check. |
|
598 |
(ok not and:[aReceiverNode isSelf]) ifTrue:[ |
|
599 |
currentSubclasses isNil ifTrue:[ |
|
600 |
currentSubclasses := classToCompileFor allSubclasses. |
|
601 |
]. |
|
602 |
ok := currentSubclasses contains:check. |
|
603 |
]. |
|
604 |
] ifFalse:[ |
|
605 |
aReceiverNode isConstant ifTrue:[ |
|
606 |
ok := aReceiverNode evaluate class withAllSuperclasses contains:check. |
|
607 |
] ifFalse:[ |
|
608 |
(aReceiverNode isGlobal |
|
609 |
and:[(rec := aReceiverNode evaluate) isBehavior]) ifTrue:[ |
|
610 |
ok := rec class withAllSuperclasses contains:check. |
|
611 |
] ifFalse:[ |
|
612 |
ok := Smalltalk allClasses contains:check |
|
613 |
] |
|
614 |
] |
|
615 |
]. |
|
1905 | 616 |
]. |
617 |
ok ifFalse:[ |
|
618 |
em := preferences unimplementedSelectorEmphasis. |
|
619 |
fg := preferences unimplementedSelectorColor. |
|
620 |
] ifTrue:[ |
|
621 |
(self controlFlowSelectors includesIdentical:selectorSymbol) ifTrue:[ |
|
622 |
em := preferences controlFlowSelectorEmphasis. |
|
2816
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
623 |
fg := preferences controlFlowSelectorColor |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
624 |
] ifFalse:[ |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
625 |
(self collectionEnumerationSelectors includesIdentical:selectorSymbol) ifTrue:[ |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
626 |
em := preferences collectionEnumerationSelectorEmphasis. |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
627 |
fg := preferences collectionEnumerationSelectorColor |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
628 |
]. |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
629 |
]. |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
630 |
em isNil ifTrue:[ |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
631 |
em := preferences selectorEmphasis |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
632 |
]. |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
633 |
fg isNil ifTrue:[ |
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
634 |
fg := preferences selectorColor |
1905 | 635 |
]. |
636 |
]. |
|
863 | 637 |
]. |
638 |
self |
|
639 |
markFrom:pos1 to:pos2 |
|
1553 | 640 |
withEmphasis:em |
641 |
color:fg |
|
863 | 642 |
|
2816
e8b84f6d7462
changed: #markSelector:from:to:receiverNode:
Claus Gittinger <cg@exept.de>
parents:
2811
diff
changeset
|
643 |
"Modified: / 14-02-2012 / 16:03:52 / cg" |
863 | 644 |
! |
645 |
||
662 | 646 |
markSelfFrom:pos1 to:pos2 |
647 |
self |
|
648 |
markFrom:pos1 to:pos2 |
|
1553 | 649 |
withEmphasis:(preferences selfEmphasis) |
650 |
color:(preferences selfColor) |
|
662 | 651 |
|
652 |
"Modified: / 31.3.1998 / 18:03:10 / cg" |
|
653 |
! |
|
654 |
||
655 |
markStringFrom:pos1 to:pos2 |
|
1802 | 656 |
cachedStringEmphasis isNil ifTrue:[ |
657 |
cachedStringEmphasis := preferences stringEmphasis. |
|
658 |
cachedStringColor := preferences stringColor. |
|
659 |
]. |
|
662 | 660 |
self |
661 |
markFrom:pos1 to:pos2 |
|
1802 | 662 |
withEmphasis:cachedStringEmphasis |
663 |
color:cachedStringColor |
|
662 | 664 |
|
665 |
"Modified: / 31.3.1998 / 18:03:18 / cg" |
|
666 |
! |
|
667 |
||
668 |
markSuperFrom:pos1 to:pos2 |
|
669 |
self |
|
670 |
markFrom:pos1 to:pos2 |
|
1553 | 671 |
withEmphasis:(preferences superEmphasis) |
672 |
color:(preferences superColor) |
|
662 | 673 |
|
674 |
"Modified: / 31.3.1998 / 18:03:26 / cg" |
|
675 |
! |
|
676 |
||
672 | 677 |
markSymbolFrom:pos1 to:pos2 |
678 |
self |
|
679 |
markFrom:pos1 to:pos2 |
|
1553 | 680 |
withEmphasis:(preferences symbolEmphasis) |
681 |
color:(preferences symbolColor) |
|
672 | 682 |
|
683 |
"Created: / 1.4.1998 / 12:56:47 / cg" |
|
684 |
"Modified: / 1.4.1998 / 12:58:00 / cg" |
|
685 |
! |
|
686 |
||
662 | 687 |
markThisContextFrom:pos1 to:pos2 |
688 |
self |
|
689 |
markFrom:pos1 to:pos2 |
|
1553 | 690 |
withEmphasis:(preferences thisContextEmphasis) |
691 |
color:(preferences thisContextColor) |
|
662 | 692 |
|
693 |
"Modified: / 31.3.1998 / 18:03:36 / cg" |
|
665 | 694 |
! |
695 |
||
696 |
markUnknownIdentifierFrom:pos1 to:pos2 |
|
697 |
self |
|
698 |
markFrom:pos1 to:pos2 |
|
1553 | 699 |
withEmphasis:(preferences unknownIdentifierEmphasis) |
700 |
color:(preferences unknownIdentifierColor) |
|
665 | 701 |
|
702 |
"Created: / 31.3.1998 / 19:09:26 / cg" |
|
703 |
"Modified: / 31.3.1998 / 19:10:30 / cg" |
|
686 | 704 |
! |
705 |
||
706 |
markVariable:v from:pos to:endPos |
|
707 |
"support for syntaxColoring" |
|
708 |
||
823 | 709 |
|type globalValue nameSym| |
686 | 710 |
|
711 |
type := v type. |
|
712 |
(type == #BlockArg |
|
713 |
or:[type == #MethodArg]) ifTrue:[ |
|
714 |
self markArgumentIdentifierFrom:pos to:endPos. |
|
715 |
^ self |
|
716 |
]. |
|
717 |
(type == #BlockVariable |
|
718 |
or:[type == #MethodVariable]) ifTrue:[ |
|
719 |
self markLocalIdentifierFrom:pos to:endPos. |
|
720 |
^ self |
|
721 |
]. |
|
722 |
(type == #GlobalVariable) ifTrue:[ |
|
823 | 723 |
nameSym := v name asSymbolIfInterned. |
724 |
nameSym notNil ifTrue:[ |
|
725 |
globalValue := Smalltalk at:nameSym ifAbsent:nil. |
|
726 |
]. |
|
822
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
727 |
globalValue isBehavior ifTrue:[ |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
728 |
self markGlobalClassIdentifierFrom:pos to:endPos. |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
729 |
] ifFalse:[ |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
730 |
self markGlobalIdentifierFrom:pos to:endPos. |
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
731 |
]. |
686 | 732 |
^ self |
733 |
]. |
|
1553 | 734 |
(type == #PoolVariable) ifTrue:[ |
735 |
self markPoolVariableIdentifierFrom:pos to:endPos. |
|
736 |
^ self |
|
737 |
]. |
|
870 | 738 |
(type == #ClassVariable) ifTrue:[ |
739 |
self markClassVariableIdentifierFrom:pos to:endPos. |
|
740 |
^ self |
|
741 |
]. |
|
686 | 742 |
(type == #InstanceVariable) ifTrue:[ |
743 |
self markInstVarIdentifierFrom:pos to:endPos. |
|
744 |
^ self |
|
745 |
]. |
|
746 |
||
747 |
self markIdentifierFrom:pos to:endPos. |
|
748 |
||
749 |
"Created: / 16.4.1998 / 18:49:34 / cg" |
|
822
a773bb72cbd6
added extra globalClassIdentifierColor & emphasis
Claus Gittinger <cg@exept.de>
parents:
794
diff
changeset
|
750 |
"Modified: / 4.3.1999 / 12:56:13 / cg" |
662 | 751 |
! ! |
752 |
||
753 |
!SyntaxHighlighter class methodsFor:'documentation'! |
|
754 |
||
755 |
version |
|
3147
09878a1be040
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
756 |
^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.70 2013-04-19 09:40:10 cg Exp $' |
2228 | 757 |
! |
758 |
||
759 |
version_CVS |
|
3147
09878a1be040
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
760 |
^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.70 2013-04-19 09:40:10 cg Exp $' |
662 | 761 |
! ! |
2997 | 762 |