SyntaxHighlighter.st
changeset 1553 1657d0843c64
parent 1550 aed158a284b7
child 1636 98afdcdacde8
equal deleted inserted replaced
1552:8ee631830fb7 1553:1657d0843c64
   293 !SyntaxHighlighter methodsFor:'syntax detection'!
   293 !SyntaxHighlighter methodsFor:'syntax detection'!
   294 
   294 
   295 markArgumentIdentifierFrom:pos1 to:pos2
   295 markArgumentIdentifierFrom:pos1 to:pos2
   296     self 
   296     self 
   297         markFrom:pos1 to:pos2 
   297         markFrom:pos1 to:pos2 
   298         withEmphasis:(preferences argumentIdentifierEmphasis) color:(preferences argumentIdentifierColor)
   298         withEmphasis:(preferences argumentIdentifierEmphasis) 
       
   299         color:(preferences argumentIdentifierColor)
   299 
   300 
   300     "Modified: / 31.3.1998 / 18:01:27 / cg"
   301     "Modified: / 31.3.1998 / 18:01:27 / cg"
   301 !
   302 !
   302 
   303 
   303 markBadIdentifierFrom:pos1 to:pos2
   304 markBadIdentifierFrom:pos1 to:pos2
   304     self 
   305     self 
   305         markFrom:pos1 to:pos2 
   306         markFrom:pos1 to:pos2 
   306         withEmphasis:(preferences badIdentifierEmphasis) color:(preferences badIdentifierColor)
   307         withEmphasis:(preferences badIdentifierEmphasis) 
       
   308         color:(preferences badIdentifierColor)
   307 !
   309 !
   308 
   310 
   309 markBooleanConstantFrom:pos1 to:pos2
   311 markBooleanConstantFrom:pos1 to:pos2
   310     self 
   312     self 
   311         markFrom:pos1 to:pos2 
   313         markFrom:pos1 to:pos2 
   312         withEmphasis:(preferences booleanConstantEmphasis) color:(preferences booleanConstantColor)
   314         withEmphasis:(preferences booleanConstantEmphasis) 
       
   315         color:(preferences booleanConstantColor)
   313 
   316 
   314     "Created: / 31.3.1998 / 18:09:01 / cg"
   317     "Created: / 31.3.1998 / 18:09:01 / cg"
   315     "Modified: / 31.3.1998 / 19:36:44 / cg"
   318     "Modified: / 31.3.1998 / 19:36:44 / cg"
   316 !
   319 !
   317 
   320 
   318 markBracketAt:pos
   321 markBracketAt:pos
   319     self 
   322     self 
   320         markFrom:pos to:pos 
   323         markFrom:pos to:pos 
   321         withEmphasis:(preferences bracketEmphasis) color:(preferences bracketColor)
   324         withEmphasis:(preferences bracketEmphasis) 
       
   325         color:(preferences bracketColor)
   322 
   326 
   323     "Created: / 31.3.1998 / 18:09:01 / cg"
   327     "Created: / 31.3.1998 / 18:09:01 / cg"
   324     "Modified: / 31.3.1998 / 19:36:44 / cg"
   328     "Modified: / 31.3.1998 / 19:36:44 / cg"
   325 !
   329 !
   326 
   330 
   327 markClassVariableIdentifierFrom:pos1 to:pos2
   331 markClassVariableIdentifierFrom:pos1 to:pos2
   328     self 
   332     self 
   329         markFrom:pos1 to:pos2 
   333         markFrom:pos1 to:pos2 
   330         withEmphasis:(preferences classVariableIdentifierEmphasis) color:(preferences classVariableIdentifierColor)
   334         withEmphasis:(preferences classVariableIdentifierEmphasis) 
       
   335         color:(preferences classVariableIdentifierColor)
   331 
   336 
   332     "Modified: / 31.3.1998 / 18:02:14 / cg"
   337     "Modified: / 31.3.1998 / 18:02:14 / cg"
   333 !
   338 !
   334 
   339 
   335 markCommentFrom:pos1 to:pos2
   340 markCommentFrom:pos1 to:pos2
   336     self 
   341     self 
   337         markFrom:pos1 to:pos2 
   342         markFrom:pos1 to:pos2 
   338         withEmphasis:(preferences commentEmphasis) color:(preferences commentColor)
   343         withEmphasis:(preferences commentEmphasis) 
       
   344         color:(preferences commentColor)
   339 
   345 
   340     "
   346     "
   341      UserPreferences current commentEmphasis
   347      UserPreferences current commentEmphasis
   342     "
   348     "
   343     "Modified: / 31.3.1998 / 18:01:55 / cg"
   349     "Modified: / 31.3.1998 / 18:01:55 / cg"
   344 !
   350 !
   345 
   351 
   346 markConstantFrom:pos1 to:pos2
   352 markConstantFrom:pos1 to:pos2
   347     self 
   353     self 
   348         markFrom:pos1 to:pos2 
   354         markFrom:pos1 to:pos2 
   349         withEmphasis:(preferences constantEmphasis) color:(preferences constantColor)
   355         withEmphasis:(preferences constantEmphasis) 
       
   356         color:(preferences constantColor)
   350 
   357 
   351     "Modified: / 31.3.1998 / 18:01:44 / cg"
   358     "Modified: / 31.3.1998 / 18:01:44 / cg"
   352     "Created: / 31.3.1998 / 18:09:22 / cg"
   359     "Created: / 31.3.1998 / 18:09:22 / cg"
   353 !
   360 !
   354 
   361 
   378 !
   385 !
   379 
   386 
   380 markGlobalClassIdentifierFrom:pos1 to:pos2
   387 markGlobalClassIdentifierFrom:pos1 to:pos2
   381     self 
   388     self 
   382         markFrom:pos1 to:pos2 
   389         markFrom:pos1 to:pos2 
   383         withEmphasis:(preferences globalClassIdentifierEmphasis) color:(preferences globalClassIdentifierColor)
   390         withEmphasis:(preferences globalClassIdentifierEmphasis) 
       
   391         color:(preferences globalClassIdentifierColor)
   384 
   392 
   385     "Modified: / 31.3.1998 / 18:02:14 / cg"
   393     "Modified: / 31.3.1998 / 18:02:14 / cg"
   386     "Created: / 4.3.1999 / 12:53:02 / cg"
   394     "Created: / 4.3.1999 / 12:53:02 / cg"
   387 !
   395 !
   388 
   396 
   389 markGlobalIdentifierFrom:pos1 to:pos2
   397 markGlobalIdentifierFrom:pos1 to:pos2
   390     self 
   398     self 
   391         markFrom:pos1 to:pos2 
   399         markFrom:pos1 to:pos2 
   392         withEmphasis:(preferences globalIdentifierEmphasis) color:(preferences globalIdentifierColor)
   400         withEmphasis:(preferences globalIdentifierEmphasis) 
       
   401         color:(preferences globalIdentifierColor)
   393 
   402 
   394     "Modified: / 31.3.1998 / 18:02:14 / cg"
   403     "Modified: / 31.3.1998 / 18:02:14 / cg"
   395 !
   404 !
   396 
   405 
   397 markHereFrom:pos1 to:pos2
   406 markHereFrom:pos1 to:pos2
   398     self 
   407     self 
   399         markFrom:pos1 to:pos2 
   408         markFrom:pos1 to:pos2 
   400         withEmphasis:(preferences hereEmphasis) color:(preferences hereColor)
   409         withEmphasis:(preferences hereEmphasis) 
       
   410         color:(preferences hereColor)
   401 
   411 
   402     "Modified: / 31.3.1998 / 18:02:25 / cg"
   412     "Modified: / 31.3.1998 / 18:02:25 / cg"
   403 !
   413 !
   404 
   414 
   405 markIdentifierFrom:pos1 to:pos2
   415 markIdentifierFrom:pos1 to:pos2
   406     self 
   416     self 
   407         markFrom:pos1 to:pos2 
   417         markFrom:pos1 to:pos2 
   408         withEmphasis:(preferences identifierEmphasis) color:(preferences identifierColor)
   418         withEmphasis:(preferences identifierEmphasis) 
       
   419         color:(preferences identifierColor)
   409 
   420 
   410     "Modified: / 31.3.1998 / 18:02:39 / cg"
   421     "Modified: / 31.3.1998 / 18:02:39 / cg"
   411     "Created: / 31.3.1998 / 18:04:56 / cg"
   422     "Created: / 31.3.1998 / 18:04:56 / cg"
   412 !
   423 !
   413 
   424 
   414 markInstVarIdentifierFrom:pos1 to:pos2
   425 markInstVarIdentifierFrom:pos1 to:pos2
   415     self 
   426     self 
   416         markFrom:pos1 to:pos2 
   427         markFrom:pos1 to:pos2 
   417         withEmphasis:(preferences instVarIdentifierEmphasis) color:(preferences instVarIdentifierColor)
   428         withEmphasis:(preferences instVarIdentifierEmphasis)    
       
   429         color:(preferences instVarIdentifierColor)
   418 
   430 
   419     "Created: / 16.4.1998 / 18:35:40 / cg"
   431     "Created: / 16.4.1998 / 18:35:40 / cg"
   420     "Modified: / 16.4.1998 / 18:37:30 / cg"
   432     "Modified: / 16.4.1998 / 18:37:30 / cg"
   421 !
   433 !
   422 
   434 
   423 markLocalIdentifierFrom:pos1 to:pos2
   435 markLocalIdentifierFrom:pos1 to:pos2
   424     self 
   436     self 
   425         markFrom:pos1 to:pos2 
   437         markFrom:pos1 to:pos2 
   426         withEmphasis:(preferences localIdentifierEmphasis) color:(preferences localIdentifierColor)
   438         withEmphasis:(preferences localIdentifierEmphasis) 
       
   439         color:(preferences localIdentifierColor)
   427 
   440 
   428     "Modified: / 31.3.1998 / 18:02:39 / cg"
   441     "Modified: / 31.3.1998 / 18:02:39 / cg"
   429 !
   442 !
   430 
   443 
   431 markMethodSelectorFrom:pos1 to:pos2
   444 markMethodSelectorFrom:pos1 to:pos2
   432     self 
   445     self 
   433         markFrom:pos1 to:pos2 
   446         markFrom:pos1 to:pos2 
   434         withEmphasis:(preferences methodSelectorEmphasis) color:(preferences methodSelectorColor)
   447         withEmphasis:(preferences methodSelectorEmphasis) 
       
   448         color:(preferences methodSelectorColor)
   435 
   449 
   436     "Modified: / 31.3.1998 / 18:02:52 / cg"
   450     "Modified: / 31.3.1998 / 18:02:52 / cg"
   437 !
   451 !
   438 
   452 
       
   453 markPoolVariableIdentifierFrom:pos1 to:pos2
       
   454     self 
       
   455         markFrom:pos1 to:pos2 
       
   456         withEmphasis:(preferences poolVariableIdentifierEmphasis) 
       
   457         color:(preferences poolVariableIdentifierColor)
       
   458 !
       
   459 
   439 markReturnAt:pos
   460 markReturnAt:pos
   440     self 
   461     self 
   441         markFrom:pos to:pos 
   462         markFrom:pos to:pos 
   442         withEmphasis:(preferences returnEmphasis) color:(preferences returnColor)
   463         withEmphasis:(preferences returnEmphasis) 
       
   464         color:(preferences returnColor)
   443 
   465 
   444     "Modified: / 31.3.1998 / 19:36:44 / cg"
   466     "Modified: / 31.3.1998 / 19:36:44 / cg"
   445     "Created: / 5.1.1980 / 00:44:27 / cg"
   467     "Created: / 5.1.1980 / 00:44:27 / cg"
   446 !
   468 !
   447 
   469 
   510             ]
   532             ]
   511         ]
   533         ]
   512     ].
   534     ].
   513     self
   535     self
   514         markFrom:pos1 to:pos2 
   536         markFrom:pos1 to:pos2 
   515         withEmphasis:em color:fg
   537         withEmphasis:em 
       
   538         color:fg
   516 
   539 
   517     "Modified: / 1.4.1998 / 13:14:43 / cg"
   540     "Modified: / 1.4.1998 / 13:14:43 / cg"
   518 !
   541 !
   519 
   542 
   520 markSelfFrom:pos1 to:pos2
   543 markSelfFrom:pos1 to:pos2
   521     self 
   544     self 
   522         markFrom:pos1 to:pos2 
   545         markFrom:pos1 to:pos2 
   523         withEmphasis:(preferences selfEmphasis) color:(preferences selfColor)
   546         withEmphasis:(preferences selfEmphasis) 
       
   547         color:(preferences selfColor)
   524 
   548 
   525     "Modified: / 31.3.1998 / 18:03:10 / cg"
   549     "Modified: / 31.3.1998 / 18:03:10 / cg"
   526 !
   550 !
   527 
   551 
   528 markStringFrom:pos1 to:pos2
   552 markStringFrom:pos1 to:pos2
   529     self 
   553     self 
   530         markFrom:pos1 to:pos2 
   554         markFrom:pos1 to:pos2 
   531         withEmphasis:(preferences stringEmphasis) color:(preferences stringColor)
   555         withEmphasis:(preferences stringEmphasis) 
       
   556         color:(preferences stringColor)
   532 
   557 
   533     "Modified: / 31.3.1998 / 18:03:18 / cg"
   558     "Modified: / 31.3.1998 / 18:03:18 / cg"
   534 !
   559 !
   535 
   560 
   536 markSuperFrom:pos1 to:pos2
   561 markSuperFrom:pos1 to:pos2
   537     self 
   562     self 
   538         markFrom:pos1 to:pos2 
   563         markFrom:pos1 to:pos2 
   539         withEmphasis:(preferences superEmphasis) color:(preferences superColor)
   564         withEmphasis:(preferences superEmphasis) 
       
   565         color:(preferences superColor)
   540 
   566 
   541     "Modified: / 31.3.1998 / 18:03:26 / cg"
   567     "Modified: / 31.3.1998 / 18:03:26 / cg"
   542 !
   568 !
   543 
   569 
   544 markSymbolFrom:pos1 to:pos2
   570 markSymbolFrom:pos1 to:pos2
   545     self 
   571     self 
   546         markFrom:pos1 to:pos2 
   572         markFrom:pos1 to:pos2 
   547         withEmphasis:(preferences symbolEmphasis) color:(preferences symbolColor)
   573         withEmphasis:(preferences symbolEmphasis) 
       
   574         color:(preferences symbolColor)
   548 
   575 
   549     "Created: / 1.4.1998 / 12:56:47 / cg"
   576     "Created: / 1.4.1998 / 12:56:47 / cg"
   550     "Modified: / 1.4.1998 / 12:58:00 / cg"
   577     "Modified: / 1.4.1998 / 12:58:00 / cg"
   551 !
   578 !
   552 
   579 
   553 markThisContextFrom:pos1 to:pos2
   580 markThisContextFrom:pos1 to:pos2
   554     self 
   581     self 
   555         markFrom:pos1 to:pos2 
   582         markFrom:pos1 to:pos2 
   556         withEmphasis:(preferences thisContextEmphasis) color:(preferences thisContextColor)
   583         withEmphasis:(preferences thisContextEmphasis) 
       
   584         color:(preferences thisContextColor)
   557 
   585 
   558     "Modified: / 31.3.1998 / 18:03:36 / cg"
   586     "Modified: / 31.3.1998 / 18:03:36 / cg"
   559 !
   587 !
   560 
   588 
   561 markUnknownIdentifierFrom:pos1 to:pos2
   589 markUnknownIdentifierFrom:pos1 to:pos2
   562     self 
   590     self 
   563         markFrom:pos1 to:pos2 
   591         markFrom:pos1 to:pos2 
   564         withEmphasis:(preferences unknownIdentifierEmphasis) color:(preferences unknownIdentifierColor)
   592         withEmphasis:(preferences unknownIdentifierEmphasis) 
       
   593         color:(preferences unknownIdentifierColor)
   565 
   594 
   566     "Created: / 31.3.1998 / 19:09:26 / cg"
   595     "Created: / 31.3.1998 / 19:09:26 / cg"
   567     "Modified: / 31.3.1998 / 19:10:30 / cg"
   596     "Modified: / 31.3.1998 / 19:10:30 / cg"
   568 !
   597 !
   569 
   598 
   605         ] ifFalse:[
   634         ] ifFalse:[
   606             self markGlobalIdentifierFrom:pos to:endPos.
   635             self markGlobalIdentifierFrom:pos to:endPos.
   607         ].
   636         ].
   608         ^ self
   637         ^ self
   609     ].
   638     ].
       
   639     (type == #PoolVariable) ifTrue:[
       
   640         self markPoolVariableIdentifierFrom:pos to:endPos.
       
   641         ^ self
       
   642     ].
   610     (type == #ClassVariable) ifTrue:[
   643     (type == #ClassVariable) ifTrue:[
   611         self markClassVariableIdentifierFrom:pos to:endPos.
   644         self markClassVariableIdentifierFrom:pos to:endPos.
   612         ^ self
   645         ^ self
   613     ].
   646     ].
   614     (type == #InstanceVariable) ifTrue:[
   647     (type == #InstanceVariable) ifTrue:[
   623 ! !
   656 ! !
   624 
   657 
   625 !SyntaxHighlighter class methodsFor:'documentation'!
   658 !SyntaxHighlighter class methodsFor:'documentation'!
   626 
   659 
   627 version
   660 version
   628     ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.46 2004-09-15 11:36:33 cg Exp $'
   661     ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.47 2004-09-20 08:47:02 ca Exp $'
   629 ! !
   662 ! !