Start and end comment block using same character

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

Start and end comment block using same character

Postby steveloft » Thu Jun 22, 2006 11:50 am

I program in a language that only has comment blocks, no single line comments, and the start and end comment symbol is the same - an @ symbol.

It appears that UltraEdit's syntax highlighting cannot handle having the same symbol for start and end comment - is this correct?

Steve
User avatar
steveloft
Newbie
 
Posts: 2
Joined: Wed Jun 21, 2006 11:00 pm

Re: Start and end comment block using same character

Postby Mofi » Thu Jun 22, 2006 12:36 pm

Yes, it looks so. UE gets a little bit confused and the block comment highlighting fails.

You have 3 options now:

1) Send a feature request email to IDM support and ask for support of identical block comment on/off strings.

2) Adapt your comment writing style to the capabilities of UE and write for example always @> at start of a block comment and <@ at the end of a block comment and use these 2 strings in the wordfile too.

3) If your language does not support multi-line strings, but normal strings with "..." or '?' within a line only, you can use the string highlighting feature as block comment highlighting and highlight the strings with marker characters.


For 3) use following:

/L20"Language Name" String Chars = @ EnableMLS File Extensions = ???
/Delimiters = " 'tab@
/Marker Characters = """''"
/C8"Strings"
""
''

You can add additional delimiter characters. I have written here just the 5 characters you need absolutely.

Disadvantages: Code folding on block comments is not possible with this workaround and an escape character for strings like "this is a double quote \" in a string" cannot be used too.


If the language is not a non-puplic internal company language, can you post the name of the language?

Maybe an other user needs it also and uses the forum search for the answer of the question: "How to setup the wordfile to highlight the block comments of language ??? correctly?"
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4042
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Start and end comment block using same character

Postby steveloft » Thu Jun 22, 2006 12:59 pm

Thanks very much for the reply. It's an internal company language, but it resembles Algol 68 - http://en.wikipedia.org/wiki/ALGOL_68 - which also uses the same symbol to start and end comments, but not @ in that case.

We never use multi-line strings, so your method 3) works brilliantly, thank you. I don't fully understand how it works - I've only just started using UltraEdit - but it does, so I can carry on trying UltraEdit.

Thanks again!
User avatar
steveloft
Newbie
 
Posts: 2
Joined: Wed Jun 21, 2006 11:00 pm


Return to Syntax Highlighting