author | Jan Vrany <jan.vrany@labware.com> |
Wed, 15 Sep 2021 21:56:16 +0100 | |
branch | jv |
changeset 19609 | a54d8409a28f |
parent 18226 | 346376844040 |
permissions | -rw-r--r-- |
10022 | 1 |
" |
10067 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
18226 | 3 |
COPYRIGHT (c) 2016 Jan Vrany |
19609
a54d8409a28f
Fix highligting selected selectors
Jan Vrany <jan.vrany@labware.com>
parents:
18226
diff
changeset
|
4 |
COPYRIGHT (c) 2021 LabWare |
10067 | 5 |
All Rights Reserved |
10022 | 6 |
|
10067 | 7 |
Permission is hereby granted, free of charge, to any person |
8 |
obtaining a copy of this software and associated documentation |
|
9 |
files (the 'Software'), to deal in the Software without |
|
10 |
restriction, including without limitation the rights to use, |
|
11 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
12 |
copies of the Software, and to permit persons to whom the |
|
13 |
Software is furnished to do so, subject to the following |
|
14 |
conditions: |
|
15 |
||
16 |
The above copyright notice and this permission notice shall be |
|
17 |
included in all copies or substantial portions of the Software. |
|
18 |
||
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
22 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
23 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
24 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
25 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
26 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10022 | 27 |
" |
28 |
"{ Package: 'stx:libtool' }" |
|
29 |
||
15446 | 30 |
"{ NameSpace: Smalltalk }" |
31 |
||
10022 | 32 |
SyntaxHighlighter subclass:#SyntaxHighlighter2 |
13844 | 33 |
instanceVariableNames:'elements lastVariableElements lastSelectorElement |
34 |
ignoreBadIdentifier' |
|
10022 | 35 |
classVariableNames:'' |
36 |
poolDictionaries:'' |
|
37 |
category:'Interface-CodeView-Syntax' |
|
38 |
! |
|
39 |
||
40 |
!SyntaxHighlighter2 class methodsFor:'documentation'! |
|
41 |
||
42 |
copyright |
|
43 |
" |
|
10067 | 44 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
18226 | 45 |
COPYRIGHT (c) 2016 Jan Vrany |
19609
a54d8409a28f
Fix highligting selected selectors
Jan Vrany <jan.vrany@labware.com>
parents:
18226
diff
changeset
|
46 |
COPYRIGHT (c) 2021 LabWare |
10067 | 47 |
All Rights Reserved |
48 |
||
49 |
Permission is hereby granted, free of charge, to any person |
|
50 |
obtaining a copy of this software and associated documentation |
|
51 |
files (the 'Software'), to deal in the Software without |
|
52 |
restriction, including without limitation the rights to use, |
|
53 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
54 |
copies of the Software, and to permit persons to whom the |
|
55 |
Software is furnished to do so, subject to the following |
|
56 |
conditions: |
|
10022 | 57 |
|
10067 | 58 |
The above copyright notice and this permission notice shall be |
59 |
included in all copies or substantial portions of the Software. |
|
60 |
||
61 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
62 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
63 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
64 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
65 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
66 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
67 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
68 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10022 | 69 |
" |
15446 | 70 |
! |
71 |
||
72 |
documentation |
|
73 |
" |
|
74 |
A slightly improved syntax highlighter. |
|
75 |
||
76 |
In addition to the inherited colorization, this one also remembers |
|
77 |
so called 'syntax elements' (variable tokens and selectors) and remembers |
|
78 |
them in a list. |
|
79 |
This can be later used by the codeView to highlight uses of a clicked-on |
|
80 |
variable or a clicked-on selector. |
|
81 |
Also this list could (but is not, at the moment) be used to forward/backward |
|
82 |
search for the next use of some variable. |
|
83 |
||
84 |
[caveat:] |
|
85 |
This code has a smell: there is a lot of code duplication, |
|
86 |
and most can be moved to the superclass. Actually, there is propably no |
|
87 |
reason to have both classes around, so why not integrate all into the superclass. |
|
88 |
" |
|
10022 | 89 |
! ! |
90 |
||
91 |
!SyntaxHighlighter2 class methodsFor:'highlighting'! |
|
92 |
||
12636 | 93 |
format:aString parsingWith:aBlock in:aClass elementsInto:elements |
94 |
"common code for formatStatementList, formatExpression, ... |
|
95 |
format (recolor) whatever is parsed in aBlock (within the context of a given class). |
|
96 |
Return the text containing font changes and color information. |
|
97 |
As a side effect, put syntax elements into the passed in elements container |
|
98 |
(for element-highlighting in codeView2)" |
|
10022 | 99 |
|
15446 | 100 |
"/ cg: I smell a wumpus: I don't think, all of this must be redefined - most is already there in the superclass. |
101 |
||
102 |
|parser tree text| |
|
10022 | 103 |
|
104 |
aString isNil ifTrue:[^ nil]. |
|
105 |
||
106 |
parser := self for:(ReadStream on:aString string) in:aClass. |
|
107 |
parser elements: elements. |
|
108 |
parser ignoreErrors:true. |
|
109 |
parser ignoreWarnings:true. |
|
110 |
parser sourceText:(text := aString string asText). |
|
111 |
"/ use an array here - this can be changed much faster using #at:put: |
|
112 |
text emphasisCollection:(Array new:aString size). |
|
113 |
||
114 |
parser nextToken. |
|
12636 | 115 |
tree := aBlock value:parser. |
10022 | 116 |
"/ now, convert the emphasis-array to a runArray |
117 |
text emphasisCollection:(text emphasis asRunArray). |
|
118 |
||
119 |
tree == #Error ifTrue:[ |
|
15446 | 120 |
^ self colorize:text forErrorAtPosition:parser sourceStream position withOriginal:aString |
10022 | 121 |
]. |
122 |
^ text |
|
123 |
||
124 |
" |
|
125 |
self |
|
12636 | 126 |
formatStatementList:'(1 + 2) max:5. 1 + 2' |
127 |
in:UndefinedObject |
|
128 |
elementsInto:(OrderedCollection new). |
|
129 |
" |
|
130 |
! |
|
131 |
||
132 |
formatClassDefinition:aString in:aClass elementsInto: elements |
|
133 |
"format (recolor) a class definition expression in a given class. |
|
134 |
Return the text containing font changes and color information." |
|
135 |
||
136 |
^ self formatExpression:aString in:aClass elementsInto: elements |
|
137 |
||
138 |
"Created: / 10-04-2011 / 18:18:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
139 |
! |
|
140 |
||
141 |
formatExpression:aString in:aClass elementsInto: elements |
|
142 |
"format (recolor) an expression in a given class. |
|
143 |
Return the text containing font changes and color information." |
|
144 |
||
15446 | 145 |
"/ cg: I smell a wumpus: I don't think, all of this must be redefined - most is already there in the superclass. |
146 |
||
147 |
|parser tree text| |
|
13844 | 148 |
|
149 |
aString isNil ifTrue:[^ nil]. |
|
150 |
||
151 |
parser := self for:(ReadStream on:aString string) in:aClass. |
|
152 |
parser elements: elements. |
|
153 |
parser ignoreErrors:true. |
|
154 |
parser ignoreWarnings:true. |
|
155 |
parser sourceText:(text := aString string asText). |
|
156 |
"/ use an array here - this can be changed much faster using #at:put: |
|
157 |
text emphasisCollection:(Array new:aString size). |
|
158 |
||
159 |
parser nextToken. |
|
15580 | 160 |
[ |
161 |
tree := parser "expression"statementList. |
|
162 |
] on:ParseError do:[ |
|
163 |
tree := #Error |
|
164 |
]. |
|
13844 | 165 |
"/ now, convert the emphasis-array to a runArray |
166 |
text emphasisCollection:(text emphasis asRunArray). |
|
167 |
||
168 |
tree == #Error ifTrue:[ |
|
15446 | 169 |
^ self colorize:text forErrorAtPosition:parser sourceStream position withOriginal:aString |
13844 | 170 |
]. |
171 |
^ text |
|
12636 | 172 |
|
173 |
" |
|
174 |
self |
|
14299 | 175 |
formatExpression:'(1 + 2) max:5' |
176 |
in:UndefinedObject |
|
10022 | 177 |
" |
13844 | 178 |
|
179 |
"Created: / 25-07-2010 / 08:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
180 |
"Modified: / 25-07-2010 / 10:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10022 | 181 |
! |
182 |
||
183 |
formatMethod:aString in:aClass using:preferencesOrNil elementsInto: elements |
|
184 |
"format (recolor) a method in a given class. |
|
185 |
Return the text containing font changes and color information." |
|
186 |
||
10152
561883853228
comment/format in: #formatMethod:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10150
diff
changeset
|
187 |
"/ obsolete interface |
10150
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
188 |
^ self |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
189 |
formatMethod:nil |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
190 |
source:aString |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
191 |
in:aClass |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
192 |
using:preferencesOrNil elementsInto:elements |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
193 |
|
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
194 |
"Created: / 25-07-2010 / 08:56:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10152
561883853228
comment/format in: #formatMethod:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10150
diff
changeset
|
195 |
"Modified (comment): / 05-07-2011 / 11:07:50 / cg" |
10150
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
196 |
! |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
197 |
|
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
198 |
formatMethod:aMethodOrNil source:aString in:aClass using:preferencesOrNil elementsInto: elements |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
199 |
"format (recolor) a method in a given class. |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
200 |
Return the text containing font changes and color information." |
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
201 |
|
15446 | 202 |
"/ cg: I smell a wumpus: I don't think, all of this must be redefined - most is already there in the superclass. |
203 |
||
204 |
|highlighter tree newText| |
|
10022 | 205 |
|
206 |
aString isNil ifTrue:[^ nil]. |
|
207 |
||
208 |
Error handle:[:ex | |
|
15446 | 209 |
"/ Transcript showCR:ex description. |
10022 | 210 |
(self parseErrorSignal handles:ex) ifFalse:[ |
15446 | 211 |
ex creator isHandled ifTrue:[ |
212 |
"/ Transcript showCR:'handled'. |
|
213 |
ex reject. |
|
214 |
]. |
|
10022 | 215 |
"Parse error may happen when re-formatting incomplete code while editing" |
216 |
('SyntaxHighlighter [info]: error during highlight: ' , ex description) infoPrintCR. |
|
217 |
"/ ex suspendedContext fullPrintAll. |
|
218 |
]. |
|
15446 | 219 |
highlighter notNil ifTrue:[ |
220 |
^ self colorize:(newText ? aString) forErrorAtPosition:highlighter sourceStream position withOriginal:aString |
|
221 |
]. |
|
10022 | 222 |
^ aString |
223 |
] do:[ |
|
15446 | 224 |
|sourceString| |
225 |
||
226 |
sourceString := aString string. |
|
227 |
newText := sourceString asUnicode16String asText. |
|
228 |
"/ use an array here (instead of the RunArray) - this can be changed much faster using #at:put: |
|
229 |
newText emphasisCollection:(Array new:sourceString size). |
|
230 |
||
231 |
highlighter := self for:(ReadStream on:sourceString) in:aClass. |
|
10022 | 232 |
highlighter elements: elements. |
233 |
preferencesOrNil notNil ifTrue:[highlighter preferences:preferencesOrNil]. |
|
234 |
"/ highlighter ignoreErrors:true. |
|
235 |
highlighter ignoreWarnings:true. |
|
15446 | 236 |
highlighter sourceText:newText. |
10022 | 237 |
|
238 |
tree := highlighter parseMethod. |
|
15446 | 239 |
newText := highlighter sourceText. "/ might have changed identity |
10022 | 240 |
"/ now, convert the emphasis-array to a runArray |
15446 | 241 |
newText emphasisCollection:(newText emphasis asRunArray). |
10022 | 242 |
|
243 |
tree == #Error ifTrue:[ |
|
15446 | 244 |
^ self colorize:newText forErrorAtPosition:highlighter sourceStream position withOriginal:aString |
245 |
]. |
|
246 |
^ newText |
|
247 |
] |
|
10022 | 248 |
|
249 |
" |
|
15446 | 250 |
self formatMethod:'foo |
10022 | 251 |
^ self bar:''hello''. |
252 |
||
253 |
' , (Character doubleQuote asString) , 'some comment' , (Character doubleQuote asString) , ' |
|
254 |
' |
|
255 |
in:UndefinedObject |
|
256 |
" |
|
257 |
||
258 |
"Modified: / 22-08-2006 / 13:32:04 / cg" |
|
10150
3792ee8840ea
added: #formatMethod:source:in:using:elementsInto:
Claus Gittinger <cg@exept.de>
parents:
10067
diff
changeset
|
259 |
"Created: / 05-07-2011 / 10:39:21 / cg" |
13844 | 260 |
"Modified: / 28-05-2013 / 22:45:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12636 | 261 |
! |
262 |
||
16128
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
263 |
formatStatements:aString in:aClass elementsInto: elements |
12636 | 264 |
"format (recolor) a statement list in a given class. |
265 |
Return the text containing font changes and color information." |
|
266 |
||
267 |
^ self |
|
16128
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
268 |
format:aString parsingWith:[:parser | parser parseMethodBody] |
12636 | 269 |
in:aClass elementsInto:elements |
270 |
||
271 |
" |
|
272 |
self |
|
16128
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
273 |
formatStatements:'(1 + 2) max:5. 1 + 2' |
12636 | 274 |
in:UndefinedObject |
275 |
elementsInto:(OrderedCollection new). |
|
276 |
" |
|
16128
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
277 |
|
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
278 |
"Created: / 22-02-2016 / 21:09:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 279 |
! ! |
280 |
||
281 |
!SyntaxHighlighter2 methodsFor:'accessing'! |
|
282 |
||
283 |
elements |
|
284 |
^ elements |
|
285 |
! |
|
286 |
||
15456 | 287 |
elements:aParseTreeIndexCollection |
10633 | 288 |
"the element collection, to collect variables, selectors etc. into" |
289 |
||
15456 | 290 |
elements := aParseTreeIndexCollection. |
10633 | 291 |
|
292 |
"Modified (comment): / 21-08-2011 / 09:13:31 / cg" |
|
13844 | 293 |
! |
294 |
||
295 |
tree: aParseNode |
|
296 |
super tree: aParseNode. |
|
297 |
elements tree: aParseNode |
|
298 |
||
299 |
"Created: / 16-02-2012 / 09:56:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10022 | 300 |
! ! |
301 |
||
302 |
!SyntaxHighlighter2 methodsFor:'initialization'! |
|
303 |
||
304 |
initialize |
|
305 |
||
306 |
super initialize. |
|
13844 | 307 |
elements := ParseTreeIndex new. |
10633 | 308 |
lastVariableElements := Dictionary new. |
10022 | 309 |
|
310 |
"Created: / 14-02-2010 / 13:08:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10633 | 311 |
"Modified: / 21-08-2011 / 09:37:35 / cg" |
13844 | 312 |
"Modified: / 16-02-2012 / 09:59:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 313 |
! ! |
314 |
||
315 |
!SyntaxHighlighter2 methodsFor:'parsing-expressions'! |
|
316 |
||
13844 | 317 |
_binaryExpressionFor:receiverArg |
318 |
"parse a binary-expression; return a node-tree, nil or #Error" |
|
319 |
||
320 |
|receiver expr arg sel pos1 pos2 lno| |
|
321 |
||
322 |
receiver := receiverArg. |
|
323 |
(receiver == #Error) ifTrue:[^ #Error]. |
|
324 |
||
325 |
"special kludge: since Scanner cannot know if -digit is a binary |
|
326 |
expression or a negative constant, handle cases here" |
|
327 |
||
328 |
[(tokenType == #BinaryOperator) |
|
329 |
or:[(tokenType == $|) |
|
330 |
or:[(tokenType == $^ and:[parserFlags allowCaretAsBinop]) |
|
14384 | 331 |
or:[((tokenType == #Integer) or:[tokenType == #Float]) |
332 |
and:[tokenValue < 0]]]] |
|
13844 | 333 |
] whileTrue:[ |
14384 | 334 |
"/ kludge alarm: in a function-call argList, #, is not a binarySelector |
335 |
inFunctionCallArgument == true ifTrue:[ |
|
336 |
((tokenType == #BinaryOperator) and:[tokenName = ',']) ifTrue:[ |
|
337 |
^ receiver |
|
338 |
]. |
|
339 |
]. |
|
13844 | 340 |
|
14384 | 341 |
pos1 := tokenPosition. |
342 |
lno := tokenLineNr. |
|
13844 | 343 |
|
14384 | 344 |
"/ kludge alarm: bar, caret and minus are not scanned as binop |
345 |
(tokenType == $|) ifTrue:[ |
|
346 |
sel := '|'. |
|
347 |
sel := self selectorCheck:sel for:receiver position:tokenPosition to:tokenPosition. |
|
348 |
self nextToken. |
|
349 |
] ifFalse:[ |
|
350 |
(tokenType == $^) ifTrue:[ |
|
351 |
sel := '^'. |
|
352 |
sel := self selectorCheck:sel for:receiver position:tokenPosition to:tokenPosition. |
|
353 |
self nextToken. |
|
354 |
] ifFalse:[ |
|
355 |
(tokenType == #BinaryOperator) ifTrue:[ |
|
356 |
sel := tokenName. |
|
357 |
sel := self selectorCheck:sel for:receiver position:tokenPosition to:(tokenPosition + tokenName size - 1). |
|
358 |
self nextToken |
|
359 |
] ifFalse:[ |
|
360 |
sel := '-'. |
|
361 |
token := tokenValue := tokenValue negated. |
|
362 |
tokenPosition := tokenPosition + 1. "/ to skip the sign |
|
363 |
] |
|
364 |
]. |
|
365 |
]. |
|
13844 | 366 |
|
14384 | 367 |
pos2 := pos1 + sel size - 1. |
368 |
self markSelector:sel from:pos1 to:pos2 receiverNode:receiver. |
|
369 |
lastSelectorElement := nil. |
|
13844 | 370 |
|
14384 | 371 |
arg := self unaryExpression. |
372 |
(arg == #Error) ifTrue:[^ #Error]. |
|
13844 | 373 |
|
14384 | 374 |
expr := BinaryNode receiver:receiver selector:sel arg:arg fold:foldConstants. |
375 |
expr isErrorNode ifTrue:[ |
|
376 |
self parseError:(expr errorString) position:pos1 to:tokenPosition. |
|
377 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
|
378 |
expr := BinaryNode receiver:receiver selector:sel arg:arg fold:nil. |
|
379 |
]. |
|
380 |
expr lineNumber:lno. |
|
381 |
expr selectorPosition:pos1. |
|
13844 | 382 |
|
14384 | 383 |
self checkPlausibilityOf:expr from:pos1 to:pos2. |
384 |
parseForCode ifFalse:[ |
|
385 |
self rememberSelectorUsed:sel receiver:receiver |
|
386 |
]. |
|
387 |
receiver := expr. "/ for next message |
|
13844 | 388 |
]. |
389 |
^ receiver |
|
390 |
||
391 |
"Modified: / 09-01-1998 / 19:05:18 / stefan" |
|
392 |
"Modified: / 14-02-2010 / 17:54:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
393 |
"Modified: / 19-01-2012 / 10:46:49 / cg" |
|
394 |
"Created: / 16-02-2012 / 21:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
395 |
! |
|
396 |
||
397 |
_keywordExpressionFor:receiverArg |
|
398 |
"parse a keyword-expression; return a node-tree, nil or #Error. |
|
399 |
||
400 |
keywordExpression ::= binaryexpression |
|
14384 | 401 |
| { KEYWORD-PART binaryExpression } |
13844 | 402 |
" |
403 |
||
404 |
|expr receiver sel arg args posR1 posR2 pos1 pos2 lno positions constVal| |
|
405 |
||
406 |
receiver := receiverArg. |
|
407 |
posR1 := tokenPosition. |
|
408 |
(tokenType == #Keyword) ifFalse:[^ receiver]. |
|
409 |
||
410 |
pos1 := posR2 := tokenPosition. |
|
411 |
pos2 := tokenPosition + tokenName size - 1. |
|
412 |
positions := OrderedCollection with:(pos1 to:pos2). |
|
413 |
sel := tokenName. |
|
414 |
lno := tokenLineNr. |
|
415 |
self nextToken. |
|
416 |
arg := self binaryExpression. |
|
417 |
(arg == #Error) ifTrue:[^ #Error]. |
|
418 |
args := Array with:arg. |
|
419 |
[tokenType == #Keyword] whileTrue:[ |
|
14384 | 420 |
sel := sel , tokenName. |
421 |
pos2 := tokenPosition + tokenName size - 1. |
|
422 |
positions add:(tokenPosition to:pos2). |
|
423 |
self nextToken. |
|
424 |
arg := self binaryExpression. |
|
425 |
(arg == #Error) ifTrue:[^ #Error]. |
|
426 |
args := args copyWith:arg. |
|
13844 | 427 |
]. |
428 |
||
429 |
positions do:[:p | |
|
14384 | 430 |
self markSelector:sel from:p start to:p stop receiverNode:receiver. |
13844 | 431 |
]. |
432 |
lastSelectorElement := nil. |
|
433 |
sel := self selectorCheck:sel for:receiver positions:positions. |
|
434 |
||
435 |
ignoreWarnings ifFalse:[ |
|
14384 | 436 |
(Class definitionSelectors includes:sel) ifTrue:[ |
437 |
(receiver isVariable and:[receiver isUndeclared]) ifTrue:[ |
|
438 |
"this is not an error - the undefined class may be loaded after this code!!" |
|
439 |
self warning:('as yet undefined superclass: ' , receiver name) position:pos1 to:pos2. |
|
440 |
]. |
|
441 |
]. |
|
13844 | 442 |
]. |
443 |
||
444 |
expr := MessageNode receiver:receiver selector:sel args:args fold:foldConstants. |
|
445 |
expr isErrorNode ifTrue:[ |
|
14384 | 446 |
self parseError:(expr errorString) position:pos1 to:pos2. |
447 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
|
448 |
expr := MessageNode receiver:receiver selector:sel args:args fold:nil. |
|
13844 | 449 |
]. |
450 |
expr lineNumber:lno. |
|
451 |
self checkPlausibilityOf:expr from:pos1 to:pos2. |
|
452 |
parseForCode ifFalse:[ |
|
14384 | 453 |
self rememberSelectorUsed:sel receiver:receiver |
13844 | 454 |
]. |
455 |
||
456 |
"/ (contextToEvaluateIn isNil and:[selfValue isNil]) ifTrue:[ "/ do not check this for doits |
|
457 |
"/ receiver isSuper ifTrue:[ |
|
458 |
"/ sel ~= selector ifTrue:[ |
|
459 |
"/ self warnCommonMistake:'possible bad super message (selector should be same as in current method) ?' |
|
460 |
"/ position:posR1 to:posR2-1 |
|
461 |
"/ ]. |
|
462 |
"/ ]. |
|
463 |
"/ ]. |
|
464 |
"/ |
|
465 |
||
466 |
(sel = #ifTrue: or:[sel = #ifFalse: or:[sel = #ifTrue:ifFalse: or:[sel = #ifFalse:ifTrue:]]]) ifTrue:[ |
|
14384 | 467 |
(expr receiver withConstantValueDo:[:val | constVal := val]) ifTrue:[ |
468 |
|indexOfArgNotExecuted| |
|
13844 | 469 |
|
14384 | 470 |
"/ receiver evaluates to a constant |
471 |
constVal == true ifTrue:[ |
|
472 |
(sel startsWith: #ifFalse:) ifTrue:[ |
|
473 |
indexOfArgNotExecuted := 1. |
|
474 |
] ifFalse:[ |
|
475 |
indexOfArgNotExecuted := 2. |
|
476 |
] |
|
477 |
]. |
|
478 |
constVal == false ifTrue:[ |
|
479 |
(sel startsWith: #ifTrue:) ifTrue:[ |
|
480 |
indexOfArgNotExecuted := 1. |
|
481 |
] ifFalse:[ |
|
482 |
indexOfArgNotExecuted := 2. |
|
483 |
] |
|
484 |
]. |
|
485 |
indexOfArgNotExecuted == 2 ifTrue:[ |
|
486 |
args size == 1 ifTrue:[ indexOfArgNotExecuted := nil] |
|
487 |
]. |
|
13844 | 488 |
|
14384 | 489 |
indexOfArgNotExecuted notNil ifTrue:[ |
490 |
|argIsNotExecuted| |
|
13844 | 491 |
|
14384 | 492 |
"/ self warning:'receiver is constant; arg',indexOfArgNotExecuted printString,' is never executed' position:pos1 to:tokenPosition. |
493 |
argIsNotExecuted := expr args at:indexOfArgNotExecuted. |
|
14489 | 494 |
argIsNotExecuted realNode isBlockNode ifTrue:[ |
14384 | 495 |
self markCommentFrom:argIsNotExecuted startPosition to:argIsNotExecuted endPosition. |
496 |
]. |
|
497 |
]. |
|
498 |
]. |
|
13844 | 499 |
]. |
500 |
||
501 |
(ignoreErrors or:[ignoreWarnings]) ifFalse:[ |
|
14384 | 502 |
(sel = #and: or:[sel = #or:]) ifTrue:[ |
503 |
expr arg1 isBlock ifFalse:[ |
|
504 |
(expr arg1 isVariable |
|
505 |
and:[ (expr arg1 name asLowercase includesString:'block')]) ifFalse:[ |
|
506 |
self warnCommonMistake:'(possible common mistake) missing block brackets ?' |
|
507 |
position:pos2+1 to:tokenPosition-1 |
|
508 |
] |
|
509 |
]. |
|
510 |
^ expr. |
|
511 |
]. |
|
13844 | 512 |
|
14384 | 513 |
(sel = #whileTrue: or:[sel = #whileFalse:]) ifTrue:[ |
514 |
expr receiver isBlock ifFalse:[ |
|
515 |
(expr receiver isVariable |
|
516 |
and:[ (expr receiver name asLowercase includesString:'block')]) ifFalse:[ |
|
517 |
self warnCommonMistake:'(possible common mistake) missing block brackets ?' |
|
518 |
position:pos1 to:pos2 |
|
519 |
] |
|
520 |
]. |
|
521 |
^ expr. |
|
522 |
]. |
|
13844 | 523 |
|
14384 | 524 |
(sel = #ifTrue: or:[sel = #ifFalse:]) ifTrue:[ |
525 |
expr receiver isMessage ifTrue:[ |
|
526 |
(expr receiver selector = #whileTrue or:[expr receiver selector = #whileFalse]) ifTrue:[ |
|
527 |
self warnCommonMistake:'strange receiver expression' |
|
528 |
position:pos1 to:pos2 |
|
529 |
]. |
|
530 |
]. |
|
531 |
^ expr |
|
532 |
]. |
|
13844 | 533 |
]. |
534 |
||
535 |
^ expr. |
|
536 |
||
537 |
"Modified: / 14-02-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
538 |
"Modified: / 19-01-2012 / 10:47:01 / cg" |
|
539 |
"Created: / 16-02-2012 / 21:54:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
540 |
! |
|
541 |
||
542 |
_unaryExpressionFor:receiverArg |
|
543 |
"parse a unary-expression; return a node-tree, nil or #Error" |
|
544 |
||
545 |
|receiver expr sel pos pos2 lNr arguments| |
|
546 |
||
547 |
receiver := receiverArg. |
|
548 |
(receiver == #Error) ifTrue:[^ #Error]. |
|
549 |
||
550 |
[ self isValidUnarySelector:tokenType ] whileTrue:[ |
|
14384 | 551 |
pos := tokenPosition. |
552 |
pos2 := pos + tokenName size - 1. |
|
553 |
lNr := tokenLineNr. |
|
554 |
sel := tokenName. |
|
13844 | 555 |
|
14384 | 556 |
self markSelector:sel from:pos to:pos2 receiverNode:receiver. |
557 |
lastSelectorElement := nil. |
|
13844 | 558 |
|
14384 | 559 |
self nextToken. |
560 |
tokenType == $( ifTrue:[ |
|
561 |
parserFlags allowSqueakExtensions == true ifTrue:[ |
|
562 |
"/ croquet/squeak extension - c/java-style arguments |
|
563 |
arguments := self functionCallArgList. |
|
564 |
"/ synthetic selector: foo[:[with:[with:[...]]]] |
|
565 |
arguments notEmpty ifTrue:[ |
|
566 |
sel := sel , ':'. |
|
567 |
arguments size - 1 timesRepeat:[ sel := sel , 'with:' ]. |
|
568 |
]. |
|
569 |
sel := self selectorCheck:sel for:receiver position:pos to:pos2. |
|
570 |
expr := MessageNode receiver:receiver selector:sel args:arguments fold:foldConstants. |
|
571 |
expr isErrorNode ifTrue:[ |
|
572 |
self parseError:(expr errorString) position:pos to:pos2. |
|
573 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
|
574 |
expr := MessageNode receiver:receiver selector:sel args:arguments fold:nil. |
|
575 |
]. |
|
576 |
expr lineNumber:lNr. |
|
577 |
self checkPlausibilityOf:expr from:pos to:pos2. |
|
578 |
parseForCode ifFalse:[ |
|
579 |
self rememberSelectorUsed:sel receiver:receiver |
|
580 |
]. |
|
581 |
^ expr. |
|
582 |
]. |
|
583 |
]. |
|
13844 | 584 |
|
14384 | 585 |
sel := self selectorCheck:sel for:receiver position:pos to:pos2. |
586 |
expr := UnaryNode receiver:receiver selector:sel fold:foldConstants. |
|
587 |
expr isErrorNode ifTrue:[ |
|
588 |
self warning:(expr errorString , '.\\If you proceed, that error will happen at runtime.') withCRs position:pos to:pos2. |
|
589 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
|
590 |
expr := UnaryNode receiver:receiver selector:sel fold:nil. |
|
591 |
]. |
|
592 |
expr lineNumber:lNr. |
|
13844 | 593 |
|
14384 | 594 |
self checkPlausibilityOf:expr from:pos to:pos2. |
595 |
parseForCode ifFalse:[ |
|
596 |
self rememberSelectorUsed:sel receiver:receiver |
|
597 |
]. |
|
13844 | 598 |
|
14384 | 599 |
receiver := expr. "/ for next message |
13844 | 600 |
]. |
601 |
^ receiver |
|
602 |
||
603 |
"Modified: / 14-02-2010 / 17:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
604 |
"Modified: / 19-01-2012 / 10:47:37 / cg" |
|
605 |
"Created: / 16-02-2012 / 21:54:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
606 |
! |
|
607 |
||
608 |
binaryExpression |
|
609 |
| node savedLastSelectorElement | |
|
610 |
||
611 |
savedLastSelectorElement := lastSelectorElement. |
|
612 |
lastSelectorElement := nil. |
|
613 |
node := super binaryExpression. |
|
614 |
(lastSelectorElement notNil and:[node ~~ #Error and:[node isMessage]]) ifTrue:[ |
|
615 |
lastSelectorElement node parent: node. |
|
616 |
]. |
|
617 |
lastSelectorElement := savedLastSelectorElement. |
|
618 |
^node |
|
619 |
||
620 |
"Modified: / 19-01-2000 / 16:22:16 / cg" |
|
621 |
"Created: / 16-02-2012 / 21:56:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
622 |
! |
|
623 |
||
10022 | 624 |
binaryExpressionFor:receiverArg |
625 |
"parse a binary-expression; return a node-tree, nil or #Error" |
|
626 |
||
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
627 |
|receiver expr arg sel pos1 pos2 lno| |
10022 | 628 |
|
629 |
receiver := receiverArg. |
|
630 |
(receiver == #Error) ifTrue:[^ #Error]. |
|
631 |
||
632 |
"special kludge: since Scanner cannot know if -digit is a binary |
|
633 |
expression or a negative constant, handle cases here" |
|
634 |
||
635 |
[(tokenType == #BinaryOperator) |
|
636 |
or:[(tokenType == $|) |
|
637 |
or:[(tokenType == $^ and:[parserFlags allowCaretAsBinop]) |
|
638 |
or:[((tokenType == #Integer) or:[tokenType == #Float]) |
|
639 |
and:[tokenValue < 0]]]] |
|
640 |
] whileTrue:[ |
|
641 |
"/ kludge alarm: in a function-call argList, #, is not a binarySelector |
|
642 |
inFunctionCallArgument == true ifTrue:[ |
|
643 |
((tokenType == #BinaryOperator) and:[tokenName = ',']) ifTrue:[ |
|
644 |
^ receiver |
|
645 |
]. |
|
646 |
]. |
|
647 |
||
648 |
pos1 := tokenPosition. |
|
649 |
lno := tokenLineNr. |
|
650 |
||
651 |
"/ kludge alarm: bar, caret and minus are not scanned as binop |
|
652 |
(tokenType == $|) ifTrue:[ |
|
653 |
sel := '|'. |
|
654 |
sel := self selectorCheck:sel for:receiver position:tokenPosition to:tokenPosition. |
|
655 |
self nextToken. |
|
656 |
] ifFalse:[ |
|
657 |
(tokenType == $^) ifTrue:[ |
|
658 |
sel := '^'. |
|
659 |
sel := self selectorCheck:sel for:receiver position:tokenPosition to:tokenPosition. |
|
660 |
self nextToken. |
|
661 |
] ifFalse:[ |
|
662 |
(tokenType == #BinaryOperator) ifTrue:[ |
|
663 |
sel := tokenName. |
|
664 |
sel := self selectorCheck:sel for:receiver position:tokenPosition to:(tokenPosition + tokenName size - 1). |
|
665 |
self nextToken |
|
666 |
] ifFalse:[ |
|
667 |
sel := '-'. |
|
668 |
token := tokenValue := tokenValue negated. |
|
669 |
tokenPosition := tokenPosition + 1. "/ to skip the sign |
|
670 |
] |
|
671 |
]. |
|
672 |
]. |
|
673 |
||
674 |
pos2 := pos1 + sel size - 1. |
|
675 |
self markSelector:sel from:pos1 to:pos2 receiverNode:receiver. |
|
676 |
lastSelectorElement := nil. |
|
677 |
||
678 |
arg := self unaryExpression. |
|
679 |
(arg == #Error) ifTrue:[^ #Error]. |
|
680 |
||
681 |
expr := BinaryNode receiver:receiver selector:sel arg:arg fold:foldConstants. |
|
682 |
expr isErrorNode ifTrue:[ |
|
683 |
self parseError:(expr errorString) position:pos1 to:tokenPosition. |
|
14384 | 684 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
10022 | 685 |
expr := BinaryNode receiver:receiver selector:sel arg:arg fold:nil. |
686 |
]. |
|
687 |
expr lineNumber:lno. |
|
688 |
expr selectorPosition:pos1. |
|
689 |
||
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
690 |
self checkPlausibilityOf:expr from:pos1 to:pos2. |
10022 | 691 |
receiver := expr. "/ for next message |
692 |
]. |
|
693 |
^ receiver |
|
694 |
||
695 |
"Modified: / 09-01-1998 / 19:05:18 / stefan" |
|
696 |
"Modified: / 14-02-2010 / 17:54:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
697 |
"Modified: / 19-01-2012 / 10:46:49 / cg" |
10022 | 698 |
! |
699 |
||
700 |
expression |
|
13844 | 701 |
| node savedLastSelectorElement | |
10022 | 702 |
|
13844 | 703 |
savedLastSelectorElement := lastSelectorElement. |
704 |
lastSelectorElement := nil. |
|
15456 | 705 |
|
13844 | 706 |
node := super expression. |
707 |
((node ~~ #Error) and:[node isMessage]) ifTrue:[ |
|
708 |
[ lastSelectorElement notNil ] whileTrue:[ |
|
709 |
lastSelectorElement node parent: node. |
|
15456 | 710 |
lastSelectorElement := lastSelectorElement previousElement. |
10022 | 711 |
]. |
712 |
]. |
|
13844 | 713 |
lastSelectorElement := savedLastSelectorElement. |
714 |
^node |
|
10022 | 715 |
|
716 |
"Modified: / 19-01-2000 / 16:22:16 / cg" |
|
13844 | 717 |
"Modified: / 16-02-2012 / 23:39:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 718 |
! |
719 |
||
720 |
keywordExpressionFor:receiverArg |
|
721 |
"parse a keyword-expression; return a node-tree, nil or #Error. |
|
722 |
||
723 |
keywordExpression ::= binaryexpression |
|
724 |
| { KEYWORD-PART binaryExpression } |
|
725 |
" |
|
726 |
||
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
727 |
|expr receiver sel arg args posR1 posR2 pos1 pos2 lno positions constVal| |
10022 | 728 |
|
729 |
receiver := receiverArg. |
|
730 |
posR1 := tokenPosition. |
|
731 |
(tokenType == #Keyword) ifFalse:[^ receiver]. |
|
732 |
||
733 |
pos1 := posR2 := tokenPosition. |
|
734 |
pos2 := tokenPosition + tokenName size - 1. |
|
735 |
positions := OrderedCollection with:(pos1 to:pos2). |
|
736 |
sel := tokenName. |
|
737 |
lno := tokenLineNr. |
|
738 |
self nextToken. |
|
739 |
arg := self binaryExpression. |
|
740 |
(arg == #Error) ifTrue:[^ #Error]. |
|
741 |
args := Array with:arg. |
|
742 |
[tokenType == #Keyword] whileTrue:[ |
|
743 |
sel := sel , tokenName. |
|
744 |
pos2 := tokenPosition + tokenName size - 1. |
|
745 |
positions add:(tokenPosition to:pos2). |
|
746 |
self nextToken. |
|
747 |
arg := self binaryExpression. |
|
748 |
(arg == #Error) ifTrue:[^ #Error]. |
|
749 |
args := args copyWith:arg. |
|
750 |
]. |
|
751 |
||
752 |
positions do:[:p | |
|
753 |
self markSelector:sel from:p start to:p stop receiverNode:receiver. |
|
754 |
]. |
|
755 |
lastSelectorElement := nil. |
|
756 |
sel := self selectorCheck:sel for:receiver positions:positions. |
|
757 |
||
758 |
ignoreWarnings ifFalse:[ |
|
759 |
(Class definitionSelectors includes:sel) ifTrue:[ |
|
760 |
(receiver isVariable and:[receiver isUndeclared]) ifTrue:[ |
|
761 |
"this is not an error - the undefined class may be loaded after this code!!" |
|
762 |
self warning:('as yet undefined superclass: ' , receiver name) position:pos1 to:pos2. |
|
763 |
]. |
|
764 |
]. |
|
765 |
]. |
|
766 |
||
767 |
expr := MessageNode receiver:receiver selector:sel args:args fold:foldConstants. |
|
768 |
expr isErrorNode ifTrue:[ |
|
769 |
self parseError:(expr errorString) position:pos1 to:pos2. |
|
14384 | 770 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
10022 | 771 |
expr := MessageNode receiver:receiver selector:sel args:args fold:nil. |
772 |
]. |
|
773 |
expr lineNumber:lno. |
|
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
774 |
self checkPlausibilityOf:expr from:pos1 to:pos2. |
10022 | 775 |
|
776 |
"/ (contextToEvaluateIn isNil and:[selfValue isNil]) ifTrue:[ "/ do not check this for doits |
|
777 |
"/ receiver isSuper ifTrue:[ |
|
778 |
"/ sel ~= selector ifTrue:[ |
|
779 |
"/ self warnCommonMistake:'possible bad super message (selector should be same as in current method) ?' |
|
780 |
"/ position:posR1 to:posR2-1 |
|
781 |
"/ ]. |
|
782 |
"/ ]. |
|
783 |
"/ ]. |
|
784 |
"/ |
|
785 |
||
786 |
(sel = #ifTrue: or:[sel = #ifFalse: or:[sel = #ifTrue:ifFalse: or:[sel = #ifFalse:ifTrue:]]]) ifTrue:[ |
|
787 |
(expr receiver withConstantValueDo:[:val | constVal := val]) ifTrue:[ |
|
788 |
|indexOfArgNotExecuted| |
|
789 |
||
790 |
"/ receiver evaluates to a constant |
|
791 |
constVal == true ifTrue:[ |
|
792 |
(sel startsWith: #ifFalse:) ifTrue:[ |
|
793 |
indexOfArgNotExecuted := 1. |
|
794 |
] ifFalse:[ |
|
795 |
indexOfArgNotExecuted := 2. |
|
796 |
] |
|
797 |
]. |
|
798 |
constVal == false ifTrue:[ |
|
799 |
(sel startsWith: #ifTrue:) ifTrue:[ |
|
800 |
indexOfArgNotExecuted := 1. |
|
801 |
] ifFalse:[ |
|
802 |
indexOfArgNotExecuted := 2. |
|
803 |
] |
|
804 |
]. |
|
805 |
indexOfArgNotExecuted == 2 ifTrue:[ |
|
806 |
args size == 1 ifTrue:[ indexOfArgNotExecuted := nil] |
|
807 |
]. |
|
808 |
||
809 |
indexOfArgNotExecuted notNil ifTrue:[ |
|
810 |
|argIsNotExecuted| |
|
811 |
||
812 |
"/ self warning:'receiver is constant; arg',indexOfArgNotExecuted printString,' is never executed' position:pos1 to:tokenPosition. |
|
813 |
argIsNotExecuted := expr args at:indexOfArgNotExecuted. |
|
14489 | 814 |
argIsNotExecuted realNode isBlockNode ifTrue:[ |
10022 | 815 |
self markCommentFrom:argIsNotExecuted startPosition to:argIsNotExecuted endPosition. |
816 |
]. |
|
817 |
]. |
|
818 |
]. |
|
819 |
]. |
|
820 |
||
821 |
(ignoreErrors or:[ignoreWarnings]) ifFalse:[ |
|
822 |
(sel = #and: or:[sel = #or:]) ifTrue:[ |
|
823 |
expr arg1 isBlock ifFalse:[ |
|
824 |
(expr arg1 isVariable |
|
825 |
and:[ (expr arg1 name asLowercase includesString:'block')]) ifFalse:[ |
|
826 |
self warnCommonMistake:'(possible common mistake) missing block brackets ?' |
|
827 |
position:pos2+1 to:tokenPosition-1 |
|
828 |
] |
|
829 |
]. |
|
830 |
^ expr. |
|
831 |
]. |
|
832 |
||
833 |
(sel = #whileTrue: or:[sel = #whileFalse:]) ifTrue:[ |
|
834 |
expr receiver isBlock ifFalse:[ |
|
835 |
(expr receiver isVariable |
|
836 |
and:[ (expr receiver name asLowercase includesString:'block')]) ifFalse:[ |
|
837 |
self warnCommonMistake:'(possible common mistake) missing block brackets ?' |
|
838 |
position:pos1 to:pos2 |
|
839 |
] |
|
840 |
]. |
|
841 |
^ expr. |
|
842 |
]. |
|
843 |
||
844 |
(sel = #ifTrue: or:[sel = #ifFalse:]) ifTrue:[ |
|
845 |
expr receiver isMessage ifTrue:[ |
|
846 |
(expr receiver selector = #whileTrue or:[expr receiver selector = #whileFalse]) ifTrue:[ |
|
847 |
self warnCommonMistake:'strange receiver expression' |
|
848 |
position:pos1 to:pos2 |
|
849 |
]. |
|
850 |
]. |
|
851 |
^ expr |
|
852 |
]. |
|
853 |
]. |
|
854 |
||
855 |
^ expr. |
|
856 |
||
857 |
"Modified: / 14-02-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
858 |
"Modified: / 19-01-2012 / 10:47:01 / cg" |
10022 | 859 |
! |
860 |
||
861 |
unaryExpressionFor:receiverArg |
|
862 |
"parse a unary-expression; return a node-tree, nil or #Error" |
|
863 |
||
13844 | 864 |
|receiver expr sel pos pos2 lNr arguments savedLastSelectorElement| |
10022 | 865 |
|
13844 | 866 |
savedLastSelectorElement := lastSelectorElement. |
10022 | 867 |
receiver := receiverArg. |
868 |
(receiver == #Error) ifTrue:[^ #Error]. |
|
869 |
||
870 |
[ self isValidUnarySelector:tokenType ] whileTrue:[ |
|
14384 | 871 |
pos := tokenPosition. |
872 |
pos2 := pos + tokenName size - 1. |
|
873 |
lNr := tokenLineNr. |
|
874 |
sel := tokenName. |
|
10022 | 875 |
|
14384 | 876 |
lastSelectorElement := nil. |
877 |
self markSelector:sel from:pos to:pos2 receiverNode:receiver. |
|
10022 | 878 |
|
14384 | 879 |
self nextToken. |
880 |
tokenType == $( ifTrue:[ |
|
881 |
parserFlags allowSqueakExtensions == true ifTrue:[ |
|
882 |
"/ croquet/squeak extension - c/java-style arguments |
|
883 |
arguments := self functionCallArgList. |
|
884 |
"/ synthetic selector: foo[:[with:[with:[...]]]] |
|
885 |
arguments notEmpty ifTrue:[ |
|
886 |
sel := sel , ':'. |
|
887 |
arguments size - 1 timesRepeat:[ sel := sel , 'with:' ]. |
|
888 |
]. |
|
889 |
sel := self selectorCheck:sel for:receiver position:pos to:pos2. |
|
890 |
expr := MessageNode receiver:receiver selector:sel args:arguments fold:foldConstants. |
|
891 |
expr isErrorNode ifTrue:[ |
|
892 |
self parseError:(expr errorString) position:pos to:pos2. |
|
893 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
|
894 |
expr := MessageNode receiver:receiver selector:sel args:arguments fold:nil. |
|
895 |
]. |
|
896 |
lastSelectorElement node parent: expr. |
|
897 |
expr lineNumber:lNr. |
|
898 |
self checkPlausibilityOf:expr from:pos to:pos2. |
|
899 |
parseForCode ifFalse:[ |
|
900 |
self rememberSelectorUsed:sel receiver:receiver |
|
901 |
]. |
|
902 |
^ expr. |
|
903 |
]. |
|
904 |
]. |
|
10022 | 905 |
|
14384 | 906 |
sel := self selectorCheck:sel for:receiver position:pos to:pos2. |
907 |
expr := UnaryNode receiver:receiver selector:sel fold:foldConstants. |
|
908 |
expr isErrorNode ifTrue:[ |
|
909 |
self warning:(expr errorString , '.\\If you proceed, that error will happen at runtime.') withCRs position:pos to:pos2. |
|
910 |
self clearErrorFlag. "ok, user wants it - so he'll get it" |
|
911 |
expr := UnaryNode receiver:receiver selector:sel fold:nil. |
|
912 |
]. |
|
913 |
expr lineNumber:lNr. |
|
914 |
lastSelectorElement node parent: expr. |
|
10022 | 915 |
|
14384 | 916 |
self checkPlausibilityOf:expr from:pos to:pos2. |
917 |
parseForCode ifFalse:[ |
|
918 |
self rememberSelectorUsed:sel receiver:receiver |
|
919 |
]. |
|
10022 | 920 |
|
14384 | 921 |
receiver := expr. "/ for next message |
10022 | 922 |
]. |
13844 | 923 |
lastSelectorElement := savedLastSelectorElement. |
10022 | 924 |
^ receiver |
925 |
||
11152
c9a386e4f1e0
refactored plausibility checks
Claus Gittinger <cg@exept.de>
parents:
10882
diff
changeset
|
926 |
"Modified: / 19-01-2012 / 10:47:37 / cg" |
13844 | 927 |
"Created: / 16-02-2012 / 23:50:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 928 |
! ! |
929 |
||
930 |
!SyntaxHighlighter2 methodsFor:'syntax detection'! |
|
931 |
||
15456 | 932 |
markBlockArgumentIdentifierFrom:pos1 to:pos2 |
933 |
"in addition to marking, remember the variable reference" |
|
934 |
||
935 |
| node | |
|
936 |
||
937 |
super markBlockArgumentIdentifierFrom:pos1 to:pos2. |
|
938 |
||
939 |
node := VariableNode blockArgumentNamed:(sourceText string copyFrom: pos1 to: pos2). |
|
940 |
node block:currentBlock. |
|
941 |
self rememberVariableElementFor: node from:pos1 to:pos2 assigned:false |
|
942 |
! |
|
943 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
944 |
markLocalVariableDeclaration: name from:pos1 to:pos2 |
15456 | 945 |
"in addition to marking, remember the variable reference" |
946 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
947 |
| type node | |
13844 | 948 |
|
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
949 |
super markLocalVariableDeclaration: name from:pos1 to:pos2. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
950 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
951 |
type := currentBlock notNil ifTrue:[#BlockVariable] ifFalse:[#MethodVariable]. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
952 |
node := VariableNode type: type name: name. |
15456 | 953 |
node block:currentBlock. "/ which is nil for method locals |
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
954 |
self rememberVariableElementFor: node from: pos1 to: pos2 assigned: false. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
955 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
956 |
"Created: / 25-02-2014 / 20:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
957 |
! |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
958 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
959 |
markMethodArgumentIdentifierFrom:pos1 to:pos2 |
15456 | 960 |
"in addition to marking, remember the variable reference" |
961 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
962 |
| node | |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
963 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
964 |
super markMethodArgumentIdentifierFrom:pos1 to:pos2. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
965 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
966 |
node := VariableNode methodArgumentNamed:(sourceText string copyFrom: pos1 to: pos2). |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
967 |
self rememberVariableElementFor: node from:pos1 to:pos2 assigned:false |
13844 | 968 |
|
969 |
"Created: / 24-07-2010 / 09:25:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
970 |
"Modified: / 21-08-2011 / 09:27:26 / cg" |
|
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
971 |
"Modified: / 25-02-2014 / 12:15:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 972 |
! |
973 |
||
974 |
markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode |
|
12672 | 975 |
| element selectorSymbol | |
10022 | 976 |
|
13844 | 977 |
"Special hack for Java class references - I would like to have them |
978 |
marked specially (and not as an error when the class is not yet loaded - |
|
979 |
the code is correct as JavaClassAccessor loads it lazily" |
|
980 |
(aReceiverNode isJavaPackageReference) ifTrue:[ |
|
15456 | 981 |
self |
982 |
markFrom:pos1 to:pos2 |
|
983 |
withEmphasis:preferences globalClassIdentifierEmphasis |
|
984 |
color: preferences globalClassIdentifierColor |
|
13844 | 985 |
] ifFalse:[ |
15456 | 986 |
super markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode. |
13844 | 987 |
]. |
988 |
||
12672 | 989 |
"don't create symbols for partial typed selectors" |
990 |
selectorSymbol := selectorString asSymbolIfInterned. |
|
10022 | 991 |
|
15714 | 992 |
element := elements newElementFor: (SelectorNode value: selectorSymbol ? selectorString from: pos1 to: pos2). |
13844 | 993 |
|
19609
a54d8409a28f
Fix highligting selected selectors
Jan Vrany <jan.vrany@labware.com>
parents:
18226
diff
changeset
|
994 |
(lastSelectorElement notNil and:[lastSelectorElement value = selectorString]) ifTrue:[ |
15456 | 995 |
lastSelectorElement nextElement: element. |
13844 | 996 |
]. |
10022 | 997 |
elements add: element. |
13844 | 998 |
lastSelectorElement := "(self isValidUnarySelector:tokenType)"false |
15456 | 999 |
ifTrue:[nil] |
1000 |
ifFalse:[element]. |
|
10022 | 1001 |
|
1002 |
"Created: / 14-02-2010 / 17:40:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10633 | 1003 |
"Modified (format): / 21-08-2011 / 09:18:21 / cg" |
13844 | 1004 |
"Modified: / 19-04-2012 / 09:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19609
a54d8409a28f
Fix highligting selected selectors
Jan Vrany <jan.vrany@labware.com>
parents:
18226
diff
changeset
|
1005 |
"Modified: / 15-09-2021 / 21:54:54 / Jan Vrany <jan.vrany@labware.com>" |
10633 | 1006 |
! |
1007 |
||
1008 |
markSelfFrom:pos1 to:pos2 |
|
15456 | 1009 |
"in addition to marking, remember the variable reference" |
1010 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1011 |
| node | |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1012 |
|
10633 | 1013 |
super markSelfFrom:pos1 to:pos2. |
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1014 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1015 |
node := SelfNode new. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1016 |
node type: #Self. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1017 |
self rememberVariableElementFor: node from:pos1 to:pos2 assigned:false |
10633 | 1018 |
|
1019 |
"Created: / 21-08-2011 / 09:15:45 / cg" |
|
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1020 |
"Modified: / 25-02-2014 / 21:56:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1021 |
! |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1022 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1023 |
markSuperFrom:pos1 to:pos2 |
15456 | 1024 |
"in addition to marking, remember the variable reference" |
1025 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1026 |
| node | |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1027 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1028 |
super markSuperFrom:pos1 to:pos2. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1029 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1030 |
node := SuperNode new. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1031 |
node type: #Super. |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1032 |
self rememberVariableElementFor: node from:pos1 to:pos2 assigned:false |
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1033 |
|
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1034 |
"Created: / 25-02-2014 / 21:57:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 1035 |
! |
1036 |
||
1037 |
markUnknownIdentifierFrom:pos1 to:pos2 |
|
1038 |
||
13844 | 1039 |
ignoreBadIdentifier == true ifTrue:[ ^ self ]. |
10022 | 1040 |
|
13844 | 1041 |
super markUnknownIdentifierFrom:pos1 to:pos2 |
1042 |
||
1043 |
"Created: / 31.3.1998 / 19:09:26 / cg" |
|
1044 |
"Modified: / 31.3.1998 / 19:10:30 / cg" |
|
10022 | 1045 |
! |
1046 |
||
12911 | 1047 |
markVariable:v from:pos1 to:pos2 assigned:assigned |
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1048 |
self rememberVariableElementFor:v from:pos1 to:pos2 assigned:assigned. |
12911 | 1049 |
super markVariable:v from:pos1 to:pos2 assigned:assigned. |
10022 | 1050 |
|
1051 |
"Created: / 25-06-2010 / 13:03:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10633 | 1052 |
"Modified: / 21-08-2011 / 09:26:30 / cg" |
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1053 |
"Modified: / 25-02-2014 / 14:07:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10633 | 1054 |
! |
1055 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1056 |
rememberVariableElementFor:node from:pos1 to:pos2 assigned:assigned |
15473 | 1057 |
|name typeSymbol key element prev dict| |
15456 | 1058 |
|
1059 |
node startPosition: pos1 endPosition: pos2. |
|
12911 | 1060 |
|
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1061 |
name := node name. |
15456 | 1062 |
typeSymbol := key := node type. |
15473 | 1063 |
|
15456 | 1064 |
(typeSymbol == #BlockArg or:[typeSymbol == #BlockVariable]) ifTrue:[ |
15473 | 1065 |
key := (typeSymbol -> currentBlock "node block") |
15456 | 1066 |
]. |
1067 |
||
15473 | 1068 |
dict := lastVariableElements at:key ifAbsentPut:[Dictionary new]. |
1069 |
prev := dict at:name ifAbsent:[nil]. |
|
12987 | 1070 |
(prev notNil and:[prev start == pos1]) ifTrue:[ |
15456 | 1071 |
"/ prev assigned:assigned. |
12987 | 1072 |
^ self |
1073 |
]. |
|
11458
8fdf55d6d1c8
changed: #rememberVariableElementFor:type:from:to:
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
1074 |
|
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1075 |
element := elements newElementFor: node. |
10633 | 1076 |
|
15456 | 1077 |
prev notNil ifTrue:[prev nextElement:element]. |
15473 | 1078 |
dict at:name put:element. |
10633 | 1079 |
|
1080 |
elements add: element. |
|
1081 |
||
14056
1b0f6f3c4bbd
Cleanup - Use ParseTreeIndex consistently. Fixes some minor issues when building
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13844
diff
changeset
|
1082 |
"Created: / 25-02-2014 / 12:13:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10022 | 1083 |
! ! |
1084 |
||
1085 |
!SyntaxHighlighter2 class methodsFor:'documentation'! |
|
1086 |
||
12984 | 1087 |
version |
15714 | 1088 |
^ '$Header$' |
12984 | 1089 |
! |
1090 |
||
10022 | 1091 |
version_CVS |
15714 | 1092 |
^ '$Header$' |
10022 | 1093 |
! |
1094 |
||
16128
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
1095 |
version_HG |
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
1096 |
|
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
1097 |
^ '$Changeset: <not expanded> $' |
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
1098 |
! |
e7b59cfeb8f3
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15720
diff
changeset
|
1099 |
|
10022 | 1100 |
version_SVN |
15714 | 1101 |
^ '$Id$' |
10022 | 1102 |
! ! |
12636 | 1103 |