[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Re: Manual ID



In message <5733bad441Lists@xxxxxxxxxxx>
          "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

> In article <a8647a3357.fjgraute@xxxxxxxxx>,
>    Fred Graute <fjgraute@xxxxxxxxx> wrote:
> > ID is short for identifier and in most cases this refers to variables in
> > a programming language. Basically anything that isn't defined in the
> > ModeFile by means of a SyntaxWords group or a SyntaxComment is coloured
> > as 'Identifiers' _if_ the ID keywords are defined, otherwise the 'Text'
> > colour is used.
> 
> > ID_FirstChar defined what characters an identifier can start with. Some
> > programming languages have restrictions on this, eg in BBC BASIC IDs
> > can't start with a digit.
> 
> > ID_Middle defines which characters can be in the middle (ie not first or
> > last) of an identifier.
> 
> > ID_LastChar is used for special characters that can only be used at the
> > end of an identifier. In BBC BASIC integer variables end with '%', and
> > string variables with '$'.
> 
> Thanks, Fred, that helps a lot.
> 
> But a problem. In HTML mode these are defined:
>   ID_FirstChar	<
>   ID_Middle	/A-Za-z_0-9
>   ID_LastChar	A-Za-z_0-9>
> 
> However changing 
>   ID_LastChar	>
> appears to have no effect. e.g. <z still gets coloured as an identifier. I
> expected it not to get coloured, but <z> would.

ID_LastChar last is optional, it will be accepted if there but if it's
absent then that's fine too.

It seems to me that the ID keywords were designed with BBC BASIC in mind
where the following are all valid identifiers:

  foobar   (floating point)
  foobar%  (integer)
  foobar$  (string)

If ID_LastChar (defined in BASIC mode as '$%') has to produce a match
then floating point variables would not be seen as identifiers.

In some modes, such as HTML, the ID keywords are 'abused' to colour
things that can't be easily captured by other means. This results in the
anomaly you spotted.

Cheers,
Fred.

-- 
StrongED Developer
http://www.stronged.iconbar.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at
http://stronged.torrens.org/index.html