View Issue Details

IDProjectCategoryView StatusLast Update
0037734LazarusPackagespublic2020-09-11 17:27
ReporterBrunoK Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWinOSWin 
Summary0037734: Jedi code format with FPC 3.0.4
Descriptionr63879 : due to use of FPC functions >= 3.2, it is not possible to build lazarus trunk.
TagsNo tags attached.
Fixed in Revisionr63881
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0037730 closedJuha Manninen [Patch] Jedi Code Format support for directive {$include %XXX%} 

Activities

BrunoK

2020-09-11 14:29

reporter  

jcf2_110920.patch (826 bytes)   
Index: components/jcf2/Parse/BuildTokenList.pas
===================================================================
--- components/jcf2/Parse/BuildTokenList.pas	(revision 63880)
+++ components/jcf2/Parse/BuildTokenList.pas	(working copy)
@@ -299,6 +299,7 @@
 
 var
   lLen, lPos: integer;
+  lUpperStr : string;
 begin
   Result := False;
   if Current <> '{' then
@@ -323,9 +324,10 @@
   begin
     lPos:=0;
     lLen:=length(pcToken.SourceCode);
-    if StartsText('{$include',pcToken.SourceCode)=true then
+    lUpperStr := UpperCase(pcToken.SourceCode);
+    if lUpperStr = '{$INCLUDE' then
       lPos:=10
-    else if StartsStr('{$I',pcToken.SourceCode)=true then
+    else if lUpperStr = '{$I' then
       lPos:=4;
     if (lPos>0) and (lPos<lLen) and (CharIsWhiteSpace(pcToken.SourceCode[lPos])) then
     begin
jcf2_110920.patch (826 bytes)   

Domingo Galmés

2020-09-11 15:29

reporter   ~0125481

I'm so sorry for the bug.
The patch supplied by BrunoK will not work, pcToken.SourceCode contains all the directive {$I %DATE%}, not only {$I
I suppos is better to change StartsText by AnsiStartsText and StartsStr by AnsiStartsStr or copy the implementation of the fpc 3.2.0.

I can't make the patch now, i need i can do it in few hours.

BrunoK

2020-09-11 16:14

reporter   ~0125484

jcf2_110920_1.patch (823 bytes)   
Index: components/jcf2/Parse/BuildTokenList.pas
===================================================================
--- components/jcf2/Parse/BuildTokenList.pas	(revision 63880)
+++ components/jcf2/Parse/BuildTokenList.pas	(working copy)
@@ -323,10 +323,11 @@
   begin
     lPos:=0;
     lLen:=length(pcToken.SourceCode);
-    if StartsText('{$include',pcToken.SourceCode)=true then
-      lPos:=10
-    else if StartsStr('{$I',pcToken.SourceCode)=true then
-      lPos:=4;
+    if AnsiStartsText('{$I', pcToken.SourceCode) then
+      if AnsiStartsText('{$INCLUDE', pcToken.SourceCode) then
+        lPos := 10
+      else
+        lPos := 4;
     if (lPos>0) and (lPos<lLen) and (CharIsWhiteSpace(pcToken.SourceCode[lPos])) then
     begin
       while (lPos<=lLen) and CharIsWhiteSpace(pcToken.SourceCode[lPos]) do
jcf2_110920_1.patch (823 bytes)   

Juha Manninen

2020-09-11 17:27

developer   ~0125486

I applied the last patch. Thanks.

Issue History

Date Modified Username Field Change
2020-09-11 14:29 BrunoK New Issue
2020-09-11 14:29 BrunoK File Added: jcf2_110920.patch
2020-09-11 15:29 Domingo Galmés Note Added: 0125481
2020-09-11 16:14 BrunoK Note Added: 0125484
2020-09-11 16:14 BrunoK File Added: jcf2_110920_1.patch
2020-09-11 17:24 Juha Manninen Relationship added related to 0037730
2020-09-11 17:24 Juha Manninen Assigned To => Juha Manninen
2020-09-11 17:24 Juha Manninen Status new => assigned
2020-09-11 17:27 Juha Manninen Status assigned => resolved
2020-09-11 17:27 Juha Manninen Resolution open => fixed
2020-09-11 17:27 Juha Manninen Fixed in Revision => r63881
2020-09-11 17:27 Juha Manninen LazTarget => -
2020-09-11 17:27 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-09-11 17:27 Juha Manninen Note Added: 0125486