syntax highlighting ant/antcontrib with marker characters

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

syntax highlighting ant/antcontrib with marker characters

Postby tonAF » Tue Jul 31, 2007 10:53 am

Hi,

I am trying to highlight the property references in an ant script which refers to ant and antcontrib as ant extension.

I want to highlight all between

$ and } --> example: ${build.dir}
@ and } --> example: @{build.dirs}

I wanted to do this with the following entries in the wordfile:
...
/Marker Characters = "$}@}"
...
/C7"MarkerCharacters1"
$}
@}


The problem is that only the first entry is syntax hightlighted. The second one is displayed as normal text?

Then I tried to add a second "Marker Character Group":
...
/C7"MarkerCharacters1"
$}
...
/C8"MarkerCharacters2"
@}


Same problem... :(

Please can you help me to highlight both of them.

greetings
andreas
User avatar
tonAF
Newbie
 
Posts: 4
Joined: Mon Jul 30, 2007 11:00 pm

Re: syntax highlighting ant/antcontrib with marker character

Postby Mofi » Tue Jul 31, 2007 2:23 pm

@ must be specified also in the list of /Delimiters =. I guess, $ and } are already specified as delimiters.

Hopefully you don't have any keyword which contains a @ because the will propably not be highlighted anymore after adding @ to the delimiters - see the ultimate test for invalid words macro for details.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4064
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: syntax highlighting ant/antcontrib with marker character

Postby tonAF » Wed Aug 01, 2007 7:43 am

Hi Mofi,

@ is already defined in my delimiters
--> /Delimiters = ~@$^&*()+=|\{};"'<> ,

But the syntax highlighting doesn't work...
There aren't any keywords which contains a @.

Perhaps it helps when I post you somes snippets from my highlighting:

/L6"XML" XML_LANG Noquote Block Comment On = <!-- Block Comment Off = --> File Extensions = XML XUL XSD XSL XSLT JELLY BPEL WSDL
/Delimiters = ~@$^&*()+=|\{};"'<> ,
/Regexp Type = Perl
/Function String = "(target name=.*)\>"
/Open Brace Strings = "{" "(" "[" "<"
/Close Brace Strings = "}" ")" "]" ">"
/Marker Characters = "$}@}"
:
/C7"MarkerCharacters1"
$} @}


with the result $} are highlighted but @} not.

When I switch the position of the two marker characters, then @} will be highlighted and $} not.
User avatar
tonAF
Newbie
 
Posts: 4
Joined: Mon Jul 30, 2007 11:00 pm

Re: syntax highlighting ant/antcontrib with marker character

Postby Mofi » Wed Aug 01, 2007 7:58 am

$} and @} must be on different lines as you have posted it in your first post. The 2 marker strings start with a different character. So they must be on different lines.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4064
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: syntax highlighting ant/antcontrib with marker character

Postby tonAF » Wed Aug 01, 2007 8:54 am

You mean:

/Marker Characters = "$}@}"
  :
/C7"MarkerCharacters1"
$}
/C8"MarkerCharacters2"
@}

That doesn't work... only the $} will be highlighted. It seems that only the first marker character pair will be highlighted. If I switched them from "$}@}" to "@}$}", then @} will be highlighted.

Also

/C7"MarkerCharacters1"
$}
@}

doesn't work. Is there a problem with the equal ending characters } in both marker character pairs?
User avatar
tonAF
Newbie
 
Posts: 4
Joined: Mon Jul 30, 2007 11:00 pm

Re: syntax highlighting ant/antcontrib with marker character

Postby Mofi » Wed Aug 01, 2007 11:21 am

I tested it again with UltraEdit v13.10a+1 on WinXP SP2 x86 although it already worked yesterday on a quick test as it should. Now I have used exactly your language definition with

/C7"MarkerCharacters1"
$}
/C8"MarkerCharacters2"
@}

and also with

/C7"MarkerCharacters1"
$}
@}

Both worked on the test file with the two examples you have posted saved into a file with extension XML.

Then I thought, that XML files are often encoded in UTF-8 and not in ASCII/ANSI. So I converted my Test.xml from ASCII to UTF-8 (Unicode) and suddenly I get the same effect as you. Only the first defined marker character pair works. Converting it back to ASCII and both marker character pairs work again.

This is definitely a bug of UltraEdit. Please report it to IDM support per email - see address at top of this page. Attach your syntax highlighting wordfile and an example XML file which is encoded in UTF-8.

Update: The issue with second marker character not working on a highlighted UTF-8 file was fixed with UE v15.00.0.1033.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4064
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: syntax highlighting ant/antcontrib with marker character

Postby tonAF » Wed Aug 01, 2007 12:28 pm

Hi mofi,

Thanks a lot for your help in this case!!!
I will post it to IDM.

Greetings from Darmstadt :D
User avatar
tonAF
Newbie
 
Posts: 4
Joined: Mon Jul 30, 2007 11:00 pm


Return to Syntax Highlighting