Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-01

character escaping with ^LETTER

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb
Martin Frb wrote 10 lines
On 19/01/2015 13:17, Dmitry Boyarintsev wrote: > > CodeTools syntax highlighter won't recognize the syntax as characters > either (delphi 7 highlighter doesn't recognize it as a character > escaping as well) > Add that to the bugtracker please (as synedit HL issue). It is probably easy to fix, simple a question of not forgetting it

Implemented in Lazarus trunk
^C now highlights as char, except, for things like "type x = ^C;"

Note there are places where neither are char, nor a ^SomeType are legal, in those cases there is no rule as what it will be highlighted.

Reply by email

C Western
to Martin Frb
Martin Frb wrote 17 lines
On 19/01/2015 17:09, Martin Frb wrote: > On 19/01/2015 13:17, Dmitry Boyarintsev wrote: >> >> CodeTools syntax highlighter won't recognize the syntax as characters >> either (delphi 7 highlighter doesn't recognize it as a character >> escaping as well) >> > > Add that to the bugtracker please (as synedit HL issue). > > It is probably easy to fix, simple a question of not forgetting it Implemented in Lazarus trunk ^C now highlights as char, except, for things like "type x = ^C;" Note there are places where neither are char, nor a ^SomeType are legal, in those cases there is no rule as what it will be highlighted.

There seems to be a corner case that needs a little work:

TypeData :=
GetTypeData(PropInfo^.PropType{$IFNDEF FPC}^{$ENDIF});

causes all the rest of the file after "FPC" to show as grayed out, i.e. as if it was one big conditional.

Colin

Reply by email

Mattias Gaertner
to Martin Frb: Implemented in Lazarus trunk ^C now highlights as char, except, for things like "type x =…
Show quoted text 17 lines
On 19/01/2015 17:09, Martin Frb wrote: > On 19/01/2015 13:17, Dmitry Boyarintsev wrote: >> >> CodeTools syntax highlighter won't recognize the syntax as characters >> either (delphi 7 highlighter doesn't recognize it as a character >> escaping as well) >> > > Add that to the bugtracker please (as synedit HL issue). > > It is probably easy to fix, simple a question of not forgetting it Implemented in Lazarus trunk ^C now highlights as char, except, for things like "type x = ^C;" Note there are places where neither are char, nor a ^SomeType are legal, in those cases there is no rule as what it will be highlighted.
The following is now highlighted as constant:
c:=p^;

Mattias

Reply by email

Mattias Gaertner
to C Western: There seems to be a corner case that needs a little work: TypeData :=…
Show quoted text 26 lines
On 24/01/15 20:33, Martin Frb wrote: > On 19/01/2015 17:09, Martin Frb wrote: >> On 19/01/2015 13:17, Dmitry Boyarintsev wrote: >>> >>> CodeTools syntax highlighter won't recognize the syntax as characters >>> either (delphi 7 highlighter doesn't recognize it as a character >>> escaping as well) >>> >> >> Add that to the bugtracker please (as synedit HL issue). >> >> It is probably easy to fix, simple a question of not forgetting it > > Implemented in Lazarus trunk > ^C now highlights as char, except, for things like "type x = ^C;" > > Note there are places where neither are char, nor a ^SomeType are legal, > in those cases there is no rule as what it will be highlighted. There seems to be a corner case that needs a little work: TypeData := GetTypeData(PropInfo^.PropType{$IFNDEF FPC}^{$ENDIF}); causes all the rest of the file after "FPC" to show as grayed out, i.e. as if it was one big conditional.
That is because the highlighter now treats ^{ as constant and so the
{$endif} is not seen by the highlighter code.

AFAIK only ^A..^Z are constants.

Mattias

Reply by email

Martin Frb
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
That is because the highlighter now treats ^{ as constant and so the {$endif} is not seen by the highlighter code. AFAIK only ^A..^Z are constants.

No,

program Project1;
begin
   writeln( ^{ );
end.
compiles. Also
   writeln( ^^ );
   writeln( ^. );
even space
   writeln( ^  );
are ok

But

   writeln( ^{ $);

does not.

Seems than directives have a special priority.

Also other multi char tokens (* are split
   writeln( ^(* 8 );
project1.lpr(4,12) Error: Incompatible types: got "Char" expected "LongInt"

So this is: char * 8

Reply by email