SyntaxHighlighter.st
changeset 1905 fba079d9d509
parent 1857 4d7e1edb44cd
child 2055 b04faf4243fd
equal deleted inserted replaced
1904:71c41110a83a 1905:fba079d9d509
   269     "Created: / 31.3.1998 / 15:12:55 / cg"
   269     "Created: / 31.3.1998 / 15:12:55 / cg"
   270     "Modified: / 5.1.1980 / 00:44:03 / cg"
   270     "Modified: / 5.1.1980 / 00:44:03 / cg"
   271 ! !
   271 ! !
   272 
   272 
   273 !SyntaxHighlighter methodsFor:'misc'!
   273 !SyntaxHighlighter methodsFor:'misc'!
       
   274 
       
   275 controlFlowSelectors
       
   276     ^ #(
       
   277         ifTrue:
       
   278         ifFalse:
       
   279         ifTrue:ifFalse:
       
   280         ifFalse:ifTrue:
       
   281 
       
   282         whileTrue:
       
   283         whileFalse:
       
   284 
       
   285         to:do:
       
   286         to:by:do:
       
   287 
       
   288         loop
       
   289         whileTrue
       
   290         whileFalse
       
   291         doWhile:
       
   292         doUntil:
       
   293     )
       
   294 
       
   295     "Created: / 08-09-2006 / 15:56:47 / cg"
       
   296 !
   274 
   297 
   275 defineAsUndeclaredVariable:aName
   298 defineAsUndeclaredVariable:aName
   276     "redefined to NOT declare undefined vars"
   299     "redefined to NOT declare undefined vars"
   277 
   300 
   278     ^ VariableNode globalNamed:aName
   301     ^ VariableNode globalNamed:aName
   530 
   553 
   531     fg := preferences selectorColor.
   554     fg := preferences selectorColor.
   532     em := preferences selectorEmphasis.
   555     em := preferences selectorEmphasis.
   533     selectorSymbol := selectorString asSymbolIfInterned.
   556     selectorSymbol := selectorString asSymbolIfInterned.
   534     selectorSymbol isNil ifTrue:[
   557     selectorSymbol isNil ifTrue:[
   535         fg := Color red.
   558         em := preferences unimplementedSelectorEmphasis.
       
   559         fg := preferences unimplementedSelectorColor.
   536     ] ifFalse:[
   560     ] ifFalse:[
       
   561         ok := true.
       
   562 
   537         fullSelectorCheck == true ifTrue:[
   563         fullSelectorCheck == true ifTrue:[
   538 
   564 
   539             check := [:cls | (cls includesSelector:selectorSymbol)
   565             check := [:cls | (cls includesSelector:selectorSymbol)
   540                              or:[cls class includesSelector:selectorSymbol]].
   566                              or:[cls class includesSelector:selectorSymbol]].
   541 
   567 
   564                     ] ifFalse:[
   590                     ] ifFalse:[
   565                         ok := Smalltalk allClasses contains:check
   591                         ok := Smalltalk allClasses contains:check
   566                     ]
   592                     ]
   567                 ]
   593                 ]
   568             ].
   594             ].
   569 
   595         ].
   570             ok ifFalse:[
   596         ok ifFalse:[
   571                 em := preferences unimplementedSelectorEmphasis.
   597             em := preferences unimplementedSelectorEmphasis.
   572                 fg := preferences unimplementedSelectorColor.
   598             fg := preferences unimplementedSelectorColor.
   573             ]
   599         ] ifTrue:[
   574         ]
   600             (self controlFlowSelectors includesIdentical:selectorSymbol) ifTrue:[
       
   601                 em := preferences controlFlowSelectorEmphasis.
       
   602                 fg := preferences controlFlowSelectorColor.
       
   603             ].
       
   604         ].
   575     ].
   605     ].
   576     self
   606     self
   577         markFrom:pos1 to:pos2 
   607         markFrom:pos1 to:pos2 
   578         withEmphasis:em 
   608         withEmphasis:em 
   579         color:fg
   609         color:fg
   580 
   610 
   581     "Modified: / 1.4.1998 / 13:14:43 / cg"
   611     "Modified: / 08-09-2006 / 15:57:02 / cg"
   582 !
   612 !
   583 
   613 
   584 markSelfFrom:pos1 to:pos2
   614 markSelfFrom:pos1 to:pos2
   585     self 
   615     self 
   586         markFrom:pos1 to:pos2 
   616         markFrom:pos1 to:pos2 
   701 ! !
   731 ! !
   702 
   732 
   703 !SyntaxHighlighter class methodsFor:'documentation'!
   733 !SyntaxHighlighter class methodsFor:'documentation'!
   704 
   734 
   705 version
   735 version
   706     ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.53 2006-08-22 12:43:17 cg Exp $'
   736     ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.54 2006-09-08 14:14:40 cg Exp $'
   707 ! !
   737 ! !