How to define pascal/delphi conditionals in wordfile (if possible)?

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

How to define pascal/delphi conditionals in wordfile (if possible)?

Postby myarmor » Sat Aug 29, 2009 10:44 pm

Does anyone have a solution to how to define those into the wordfile?
i.e {$DEFINE sometexthere} etc..

Delphi already uses both comment types ({...} and (*...*) ), but {$ ...} is not.

I used http://www.ultraedit.com/files/wf/delphi1-8(dotnet).uew as my starting point, but I can't seem to get it to handle this properly.

UE highlighting is somewhat basic for most languages (I'm used to EditPad Pro), but I'd like it to at least do this..

I use UEStudio 09.20.1005.
myarmor
Newbie
 
Posts: 7
Joined: Fri Aug 28, 2009 7:16 am

Re: How to define pascal/delphi conditionals in wordfile (if possible)?

Postby Mofi » Sun Aug 30, 2009 1:23 pm

Yes, the syntax highlighting engine of UE/UES does not support regular expression definitions for highlighting making such special highlighting requirements sometimes impossible. I can give you no advice how to solve this syntax highlighting problem of UE/UES for this Delphi language special because I could not find a solution. I can only suggest not to use {...} for block commenting which is probably inacceptable for you. Only possible is to define (* and *) as block comment strings and { and } as alternate block comment. Alternate block comments can be highlighted with a different color. That could be used to highlight compiler directives {$...} and of course block comments using {...} completely in a different color.

delphi1-8(dotnet).uew seems to be very old. Therefore I had attached (already deleted) to this post a hopefully improved version. I don't know much about Delphi nor do I have example files. So please tell me if my version is better and if IDM should upload this version to their server.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: How to define pascal/delphi conditionals in wordfile (if possible)?

Postby myarmor » Sun Aug 30, 2009 3:01 pm

I'm sad to hear that.. I guess it is one of the disadvantages of UE(S).
However, the file you provided improved some things a bit though (folding), which I've integrated into my wordfile (attached).

Mine is mostly similar, although it defines some common types etc.
The {} block comment is rather standard now (while the (**) isn't so much anymore) so that is a no can do.
I tried using {} as the main comment, and {$} as the alternative, just on a hunch.. It didn't work however.

One thing I can't seem to get working with the new or old wordfile is ":=" (remove quotes).
Attachments
delphi1-8(dotnet).zip
My wordfile
(1.27 KiB) Downloaded 242 times
myarmor
Newbie
 
Posts: 7
Joined: Fri Aug 28, 2009 7:16 am

Re: How to define pascal/delphi conditionals in wordfile (if possible)?

Postby Mofi » Mon Aug 31, 2009 12:43 am

Block Comment On = {$ Block Comment Off = } Block Comment On Alt = { Block Comment Off Alt = }

would work and favor highlighting of compiler directives over block comments. But line comments, alternate line comments and block comments are all highlighted with the same color and therefore I think this is no help for you.

The problem you have with highlighting := is probably caused by bad delimiters. Use the attached wordfile which contains all your words and all your color and font style settings and those setting lines created by mistake deleted.

The only chance to get compiler directives not highlighted as block comment is to use for example always {! or {# as block comment starting string in your Delphi source files and specify this string as block comment on string. That is definitely not the best solution, but would be a helpful workaround for this syntax highlighting problem with UE/UES.
Attachments
delphi_wordfile.zip
Updated wordfile with lines and delimiters fixed
(1.22 KiB) Downloaded 362 times
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: How to define pascal/delphi conditionals in wordfile (if possible)?

Postby myarmor » Mon Aug 31, 2009 6:06 am

Thank you.. It did solve the := issue.

In regards to the {$} issue, that's another matter though..
myarmor
Newbie
 
Posts: 7
Joined: Fri Aug 28, 2009 7:16 am


Return to Syntax Highlighting