- SyntaxHighlighter2 jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 19 Apr 2012 09:02:13 +0100
branchjv
changeset 12233 f71206c1d1dd
parent 12232 4d9b62c111fc
child 12234 f058369ac3f1
- SyntaxHighlighter2 changed: #markSelector:from:to:receiverNode:
SyntaxHighlighter2.st
--- a/SyntaxHighlighter2.st	Wed Apr 18 21:29:40 2012 +0100
+++ b/SyntaxHighlighter2.st	Thu Apr 19 09:02:13 2012 +0100
@@ -554,8 +554,6 @@
     "Created: / 16-02-2012 / 21:56:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-
-
 expression
     | node savedLastSelectorElement |
 
@@ -575,8 +573,6 @@
     "Modified: / 16-02-2012 / 23:39:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-
-
 unaryExpressionFor:receiverArg
     "parse a unary-expression; return a node-tree, nil or #Error"
 
@@ -693,8 +689,6 @@
     "Created: / 17-03-2012 / 19:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-
-
 markLocalIdentifierFrom:pos1 to:pos2
     | node el prevEl |
 
@@ -715,7 +709,17 @@
 
     | element |
 
-    super markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode.
+    "Special hack for Java class references - I would like to have them
+     marked specially (and not as an error when the class is not yet loaded -
+     the code is correct as JavaClassAccessor loads it lazily"
+    (aReceiverNode isJavaPackageReference) ifTrue:[
+        self
+            markFrom:pos1 to:pos2 
+            withEmphasis:preferences globalClassIdentifierEmphasis 
+            color: preferences globalClassIdentifierColor
+    ] ifFalse:[
+        super markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode.
+    ].
 
     element := elements newElementFor: (SelectorNode value: selectorString from: pos1 to: pos2).
 
@@ -729,11 +733,9 @@
 
     "Created: / 14-02-2010 / 17:40:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified (format): / 21-08-2011 / 09:18:21 / cg"
-    "Modified: / 16-02-2012 / 23:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-04-2012 / 09:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-
-
 markUnknownIdentifierFrom:pos1 to:pos2
 
     ignoreBadIdentifier == true ifTrue:[ ^ self ].
@@ -744,8 +746,6 @@
     "Modified: / 31.3.1998 / 19:10:30 / cg"
 !
 
-
-
 rememberVariableElementFor:name type:typeSymbol from:pos1 to:pos2
     |element prev|
 
@@ -769,5 +769,5 @@
 !
 
 version_SVN
-    ^ '$Id: SyntaxHighlighter2.st 7978 2012-04-13 13:15:47Z vranyj1 $'
+    ^ '$Id: SyntaxHighlighter2.st 7982 2012-04-19 08:02:13Z vranyj1 $'
 ! !