Hi, Nils.  
The code is fine.  It certainly shows that you have mastered TkTags.  But, I 
am not qualified to offer much in the way of parsing, although it does seem 
to me that this mechanism has very limited utility.  I assume that it was for 
demo purposes only.  If you are going to carry it to the next step you should 
probably post again with "parser" in the subject. 

>im not sure, if question like this are "allowed", in this
>group:()

Certainly.  The people in this ML are the most helpful that you will find 
anywhere, and they absolutely delight in competing for the "most elegant code 
award."

If you don't mind I could start by offering a few opinions: (1) you might 
feel more in control of the process if you do your parsing completely in 
Ruby, rather than relying on Tk constructs like TkText#search.  Ruby has very 
powerful tools for text search and manipulation.  Use just what you need from 
Tk to handle the GUI aspects.  TkText is powerful and fast and was a good 
choice for your project. (2)  Ruby also has some very powerful looping 
contructs.  The loop {...break...} technique can be unwieldy and not as 
readable as the iterators. e.g.:

doc = TkText.new(...)
lastLine = doc.index(end).split('.')[0].to_i
['$', '=', '==', '{', '}'].each { | sym |
	0..lastLine.each { | line |
		until  (index = editor.search(sym, "#{line}.end")).empty?	
			line, char = index.split('.') 
			highlightTag.add(index, "#{line}.{char.to_i + sym.size}") 
		end
	}
}

This code wasn't tested.  I tried to leave your logic intact and only 
demonstrate a few interators.

Have fun with Ruby,
Albert
-- 
Quantum Mechanics: The dreams stuff is made of