Using the Custom language formatter

Please post all questions relating to Help & Manual 6 here!

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Greg Smith
Posts: 210
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Using the Custom language formatter

Unread post by Greg Smith »

I'm trying to use the custom language formatter with a script language that has
keywords: works, the custom list lets me set a style for them
number: Uses decimal and hex numbers(23, -0.5, 0x1234). Setting a format does not appear to work
Strings: Uses double quotes, formatting appears to work
Comment: Introduces a comment with a single quote (as Basic used to). Setting Basic as the comment format seems to start a comment on a semicolon.
Separator: we use semicolon as a separator, but this seems to be used as a comment marker in Basic comment mode (and there is no other that is useful for us).

I cannot find any detailed documentation about how this is intended to work. My main problem is that semicolon is taken as a comment marker. In general, there are two types of comment markers: stream in C/C++ /* text over possibly several lines */ and line comments // to the end of the line. Could we be allowed to defined which we use and what character sequences mark the comment rather than assuming that it is the same as Pascal or C or Basic - and what is ANSI style, please (Fortran maybe).
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Using the Custom language formatter

Unread post by Tim Green »

Hi Greg,

As it is at the moment, you have to choose one of the comment styles available (Ansi, Pascal, Basic, C, C++) and the highlighter will then use the comment syntax of those languages as triggers. You can't set the triggers directly. However, the highlighter is actually a separate DLL, and if your programmers want they could modify ours or write their own to do what they want. We can mail you the source code in Object Pascal and the API if you want. It doesn't have to be written in Pascal, however. It just has to provide the following accessible functions:

Code: Select all

function HMSynInitHighlighters
{ initialization function, returns a list of available highlighters,
  for a custom highligher you would return a simple string with the
  name of your highligher }

function HMSynConfigHighlighters
{ this function is called when the user presses the "config" button,
  it may provide a dialog to edit configuration settings or just
  do nothing }

function HMSynFormatText
{ this function actually modifies the text. It receives a string of text in RTF format and returns the same string in RTF format, but modified }
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Greg Smith
Posts: 210
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Re: Using the Custom language formatter

Unread post by Greg Smith »

Hmm... well we are capable of doing this, but I tend to feel that we should go with what external tool do, rather than writing our own special DLLs which may or may not be compatible in the future. So I think my request still stands.

But thanks for the information.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Using the Custom language formatter

Unread post by Tim Green »

Hi Greg,

I understand that -- more flexible options for the custom syntax highlighters would definitely be a plus. I recommend adding a request to the Wish List section of the forum, which is monitored by our developers. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply