View Issue Details

IDProjectCategoryView StatusLast Update
0036548LazarusIDEpublic2020-03-21 22:02
ReportersimoneAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.0.4Product Build 
Target VersionFixed in Version 
Summary0036548: JCF formatter problems with global properties
DescriptionJCF formatter is not able to format global properties (see example in the next box)
Steps To ReproduceCODE TO FORMAT WITH JCF:

Program property0;
var
  fProp : integer;

function GetProp:integer;
begin
  result:=fProp;
end;

procedure SetProp(VarIn : integer);
begin
  fProp:=VarIn;
end;

Property Prop : integer Read GetProp Write SetProp;

begin
End.

MESSAGE ERROR:
JCF, Errors: 1
project1.lpr(15,1) Error: Exception TEParseError Unexpected token, expected "BEGIN"
Near PROPERTY
IDE Aborted due to error
TagsNo tags attached.
Fixed in Revisionr62790
LazTarget-
Widgetset
Attached Files
  • property.diff (1,258 bytes)
    Index: /home/ravi/lazsvn/components/jcf2/Parse/BuildParseTree.pas
    ===================================================================
    --- /home/ravi/lazsvn/components/jcf2/Parse/BuildParseTree.pas	(revision 62767)
    +++ /home/ravi/lazsvn/components/jcf2/Parse/BuildParseTree.pas	(working copy)
    @@ -781,7 +781,7 @@
     
       }
       while fcTokenList.FirstSolidTokenType in [ttConst, ttResourceString,
    -      ttType, ttVar, ttThreadVar, ttOpenSquareBracket, ttExports, ttOperator] + ProcedureWords do
    +      ttType, ttVar, ttThreadVar, ttOpenSquareBracket, ttExports, ttOperator, ttProperty] + ProcedureWords do
         RecogniseInterfaceDecl;
     end;
     
    @@ -815,6 +815,11 @@
           RecogniseAttributes;
         ttExports:
           RecogniseExportsSection;
    +    ttProperty:
    +    begin
    +      RecogniseProperty;
    +      Recognise(ttSemicolon);
    +    end
         else
           raise TEParseError.Create('Expected const, type, var, procedure or function', lc);
       end;
    @@ -955,6 +960,12 @@
           RecogniseProcedureDeclSection;
         ttExports:
           RecogniseExportsSection;
    +    ttProperty:
    +    begin
    +      RecogniseProperty;
    +      Recognise(ttSemicolon);
    +    end
    +
         else
           raise TEParseError.Create(
             'Expected label, const, type, var, procedure or function', lc);
    
    
    property.diff (1,258 bytes)

Activities

delfion

2020-03-20 20:31

reporter   ~0121667

Please test

property.diff (1,258 bytes)
Index: /home/ravi/lazsvn/components/jcf2/Parse/BuildParseTree.pas
===================================================================
--- /home/ravi/lazsvn/components/jcf2/Parse/BuildParseTree.pas	(revision 62767)
+++ /home/ravi/lazsvn/components/jcf2/Parse/BuildParseTree.pas	(working copy)
@@ -781,7 +781,7 @@
 
   }
   while fcTokenList.FirstSolidTokenType in [ttConst, ttResourceString,
-      ttType, ttVar, ttThreadVar, ttOpenSquareBracket, ttExports, ttOperator] + ProcedureWords do
+      ttType, ttVar, ttThreadVar, ttOpenSquareBracket, ttExports, ttOperator, ttProperty] + ProcedureWords do
     RecogniseInterfaceDecl;
 end;
 
@@ -815,6 +815,11 @@
       RecogniseAttributes;
     ttExports:
       RecogniseExportsSection;
+    ttProperty:
+    begin
+      RecogniseProperty;
+      Recognise(ttSemicolon);
+    end
     else
       raise TEParseError.Create('Expected const, type, var, procedure or function', lc);
   end;
@@ -955,6 +960,12 @@
       RecogniseProcedureDeclSection;
     ttExports:
       RecogniseExportsSection;
+    ttProperty:
+    begin
+      RecogniseProperty;
+      Recognise(ttSemicolon);
+    end
+
     else
       raise TEParseError.Create(
         'Expected label, const, type, var, procedure or function', lc);

property.diff (1,258 bytes)

Juha Manninen

2020-03-21 22:02

developer   ~0121678

Applied, thanks.

Issue History

Date Modified Username Field Change
2020-01-10 14:24 simone New Issue
2020-03-20 20:31 delfion File Added: property.diff
2020-03-20 20:31 delfion Note Added: 0121667
2020-03-21 21:50 Juha Manninen Assigned To => Juha Manninen
2020-03-21 21:50 Juha Manninen Status new => assigned
2020-03-21 22:02 Juha Manninen Status assigned => resolved
2020-03-21 22:02 Juha Manninen Resolution open => fixed
2020-03-21 22:02 Juha Manninen Fixed in Revision => r62790
2020-03-21 22:02 Juha Manninen LazTarget => -
2020-03-21 22:02 Juha Manninen Note Added: 0121678