BracketHighliting in Language Definition?

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Stephan Ziep
Avatar
Hi,

I want do create a language defnition for the LUA scripting Langage. It works pretty well so far. I implemented a custom semantic parser to perform outling etc.
Now i want BracketHighliting.
As Lua has no brackets, i want to highlite its reserved words like 'function', 'if', 'do' etc.
The Problem is that all blocks end with the same reserved word 'end'. The difficulty is hereby to match an 'end' with the corresponding opening statemant or vice versa. Is there a way to define this in the language definition file via the Scopes 'BracketHighlight' attribute? Do you have any suggestions?

Thanks in advance
Stephan Ziep

Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hmm... yes the default bracket highlighting mechanism won't work in this case. However you could probably just make your own custom span indicator that looks like a bracket highlight and apply that to the matching reserved words as you move through the document.


Actipro Software Support

Posted 18 years ago by Stephan Ziep
Avatar
Thanks, that helped. Good idea btw. Although i had to create 2 span indicators that are linked together to highlite the bracing words seperatly.

Stephan Ziep
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.