Highlight between two bracket compounds

Syntax highlighting, code folding, brace matching, code indenting, and function list

Highlight between two bracket compounds

Postby vix612 » Fri Feb 09, 2007 5:50 pm

Code: Select all
<html>
   <head>
      <title><{.title}></title>
   </head>
   
   <body>   
   <{articles{>
      <h2><{*.Title}></h2>
      <p><{*.Content}></p>
      <{*.Comments{> <div>
         <h3><{*.Email}></h3>
         <p><{*.Comment}></p>
      </div><}}>
   <}}>
   </body>
</html>


Pretty interesting, isn't it? But I would like to reach it in UE. That what I need to know is how to specify the content between two bracket compounds like those by regular expression (I can't accept other way).
I can show by this specification: ( "<{" | "<}" ) content ( "{>" | "}>" )
I have also tried to colour those bracket compounds but its another thing. Thanx for help very MUCH. UE is the most amazing editor I've ever used!
After solution of this I will publish what I need it for :) .
User avatar
vix612
Newbie
 
Posts: 2
Joined: Fri Feb 09, 2007 12:00 am

Re: Highlight between two bracket compounds

Postby Mofi » Sat Feb 10, 2007 4:17 pm

vix612 wrote:Pretty interesting, isn't it?


I would classify it as crazy. However, I have a solution for you. Regular expressions can be used only for funtion string definitions for the function list and not for highlighting strings.

I guess, you use the standard wordfile.txt in the UltraEdit program directory. Open this file and modify the first line for HTML to the following line:

/L3"HTML" HTML_LANG Nocase Noquote Block Comment On = <!-- Block Comment Off = --> Block Comment On Alt = <{ Block Comment Off Alt = > File Extensions = HTM HTML SHTML HTT HTA HTX CFM JSP PHP PHTML ASP

In the next line with the delimiters delete the 2 characters {} or only }.

And last at the end of the block for HTML add following 2 lines:

/C3"Closing }}"
<}}>


Save the wordfile and you can already see the highlighting. Open Configuration - Editor Display - Syntax Highlighting, select Language HTML and specify the style you want for Color Group Alternate Block Comments and Closing }}. I suggest to use the same style for both.

That's not exactly what you want, but the result should be the same.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4051
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Highlight between two bracket compounds

Postby vix612 » Mon Feb 12, 2007 8:29 am

Thank you for your trial my neighbour but this kind of a solution would make the code between <{ and }> ignored, I think, so it couldn't be processed and folded when I set up Open Fold String "{>" and Close Fold String "<}". Also it would be impossible to sign opposite brackets by setting them as "<{" to "}>" or "{>" to "<}".
So I think I have to satisfy with only the brackets highlighting.

Regards from Czech :D !
User avatar
vix612
Newbie
 
Posts: 2
Joined: Fri Feb 09, 2007 12:00 am


Return to Syntax Highlighting