2007-09-24

Windows Live Writer and Pascal Code Formatting (updated)

Since Steve Dunn has updated his WLW add-in, I checked it and found out that it still doesn't use the fixed pascal definition file that I sent Actipro some months ago.

So, if you want proper pascal syntax highlighting, download his control, follow his instructions and afterwards copy this file over the same named one in the languages folder.

Among other fixes that I recall are some missing keywords (unit for instance) and support for // comments and proper nested comment / string support.

3 comments:

TDelphiHobbyist said...

Fernando,

I keep meaning to get in touch with you on this ... in some other formatting tool [can't remember which] I came across a much larger list of ExplicitPatternGroup keywords:
abs addr and ansichar ansistring array as asm begin boolean byte cardinal char class comp const constructor currency default destructor div do double downto else end except exports extended false file finalization finally for function goto if implementation in inherited int64 initialization integer interface is label library longint longword mod nil not object of on or override packed pansichar pansistring pchar pcurrency pdatetime pextended pint64 pointer private procedure program property pshortstring pstring pvariant pwidechar pwidestring protected public published raise read real real48 record repeat set shl shortint shortstring shr single smallint string then threadvar to true try type unit until uses val var varirnt while widechar widestring with word write writeln xor

--
Dave

Fernando Madruga said...

Thks Dave, but that list seems to include many keywords that are not reserved, such as "abs" and "currency". At least, Delphi 2007 doesn't color them as such. If I were not lazy or busy, I'd probably check your list against the default one and add some that are really missing there, i.e., reserved keywords not marked as such, but that's around 60 keywords to put into a test program in the proper context to see if they are or not recognized... If only the built-in help in Delphi 2007 were worth using...

TDelphiHobbyist said...

Fernando,

Thanks, I appreciate the work you've done on this.

--
Dave