control flow color&emphasis
authorClaus Gittinger <cg@exept.de>
Fri, 08 Sep 2006 16:14:40 +0200
changeset 1905 fba079d9d509
parent 1904 71c41110a83a
child 1906 c52f389751db
control flow color&emphasis
SyntaxHighlighter.st
--- a/SyntaxHighlighter.st	Wed Sep 06 10:54:19 2006 +0200
+++ b/SyntaxHighlighter.st	Fri Sep 08 16:14:40 2006 +0200
@@ -272,6 +272,29 @@
 
 !SyntaxHighlighter methodsFor:'misc'!
 
+controlFlowSelectors
+    ^ #(
+        ifTrue:
+        ifFalse:
+        ifTrue:ifFalse:
+        ifFalse:ifTrue:
+
+        whileTrue:
+        whileFalse:
+
+        to:do:
+        to:by:do:
+
+        loop
+        whileTrue
+        whileFalse
+        doWhile:
+        doUntil:
+    )
+
+    "Created: / 08-09-2006 / 15:56:47 / cg"
+!
+
 defineAsUndeclaredVariable:aName
     "redefined to NOT declare undefined vars"
 
@@ -532,8 +555,11 @@
     em := preferences selectorEmphasis.
     selectorSymbol := selectorString asSymbolIfInterned.
     selectorSymbol isNil ifTrue:[
-        fg := Color red.
+        em := preferences unimplementedSelectorEmphasis.
+        fg := preferences unimplementedSelectorColor.
     ] ifFalse:[
+        ok := true.
+
         fullSelectorCheck == true ifTrue:[
 
             check := [:cls | (cls includesSelector:selectorSymbol)
@@ -566,19 +592,23 @@
                     ]
                 ]
             ].
-
-            ok ifFalse:[
-                em := preferences unimplementedSelectorEmphasis.
-                fg := preferences unimplementedSelectorColor.
-            ]
-        ]
+        ].
+        ok ifFalse:[
+            em := preferences unimplementedSelectorEmphasis.
+            fg := preferences unimplementedSelectorColor.
+        ] ifTrue:[
+            (self controlFlowSelectors includesIdentical:selectorSymbol) ifTrue:[
+                em := preferences controlFlowSelectorEmphasis.
+                fg := preferences controlFlowSelectorColor.
+            ].
+        ].
     ].
     self
         markFrom:pos1 to:pos2 
         withEmphasis:em 
         color:fg
 
-    "Modified: / 1.4.1998 / 13:14:43 / cg"
+    "Modified: / 08-09-2006 / 15:57:02 / cg"
 !
 
 markSelfFrom:pos1 to:pos2
@@ -703,5 +733,5 @@
 !SyntaxHighlighter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.53 2006-08-22 12:43:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/SyntaxHighlighter.st,v 1.54 2006-09-08 14:14:40 cg Exp $'
 ! !