#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Wed, 16 May 2018 14:51:32 +0200
changeset 4264 eb7566800e38
parent 4263 25e950b4c9e8
child 4265 2d1b30ce36f2
#REFACTORING by cg class: AbstractSyntaxHighlighter added: #markErrorFrom:to: changed: #parseError:position:to: #showErrorMessage:position: #syntaxError:position:to:
AbstractSyntaxHighlighter.st
--- a/AbstractSyntaxHighlighter.st	Wed May 16 14:51:19 2018 +0200
+++ b/AbstractSyntaxHighlighter.st	Wed May 16 14:51:32 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2006 by eXept Software AG
 	      All Rights Reserved
@@ -558,27 +560,21 @@
 "/ Transcript showCR:aMessage.
     super parseError:aMessage position:position to:endPos.
 
-    self
-	markFrom:position to:endPos
-	withEmphasis:nil color:UserPreferences current errorColor
+    self markErrorFrom:position to:endPos
 !
 
 showErrorMessage:aMessage position:pos
 "/ Transcript showCR:aMessage.
     super showErrorMessage:aMessage position:pos.
 
-    self
-	markFrom:pos to:nil
-	withEmphasis:nil color:UserPreferences current errorColor
+    self markErrorFrom:pos to:nil "/ to the end
 !
 
 syntaxError:aMessage position:position to:endPos
 "/ Transcript showCR:aMessage.
     super syntaxError:aMessage position:position to:endPos.
 
-    self
-	markFrom:position to:endPos
-	withEmphasis:nil color:UserPreferences current errorColor
+    self markErrorFrom:position to:endPos
 !
 
 warning:msg position:pos1 to:pos2
@@ -674,6 +670,12 @@
     "Modified: / 21-10-2017 / 14:15:48 / cg"
 !
 
+markErrorFrom:pos1 to:pos2
+    self
+        markFrom:pos1 to:pos2
+        withEmphasis:nil color:UserPreferences current errorColor
+!
+
 markFrom:pos1 length:len withEmphasis:fontEmp color:clrIn
     self markFrom:pos1 to:pos1+len-1 withEmphasis:fontEmp color:clrIn