View Issue Details

IDProjectCategoryView StatusLast Update
0022180LazarusPatchpublic2012-06-03 18:52
ReporterZaher Dirkey Assigned ToMartin Friebe  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version1.2.0Fixed in Version1.1 (SVN) 
Summary0022180: Remove unused lines depend on SYN_LAZARUS and FPC defines
DescriptionThis patches on for

synedithighlighter.pp
syneditstrconst.pp
synhighlighterany.pas
synhighlightercpp.pp
synhighlighterpas.pp

Kept some defines that effect on functions.
LoadFromRegistry ,SaveToRegistry ,LoadFromBorlandRegistry, UseUserSettings and EnumUserSettings.

I will continue when you applied it.

Thanks in advance
TagsNo tags attached.
Fixed in Revision37490
LazTarget1.2
Widgetset
Attached Files

Activities

2012-06-02 22:13

 

synedit-clean-2.patch (27,658 bytes)   
Index: synedithighlighter.pp
===================================================================
--- synedithighlighter.pp	(revision 37471)
+++ synedithighlighter.pp	(working copy)
@@ -33,11 +33,7 @@
 
 uses
   SysUtils, Classes,
-{$IFDEF SYN_CLX}
-  kTextDrawer, Types, QGraphics,
-{$ELSE}
   Graphics, FileUtil, LCLProc, LCLIntf, LCLType, Registry, IniFiles,
-{$ENDIF}
   SynEditTypes, SynEditTextBase;
 
 {$DEFINE _Gp_MustEnhanceRegistry}
@@ -329,10 +325,8 @@
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
-    {$IFDEF SYN_LAZARUS}
     function AddSpecialAttribute(const AttribName: string;
                      const aStoredName: String = ''): TSynHighlighterAttributes;
-    {$ENDIF}
     procedure Assign(Source: TPersistent); override;
     procedure BeginUpdate;
     procedure EndUpdate;
@@ -366,7 +360,7 @@
     procedure ScanAllRanges;
     procedure SetRange(Value: Pointer); virtual;
     procedure ResetRange; virtual;
-    procedure SetLine({$IFDEF FPC}const {$ENDIF}NewValue: String;
+    procedure SetLine(const NewValue: String;
                       LineNumber:Integer // 0 based
                       ); virtual;
 
@@ -387,7 +381,7 @@
     property Attribute[idx: integer]: TSynHighlighterAttributes
       read GetAttribute;
     property Capabilities: TSynHighlighterCapabilities
-       read {$IFDEF SYN_LAZARUS}FCapabilities{$ELSE}GetCapabilities{$ENDIF};
+       read FCapabilities;
     property SampleSource: string read GetSampleSource write SetSampleSource;
     property CommentAttribute: TSynHighlighterAttributes
       index SYN_ATTR_COMMENT read GetDefaultAttribute;
@@ -1104,9 +1098,7 @@
 
 constructor TSynCustomHighlighter.Create(AOwner: TComponent);
 begin
-  {$IFDEF SYN_LAZARUS}
   FCapabilities:=GetCapabilities;
-  {$ENDIF}
   FKnownLines := TSynEditLinesList.Create;
   inherited Create(AOwner);
   fWordBreakChars := TSynWordBreakChars;
@@ -1276,14 +1268,12 @@
   fAttributes.AddObject(AAttrib.StoredName, AAttrib);
 end;
 
-{$IFDEF SYN_LAZARUS}
 function TSynCustomHighlighter.AddSpecialAttribute(const AttribName: string;
   const aStoredName: string):TSynHighlighterAttributes;
 begin
   result := TSynHighlighterAttributes.Create(AttribName,aStoredName);
   AddAttribute(result);
 end;
-{$ENDIF}
 
 procedure TSynCustomHighlighter.DefHighlightChange(Sender: TObject);
 begin
Index: syneditstrconst.pp
===================================================================
--- syneditstrconst.pp	(revision 37471)
+++ syneditstrconst.pp	(working copy)
@@ -334,11 +334,9 @@
   SYNS_FilterTeX                =  'TeX Files (*.tex)|*.tex';
   SYNS_FilterPo                 =  'Po Files (*.po)|*.po';
 
-{$IFDEF SYN_LAZARUS}
 // Currently the language names are used to identify the language
 // ToDo: create translation table
 const
-{$ENDIF}
   // Language names. Maybe somebody wants them translated / more detailed...
   SYNS_LangHP48                 =  'HP48';
   SYNS_LangCAClipper            =  'CA-Clipper';
Index: synhighlighterany.pas
===================================================================
--- synhighlighterany.pas	(revision 37471)
+++ synhighlighterany.pas	(working copy)
@@ -177,9 +177,7 @@
     function GetRange: Pointer; override;
     function GetTokenID: TtkTokenKind;
     function GetToken: String; override;
-    {$IFDEF SYN_LAZARUS}
     procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
-    {$ENDIF}
     function GetTokenAttribute: TSynHighlighterAttributes; override;
     function GetTokenKind: integer; override;
     function GetTokenPos: Integer; override;
@@ -236,16 +234,10 @@
 
 var
   Identifiers: array[#0..#255] of ByteBool;
-{$IFNDEF SYN_LAZARUS}
-  mHashTable: array[#0..#255] of Integer;
-{$ENDIF}
 
 procedure MakeIdentTable;
 var
   I: Char;
-  {$IFNDEF SYN_LAZARUS}
-  J: Char;
-  {$ENDIF}
   idents:string;
 begin
   idents:='_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-?!';
@@ -256,13 +248,6 @@
 //    case I in ['_', '0'..'9', 'a'..'z', 'A'..'Z','-','?','!'] of true: Identifiers[I] := True;
 //    else Identifiers[I] := False;
 //    end;
-    {$IFNDEF SYN_LAZARUS}
-    J := UpCase(I);
-    Case I in ['_', 'a'..'z', 'A'..'Z'] of
-      True: mHashTable[I] := Ord(J) - 64
-    else mHashTable[I] := 0;
-    end;
-    {$ENDIF}
   end;
 end;
 
@@ -278,11 +263,7 @@
   while First <= Last do
   begin
     I := (First + Last) shr 1;
-    {$IFDEF SYN_LAZARUS}
     Compare := AnsiCompareStr(fKeywords[i], Token);
-    {$ELSE}
-    Compare := CompareStr(fKeywords[i], Token);
-    {$ENDIF}
     if Compare = 0 then
     begin
       Result := True;
@@ -305,11 +286,7 @@
   while First <= Last do
   begin
     I := (First + Last) shr 1;
-    {$IFDEF SYN_LAZARUS}
     Compare := AnsiCompareStr(fConstants[i], Token);
-    {$ELSE}
-    Compare := CompareStr(fConstants[i], Token);
-    {$ENDIF}
     if Compare = 0 then
     begin
       Result := True;
@@ -331,11 +308,7 @@
   while First <= Last do
   begin
     I := (First + Last) shr 1;
-    {$IFDEF SYN_LAZARUS}
     Compare := AnsiCompareStr(fObjects[i], Token);
-    {$ELSE}
-    Compare := CompareStr(fObjects[i], Token);
-    {$ENDIF}
     if Compare = 0 then
     begin
       Result := True;
@@ -354,53 +327,53 @@
     case I of
       #39: begin
              if csVBStyle in comments then begin
-               fProcTable[I] := {$ifdef FPC}@{$endif}ApostropheProc;
+               fProcTable[I] := @ApostropheProc;
                fStringDelimch:= #34;
              end
              else
-               fProcTable[I] := {$ifdef FPC}@{$endif}UnknownProc;
+               fProcTable[I] := @UnknownProc;
            end;
       '<': begin
              if markup then
-               fProcTable[i]:= {$ifdef FPC}@{$endif}SmallerThan
+               fProcTable[i]:= @SmallerThan
              else
-               fProcTable[I] := {$ifdef FPC}@{$endif}UnknownProc;
+               fProcTable[I] := @UnknownProc;
            end;
       '>': begin
              if markup then
-               fProcTable[i]:= {$ifdef FPC}@{$endif}GreaterThan
+               fProcTable[i]:= @GreaterThan
              else
-               fProcTable[I] := {$ifdef FPC}@{$endif}UnknownProc;
+               fProcTable[I] := @UnknownProc;
            end;
       '&': begin
              if Entity then
-               fProcTable[i]:= {$ifdef FPC}@{$endif}AmpersandProc
+               fProcTable[i]:= @AmpersandProc
              else
-               fProcTable[I] := {$ifdef FPC}@{$endif}UnknownProc;
+               fProcTable[I] := @UnknownProc;
            end;
-      '#': fProcTable[I] := {$ifdef FPC}@{$endif}AsciiCharProc;
-      '{': fProcTable[I] := {$ifdef FPC}@{$endif}BraceOpenProc;
-      '}': fProcTable[I] := {$ifdef FPC}@{$endif}BraceCloseProc;
-      ';': fProcTable[I] := {$ifdef FPC}@{$endif}PointCommaProc;
-      #13: fProcTable[I] := {$ifdef FPC}@{$endif}CRProc;
-      'A'..'Z', 'a'..'z', '_': fProcTable[I] := {$ifdef FPC}@{$endif}IdentProc;
+      '#': fProcTable[I] := @AsciiCharProc;
+      '{': fProcTable[I] := @BraceOpenProc;
+      '}': fProcTable[I] := @BraceCloseProc;
+      ';': fProcTable[I] := @PointCommaProc;
+      #13: fProcTable[I] := @CRProc;
+      'A'..'Z', 'a'..'z', '_': fProcTable[I] := @IdentProc;
       '$': begin
              if dollarvariables then
-               fProcTable[I] := {$ifdef FPC}@{$endif}DollarProc
+               fProcTable[I] := @DollarProc
              else
-               fProcTable[I] := {$ifdef FPC}@{$endif}IntegerProc;
+               fProcTable[I] := @IntegerProc;
            end;
-      '.': fProcTable[i] := {$ifdef FPC}@{$endif}DotProc;
-      #10: fProcTable[I] := {$ifdef FPC}@{$endif}LFProc;
-      #0: fProcTable[I] := {$ifdef FPC}@{$endif}NullProc;
-      '0'..'9': fProcTable[I] := {$ifdef FPC}@{$endif}NumberProc;
-      '(': fProcTable[I] := {$ifdef FPC}@{$endif}RoundOpenProc;
-      ')': fProcTable[I] := {$ifdef FPC}@{$endif}RoundCloseProc;
-      '/': fProcTable[I] := {$ifdef FPC}@{$endif}SlashProc;
-      #1..#9, #11, #12, #14..#32: fProcTable[I] := {$ifdef FPC}@{$endif}SpaceProc;
-      else fProcTable[I] := {$ifdef FPC}@{$endif}UnknownProc;
+      '.': fProcTable[i] := @DotProc;
+      #10: fProcTable[I] := @LFProc;
+      #0: fProcTable[I] := @NullProc;
+      '0'..'9': fProcTable[I] := @NumberProc;
+      '(': fProcTable[I] := @RoundOpenProc;
+      ')': fProcTable[I] := @RoundCloseProc;
+      '/': fProcTable[I] := @SlashProc;
+      #1..#9, #11, #12, #14..#32: fProcTable[I] := @SpaceProc;
+      else fProcTable[I] := @UnknownProc;
     end;
-    fProcTable[fStringDelimCh] := {$ifdef FPC}@{$endif}StringProc;
+    fProcTable[fStringDelimCh] := @StringProc;
 end;
 
 constructor TSynAnySyn.Create(AOwner: TComponent);
@@ -454,7 +427,7 @@
   AddAttribute(fVariableAttri);
   fPreprocessorAttri := TSynHighlighterAttributes.Create(SYNS_AttrPreprocessor, SYNS_XML_AttrPreprocessor);
   AddAttribute(fPreprocessorAttri);
-  SetAttributesOnChange({$IFDEF FPC}@{$ENDIF}DefHighlightChange);
+  SetAttributesOnChange(@DefHighlightChange);
 
   fStringDelimCh := '''';
   fIdentChars := inherited GetIdentChars;
@@ -789,10 +762,8 @@
 procedure TSynAnySyn.UnknownProc;
 begin
   inc(Run);
-  {$IFDEF SYN_LAZARUS}
   while (fLine[Run] in [#128..#191]) OR // continued utf8 subcode
    ((fLine[Run]<>#0) and (fProcTable[fLine[Run]] = @UnknownProc)) do inc(Run);
-  {$ENDIF}
   fTokenID := tkUnKnown;
 end;
 
@@ -840,16 +811,13 @@
   SetString(Result, (FLine + fTokenPos), Len);
 end;
 
-{$IFDEF SYN_LAZARUS}
 procedure TSynAnySyn.GetTokenEx(out TokenStart: PChar;
   out TokenLength: integer);
 begin
   TokenLength:=Run-fTokenPos;
   TokenStart:=FLine + fTokenPos;
 end;
-{$ENDIF}
 
-
 function TSynAnySyn.GetTokenID: TtkTokenKind;
 begin
   Result := fTokenId;
@@ -1383,8 +1351,5 @@
 
 initialization
   MakeIdentTable;
-{$IFNDEF FPC}
-  RegisterPlaceableHighlighter(TSynAnySyn);
-{$ENDIF}
 end.
 
Index: synhighlightercpp.pp
===================================================================
--- synhighlightercpp.pp	(revision 37471)
+++ synhighlightercpp.pp	(working copy)
@@ -51,11 +51,7 @@
 
 uses
   SysUtils,
-  {$IFDEF SYN_LAZARUS}
   LCLIntf,
-  {$ELSE}
-  Windows, Messages,
-  {$ENDIF}
   Classes, Registry, Controls, Graphics,
   SynEditTypes, SynEditHighlighter;
 
@@ -236,11 +232,9 @@
     function GetEol: Boolean; override;
     function GetRange: Pointer; override;
     function GetTokenID: TtkTokenKind;
-    procedure SetLine({$IFDEF FPC}const {$ENDIF}NewValue: String; LineNumber:Integer); override;
+    procedure SetLine(const NewValue: String; LineNumber:Integer); override;
     function GetToken: String; override;
-    {$IFDEF SYN_LAZARUS}
     procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
-    {$ENDIF}
     function GetTokenAttribute: TSynHighlighterAttributes; override;
     function GetTokenKind: integer; override;
     function GetTokenPos: Integer; override;
@@ -308,63 +302,63 @@
 begin
   pF := PIdentFuncTableFunc(@fIdentFuncTable);
   for I := Low(fIdentFuncTable) to High(fIdentFuncTable) do begin
-    pF^ := {$IFDEF FPC}@{$ENDIF}AltFunc;
+    pF^ := @AltFunc;
     Inc(pF);
   end;
-  fIdentFuncTable[17] := {$IFDEF FPC}@{$ENDIF}Func17;
-  fIdentFuncTable[21] := {$IFDEF FPC}@{$ENDIF}Func21;
-  fIdentFuncTable[32] := {$IFDEF FPC}@{$ENDIF}Func32;
-  fIdentFuncTable[34] := {$IFDEF FPC}@{$ENDIF}Func34;
-  fIdentFuncTable[36] := {$IFDEF FPC}@{$ENDIF}Func36;
-  fIdentFuncTable[40] := {$IFDEF FPC}@{$ENDIF}Func40;
-  fIdentFuncTable[42] := {$IFDEF FPC}@{$ENDIF}Func42;
-  fIdentFuncTable[45] := {$IFDEF FPC}@{$ENDIF}Func45;
-  fIdentFuncTable[46] := {$IFDEF FPC}@{$ENDIF}Func46;
-  fIdentFuncTable[48] := {$IFDEF FPC}@{$ENDIF}Func48;
-  fIdentFuncTable[52] := {$IFDEF FPC}@{$ENDIF}Func52;
-  fIdentFuncTable[54] := {$IFDEF FPC}@{$ENDIF}Func54;
-  fIdentFuncTable[57] := {$IFDEF FPC}@{$ENDIF}Func57;
-  fIdentFuncTable[58] := {$IFDEF FPC}@{$ENDIF}Func58;
-  fIdentFuncTable[59] := {$IFDEF FPC}@{$ENDIF}Func59;
-  fIdentFuncTable[60] := {$IFDEF FPC}@{$ENDIF}Func60;
-  fIdentFuncTable[61] := {$IFDEF FPC}@{$ENDIF}Func61;
-  fIdentFuncTable[62] := {$IFDEF FPC}@{$ENDIF}Func62;
-  fIdentFuncTable[64] := {$IFDEF FPC}@{$ENDIF}Func64;
-  fIdentFuncTable[65] := {$IFDEF FPC}@{$ENDIF}Func65;
-  fIdentFuncTable[66] := {$IFDEF FPC}@{$ENDIF}Func66;
-  fIdentFuncTable[67] := {$IFDEF FPC}@{$ENDIF}Func67;
-  fIdentFuncTable[68] := {$IFDEF FPC}@{$ENDIF}Func68;
-  fIdentFuncTable[69] := {$IFDEF FPC}@{$ENDIF}Func69;
-  fIdentFuncTable[71] := {$IFDEF FPC}@{$ENDIF}Func71;
-  fIdentFuncTable[74] := {$IFDEF FPC}@{$ENDIF}Func74;
-  fIdentFuncTable[75] := {$IFDEF FPC}@{$ENDIF}Func75;
-  fIdentFuncTable[76] := {$IFDEF FPC}@{$ENDIF}Func76;
-  fIdentFuncTable[78] := {$IFDEF FPC}@{$ENDIF}Func78;
-  fIdentFuncTable[79] := {$IFDEF FPC}@{$ENDIF}Func79;
-  fIdentFuncTable[81] := {$IFDEF FPC}@{$ENDIF}Func81;
-  fIdentFuncTable[82] := {$IFDEF FPC}@{$ENDIF}Func82;
-  fIdentFuncTable[85] := {$IFDEF FPC}@{$ENDIF}Func85;
-  fIdentFuncTable[86] := {$IFDEF FPC}@{$ENDIF}Func86;
-  fIdentFuncTable[88] := {$IFDEF FPC}@{$ENDIF}Func88;
-  fIdentFuncTable[89] := {$IFDEF FPC}@{$ENDIF}Func89;
-  fIdentFuncTable[92] := {$IFDEF FPC}@{$ENDIF}Func92;
-  fIdentFuncTable[97] := {$IFDEF FPC}@{$ENDIF}Func97;
-  fIdentFuncTable[98] := {$IFDEF FPC}@{$ENDIF}Func98;
-  fIdentFuncTable[100] := {$IFDEF FPC}@{$ENDIF}Func100;
-  fIdentFuncTable[101] := {$IFDEF FPC}@{$ENDIF}Func101;
-  fIdentFuncTable[102] := {$IFDEF FPC}@{$ENDIF}Func102;
-  fIdentFuncTable[104] := {$IFDEF FPC}@{$ENDIF}Func104;
-  fIdentFuncTable[105] := {$IFDEF FPC}@{$ENDIF}Func105;
-  fIdentFuncTable[106] := {$IFDEF FPC}@{$ENDIF}Func106;
-  fIdentFuncTable[107] := {$IFDEF FPC}@{$ENDIF}Func107;
-  fIdentFuncTable[109] := {$IFDEF FPC}@{$ENDIF}Func109;
-  fIdentFuncTable[110] := {$IFDEF FPC}@{$ENDIF}Func110;
-  fIdentFuncTable[115] := {$IFDEF FPC}@{$ENDIF}Func115;
-  fIdentFuncTable[116] := {$IFDEF FPC}@{$ENDIF}Func116;
-  fIdentFuncTable[123] := {$IFDEF FPC}@{$ENDIF}Func123;
-  fIdentFuncTable[125] := {$IFDEF FPC}@{$ENDIF}Func125;
-  fIdentFuncTable[141] := {$IFDEF FPC}@{$ENDIF}Func141;
-  fIdentFuncTable[206] := {$IFDEF FPC}@{$ENDIF}Func206;
+  fIdentFuncTable[17] := @Func17;
+  fIdentFuncTable[21] := @Func21;
+  fIdentFuncTable[32] := @Func32;
+  fIdentFuncTable[34] := @Func34;
+  fIdentFuncTable[36] := @Func36;
+  fIdentFuncTable[40] := @Func40;
+  fIdentFuncTable[42] := @Func42;
+  fIdentFuncTable[45] := @Func45;
+  fIdentFuncTable[46] := @Func46;
+  fIdentFuncTable[48] := @Func48;
+  fIdentFuncTable[52] := @Func52;
+  fIdentFuncTable[54] := @Func54;
+  fIdentFuncTable[57] := @Func57;
+  fIdentFuncTable[58] := @Func58;
+  fIdentFuncTable[59] := @Func59;
+  fIdentFuncTable[60] := @Func60;
+  fIdentFuncTable[61] := @Func61;
+  fIdentFuncTable[62] := @Func62;
+  fIdentFuncTable[64] := @Func64;
+  fIdentFuncTable[65] := @Func65;
+  fIdentFuncTable[66] := @Func66;
+  fIdentFuncTable[67] := @Func67;
+  fIdentFuncTable[68] := @Func68;
+  fIdentFuncTable[69] := @Func69;
+  fIdentFuncTable[71] := @Func71;
+  fIdentFuncTable[74] := @Func74;
+  fIdentFuncTable[75] := @Func75;
+  fIdentFuncTable[76] := @Func76;
+  fIdentFuncTable[78] := @Func78;
+  fIdentFuncTable[79] := @Func79;
+  fIdentFuncTable[81] := @Func81;
+  fIdentFuncTable[82] := @Func82;
+  fIdentFuncTable[85] := @Func85;
+  fIdentFuncTable[86] := @Func86;
+  fIdentFuncTable[88] := @Func88;
+  fIdentFuncTable[89] := @Func89;
+  fIdentFuncTable[92] := @Func92;
+  fIdentFuncTable[97] := @Func97;
+  fIdentFuncTable[98] := @Func98;
+  fIdentFuncTable[100] := @Func100;
+  fIdentFuncTable[101] := @Func101;
+  fIdentFuncTable[102] := @Func102;
+  fIdentFuncTable[104] := @Func104;
+  fIdentFuncTable[105] := @Func105;
+  fIdentFuncTable[106] := @Func106;
+  fIdentFuncTable[107] := @Func107;
+  fIdentFuncTable[109] := @Func109;
+  fIdentFuncTable[110] := @Func110;
+  fIdentFuncTable[115] := @Func115;
+  fIdentFuncTable[116] := @Func116;
+  fIdentFuncTable[123] := @Func123;
+  fIdentFuncTable[125] := @Func125;
+  fIdentFuncTable[141] := @Func141;
+  fIdentFuncTable[206] := @Func206;
 end;
 
 function TSynCppSyn.KeyHash(ToHash: PChar): Integer;
@@ -725,7 +719,7 @@
   fToIdent := MayBe;
   HashKey := KeyHash(MayBe);
   if HashKey < 207 then
-    Result := fIdentFuncTable[HashKey]{$IFDEF FPC}(){$ENDIF}
+    Result := fIdentFuncTable[HashKey]()
   else
     Result := tkIdentifier;
 end;
@@ -736,41 +730,41 @@
 begin
   for I := #0 to #255 do
     case I of
-      '&': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}AndSymbolProc;
-      #39: fProcTable[I] := {$IFDEF FPC}@{$ENDIF}AsciiCharProc;
-      '@': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}AtSymbolProc;
-      '}': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}BraceCloseProc;
-      '{': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}BraceOpenProc;
-      #13: fProcTable[I] := {$IFDEF FPC}@{$ENDIF}CRProc;
-      ':': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}ColonProc;
-      ',': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}CommaProc;
-      '#': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}DirectiveProc;
-      '=': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}EqualProc;
-      '>': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}GreaterProc;
-      '?': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}QuestionProc;
-      'A'..'Z', 'a'..'z', '_': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}IdentProc;
-      #10: fProcTable[I] := {$IFDEF FPC}@{$ENDIF}LFProc;
-      '<': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}LowerProc;
-      '-': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}MinusProc;
-      '%': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}ModSymbolProc;
-      '!': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}NotSymbolProc;
-      #0: fProcTable[I] := {$IFDEF FPC}@{$ENDIF}NullProc;
-      '0'..'9': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}NumberProc;
-      '|': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}OrSymbolProc;
-      '+': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}PlusProc;
-      '.': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}PointProc;
-      ')': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}RoundCloseProc;
-      '(': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}RoundOpenProc;
-      ';': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}SemiColonProc;
-      '/': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}SlashProc;
-      #1..#9, #11, #12, #14..#32: fProcTable[I] := {$IFDEF FPC}@{$ENDIF}SpaceProc;
-      ']': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}SquareCloseProc;
-      '[': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}SquareOpenProc;
-      '*': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}StarProc;
-      #34: fProcTable[I] := {$IFDEF FPC}@{$ENDIF}StringProc;
-      '~': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}TildeProc;
-      '^': fProcTable[I] := {$IFDEF FPC}@{$ENDIF}XOrSymbolProc;
-      else fProcTable[I] := {$IFDEF FPC}@{$ENDIF}UnknownProc;
+      '&': fProcTable[I] := @AndSymbolProc;
+      #39: fProcTable[I] := @AsciiCharProc;
+      '@': fProcTable[I] := @AtSymbolProc;
+      '}': fProcTable[I] := @BraceCloseProc;
+      '{': fProcTable[I] := @BraceOpenProc;
+      #13: fProcTable[I] := @CRProc;
+      ':': fProcTable[I] := @ColonProc;
+      ',': fProcTable[I] := @CommaProc;
+      '#': fProcTable[I] := @DirectiveProc;
+      '=': fProcTable[I] := @EqualProc;
+      '>': fProcTable[I] := @GreaterProc;
+      '?': fProcTable[I] := @QuestionProc;
+      'A'..'Z', 'a'..'z', '_': fProcTable[I] := @IdentProc;
+      #10: fProcTable[I] := @LFProc;
+      '<': fProcTable[I] := @LowerProc;
+      '-': fProcTable[I] := @MinusProc;
+      '%': fProcTable[I] := @ModSymbolProc;
+      '!': fProcTable[I] := @NotSymbolProc;
+      #0: fProcTable[I] := @NullProc;
+      '0'..'9': fProcTable[I] := @NumberProc;
+      '|': fProcTable[I] := @OrSymbolProc;
+      '+': fProcTable[I] := @PlusProc;
+      '.': fProcTable[I] := @PointProc;
+      ')': fProcTable[I] := @RoundCloseProc;
+      '(': fProcTable[I] := @RoundOpenProc;
+      ';': fProcTable[I] := @SemiColonProc;
+      '/': fProcTable[I] := @SlashProc;
+      #1..#9, #11, #12, #14..#32: fProcTable[I] := @SpaceProc;
+      ']': fProcTable[I] := @SquareCloseProc;
+      '[': fProcTable[I] := @SquareOpenProc;
+      '*': fProcTable[I] := @StarProc;
+      #34: fProcTable[I] := @StringProc;
+      '~': fProcTable[I] := @TildeProc;
+      '^': fProcTable[I] := @XOrSymbolProc;
+      else fProcTable[I] := @UnknownProc;
     end;
 end;
 
@@ -800,7 +794,7 @@
   AddAttribute(fSymbolAttri);
   fDirecAttri := TSynHighlighterAttributes.Create(SYNS_AttrPreprocessor, SYNS_XML_AttrPreprocessor);
   AddAttribute(fDirecAttri);
-  SetAttributesOnChange({$IFDEF FPC}@{$ENDIF}DefHighlightChange);
+  SetAttributesOnChange(@DefHighlightChange);
   InitIdent;
   MakeMethodTables;
   fRange := rsUnknown;
@@ -1418,10 +1412,8 @@
 procedure TSynCppSyn.UnknownProc;
 begin
   inc(Run);
-  {$IFDEF SYN_LAZARUS}
   while (fLine[Run] in [#128..#191]) OR // continued utf8 subcode
    ((fLine[Run]<>#0) and (fProcTable[fLine[Run]] = @UnknownProc)) do inc(Run);
-  {$ENDIF}
   fTokenID := tkUnknown;
 end;
 
@@ -1475,14 +1467,12 @@
   SetString(Result, (FLine + fTokenPos), Len);
 end;
 
-{$IFDEF SYN_LAZARUS}
 procedure TSynCppSyn.GetTokenEx(out TokenStart: PChar;
   out TokenLength: integer);
 begin
   TokenLength:=Run-fTokenPos;
   TokenStart:=FLine + fTokenPos;
 end;
-{$ENDIF}
 
 function TSynCppSyn.GetTokenID: TtkTokenKind;
 begin
Index: synhighlighterpas.pp
===================================================================
--- synhighlighterpas.pp	(revision 37471)
+++ synhighlighterpas.pp	(working copy)
@@ -526,8 +526,7 @@
     procedure Next; override;
 
     procedure ResetRange; override;
-    procedure SetLine({$IFDEF FPC}const {$ENDIF}NewValue: string;
-      LineNumber: Integer); override;
+    procedure SetLine(const NewValue: string; LineNumber: Integer); override;
     procedure SetRange(Value: Pointer); override;
     procedure StartAtLineIndex(LineNumber:Integer); override; // 0 based
 
@@ -685,14 +684,9 @@
 begin
   pF := PIdentFuncTableFunc(@fIdentFuncTable);
   for I := Low(fIdentFuncTable) to High(fIdentFuncTable) do begin
-    {$IFDEF FPC}
     pF^ := @AltFunc;
-    {$ELSE}
-    pF^ := AltFunc;
-    {$ENDIF}
     Inc(pF);
   end;
-  {$IFDEF FPC}
   fIdentFuncTable[15] := @Func15;
   fIdentFuncTable[19] := @Func19;
   fIdentFuncTable[20] := @Func20;
@@ -781,81 +775,6 @@
   fIdentFuncTable[168] := @Func168;
   fIdentFuncTable[181] := @Func181;
   fIdentFuncTable[191] := @Func191;
-  {$ELSE}
-  fIdentFuncTable[15] := Func15;
-  fIdentFuncTable[19] := Func19;
-  fIdentFuncTable[20] := Func20;
-  fIdentFuncTable[21] := Func21;
-  fIdentFuncTable[23] := Func23;
-  fIdentFuncTable[25] := Func25;
-  fIdentFuncTable[27] := Func27;
-  fIdentFuncTable[28] := Func28;
-  fIdentFuncTable[32] := Func32;
-  fIdentFuncTable[33] := Func33;
-  fIdentFuncTable[35] := Func35;
-  fIdentFuncTable[37] := Func37;
-  fIdentFuncTable[38] := Func38;
-  fIdentFuncTable[39] := Func39;
-  fIdentFuncTable[40] := Func40;
-  fIdentFuncTable[41] := Func41;
-  fIdentFuncTable[44] := Func44;
-  fIdentFuncTable[45] := Func45;
-  fIdentFuncTable[47] := Func47;
-  fIdentFuncTable[49] := Func49;
-  fIdentFuncTable[52] := Func52;
-  fIdentFuncTable[54] := Func54;
-  fIdentFuncTable[55] := Func55;
-  fIdentFuncTable[56] := Func56;
-  fIdentFuncTable[57] := Func57;
-  fIdentFuncTable[59] := Func59;
-  fIdentFuncTable[60] := Func60;
-  fIdentFuncTable[61] := Func61;
-  fIdentFuncTable[63] := Func63;
-  fIdentFuncTable[64] := Func64;
-  fIdentFuncTable[65] := Func65;
-  fIdentFuncTable[66] := Func66;
-  fIdentFuncTable[69] := Func69;
-  fIdentFuncTable[71] := Func71;
-  fIdentFuncTable[72] := Func72;
-  fIdentFuncTable[73] := Func73;
-  fIdentFuncTable[75] := Func75;
-  fIdentFuncTable[76] := Func76;
-  fIdentFuncTable[79] := Func79;
-  fIdentFuncTable[81] := Func81;
-  fIdentFuncTable[84] := Func84;
-  fIdentFuncTable[85] := Func85;
-  fIdentFuncTable[86] := Func86;
-  fIdentFuncTable[87] := Func87;
-  fIdentFuncTable[88] := Func88;
-  fIdentFuncTable[91] := Func91;
-  fIdentFuncTable[92] := Func92;
-  fIdentFuncTable[94] := Func94;
-  fIdentFuncTable[95] := Func95;
-  fIdentFuncTable[96] := Func96;
-  fIdentFuncTable[97] := Func97;
-  fIdentFuncTable[98] := Func98;
-  fIdentFuncTable[99] := Func99;
-  fIdentFuncTable[100] := Func100;
-  fIdentFuncTable[101] := Func101;
-  fIdentFuncTable[102] := Func102;
-  fIdentFuncTable[103] := Func103;
-  fIdentFuncTable[105] := Func105;
-  fIdentFuncTable[106] := Func106;
-  fIdentFuncTable[117] := Func117;
-  fIdentFuncTable[124] := Func124;
-  fIdentFuncTable[126] := Func126;
-  fIdentFuncTable[129] := Func129;
-  fIdentFuncTable[132] := Func132;
-  fIdentFuncTable[133] := Func133;
-  fIdentFuncTable[136] := Func136;
-  fIdentFuncTable[141] := Func141;
-  fIdentFuncTable[143] := Func143;
-  fIdentFuncTable[158] := Func158;
-  fIdentFuncTable[166] := Func166;
-  fIdentFuncTable[168] := Func168;
-  fIdentFuncTable[181] := Func181;
-  fIdentFuncTable[191] := Func191;
-  {$ENDIF}
 end;
 
 function TSynPasSyn.KeyHash: Integer;
@@ -2244,7 +2163,7 @@
   fToIdent := p;
   HashKey := KeyHash;
   if HashKey < 192 then
-    Result := fIdentFuncTable[HashKey]{$IFDEF FPC}(){$ENDIF}
+    Result := fIdentFuncTable[HashKey]()
   else
     Result := tkIdentifier;
 end;
@@ -2254,7 +2173,6 @@
   I: Char;
 begin
   for I := #0 to #255 do
-    {$IFDEF FPC}
     case I of
       #0: fProcTable[I] := @NullProc;
       #10: fProcTable[I] := @LFProc;
@@ -2292,43 +2210,6 @@
     else
       fProcTable[I] := @UnknownProc;
     end;
-    {$ELSE}
-    case I of
-      #0: fProcTable[I] := NullProc;
-      #10: fProcTable[I] := LFProc;
-      #13: fProcTable[I] := CRProc;
-      #1..#9, #11, #12, #14..#32:
-        fProcTable[I] := SpaceProc;
-      '#': fProcTable[I] := AsciiCharProc;
-      '$': fProcTable[I] := HexProc;
-      #39: fProcTable[I] := StringProc;
-      '0'..'9': fProcTable[I] := NumberProc;
-      'A'..'Z', 'a'..'z', '_':
-        fProcTable[I] := IdentProc;
-      '{': fProcTable[I] := BraceOpenProc;
-      '}', '!', '"', '%', '&', '('..'/', ':'..'@', '['..'^', '`', '~':
-        begin
-          case I of
-            '(': fProcTable[I] := RoundOpenProc;
-            ')': fProcTable[I] := RoundCloseProc;
-            '[': fProcTable[I] := SquareOpenProc;
-            ']': fProcTable[I] := SquareCloseProc;
-            '=': fProcTable[I] := EqualSignProc;
-            '.': fProcTable[I] := PointProc;
-            ';': fProcTable[I] := SemicolonProc;                                //mh 2000-10-08
-            '/': fProcTable[I] := SlashProc;
-            ':': fProcTable[I] := ColonProc;
-            '>': fProcTable[I] := GreaterProc;
-            '<': fProcTable[I] := LowerProc;
-            '@': fProcTable[I] := AddressOpProc;
-          else
-            fProcTable[I] := SymbolProc;
-          end;
-        end;
-    else
-      fProcTable[I] := UnknownProc;
-    end;
-    {$ENDIF}
 end;
 
 constructor TSynPasSyn.Create(AOwner: TComponent);
@@ -2368,7 +2249,7 @@
   fDirectiveAttri.Style:= [fsItalic];
   AddAttribute(fDirectiveAttri);
   CompilerMode:=pcmDelphi;
-  SetAttributesOnChange({$IFDEF FPC}@{$ENDIF}DefHighlightChange);
+  SetAttributesOnChange(@DefHighlightChange);
 
   InitIdent;
   MakeMethodTables;
@@ -3904,7 +3785,7 @@
   for i := low(TSynPasDividerDrawLocation) to high(TSynPasDividerDrawLocation) do
   begin
     FDividerDrawConfig[i] := TSynDividerDrawConfig.Create;
-    FDividerDrawConfig[i].OnChange := {$IFDEF FPC}@{$ENDIF}DefHighlightChange;
+    FDividerDrawConfig[i].OnChange := @DefHighlightChange;
     FDividerDrawConfig[i].MaxDrawDepth := PasDividerDrawLocationDefaults[i];
   end;
 end;
synedit-clean-2.patch (27,658 bytes)   

Zaher Dirkey

2012-06-03 18:52

reporter   ~0060232

Thanks, It is related to

http://bugs.freepascal.org/view.php?id=22186

Issue History

Date Modified Username Field Change
2012-06-02 22:13 Zaher Dirkey New Issue
2012-06-02 22:13 Zaher Dirkey File Added: synedit-clean-2.patch
2012-06-02 22:54 Martin Friebe Status new => assigned
2012-06-02 22:54 Martin Friebe Assigned To => Martin Friebe
2012-06-02 23:20 Martin Friebe Fixed in Revision => 37490
2012-06-02 23:20 Martin Friebe LazTarget => 1.2
2012-06-02 23:20 Martin Friebe Status assigned => resolved
2012-06-02 23:20 Martin Friebe Fixed in Version => 1.1 (SVN)
2012-06-02 23:20 Martin Friebe Resolution open => fixed
2012-06-02 23:20 Martin Friebe Target Version => 1.2.0
2012-06-03 18:52 Zaher Dirkey Status resolved => closed
2012-06-03 18:52 Zaher Dirkey Note Added: 0060232