View Issue Details

IDProjectCategoryView StatusLast Update
0015968LazarusIDEpublic2010-03-26 16:02
ReporterMartin FriebeAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target Version0.9.30Fixed in Version0.9.30 
Summary0015968: CodeTools does not parse hint-directive(deprecated)
DescriptionCreate a new application and insert a deprecated property (like in the example code).

Try code completion:
unit1.pas(16,79) Error: : expected, but ; found

Codetools believes "deprecated" is the name of an identifier (eg field)

The problem only exists, if the default keyword is used.
Additional Information  TForm1 = class(TForm)
  private
    { private declarations }
  public
    { public declarations }
    property Items[Index: integer]: TObject read GetItems; default; deprecated;
  end;
TagsNo tags attached.
Fixed in Revision24218
LazTarget0.9.30
Widgetset
Attached Files
  • codetools.patch (1,510 bytes)
    Index: pascalparsertool.pas
    ===================================================================
    --- pascalparsertool.pas	(revision 23988)
    +++ pascalparsertool.pas	(working copy)
    @@ -2075,12 +2075,6 @@
           ReadNextAtom;
           if CurPos.Flag<>cafSemicolon then
             RaiseSemicolonAfterPropSpecMissing('nodefault');
    -    end else if UpAtomIs('DEPRECATED') then begin
    -      ReadNextAtom;
    -      if AtomIsStringConstant then
    -        ReadConstant(true,false,[]);
    -      if CurPos.Flag<>cafSemicolon then
    -        RaiseSemicolonAfterPropSpecMissing('deprecated');
         end else if UpAtomIs('ENUMERATOR') then begin
           ReadNextAtom;
           AtomIsIdentifier(true);
    @@ -2089,6 +2083,26 @@
             RaiseSemicolonAfterPropSpecMissing('enumerator');
         end else
           UndoReadNextAtom;
    +
    +    if CurPos.Flag=cafSemicolon then begin
    +      // read hint directives
    +      ReadNextAtom;
    +      if UpAtomIs('DEPRECATED') then begin
    +        ReadNextAtom;
    +        if AtomIsStringConstant then
    +          ReadConstant(true,false,[]);
    +        if CurPos.Flag<>cafSemicolon then
    +          RaiseSemicolonAfterPropSpecMissing('deprecated');
    +      end else if UpAtomIs('PLATFORM') or UpAtomIs('UNIMPLEMENTED')
    +        or UpAtomIs('EXPERIMENTAL')
    +      then begin
    +        ReadNextAtom;
    +        if CurPos.Flag<>cafSemicolon then
    +          RaiseSemicolonAfterPropSpecMissing('hint directive');
    +      end else
    +        UndoReadNextAtom;
    +    end;
    +
       end else
         UndoReadNextAtom;
       // close property
    
    codetools.patch (1,510 bytes)

Activities

2010-03-14 13:20

 

codetools.patch (1,510 bytes)
Index: pascalparsertool.pas
===================================================================
--- pascalparsertool.pas	(revision 23988)
+++ pascalparsertool.pas	(working copy)
@@ -2075,12 +2075,6 @@
       ReadNextAtom;
       if CurPos.Flag<>cafSemicolon then
         RaiseSemicolonAfterPropSpecMissing('nodefault');
-    end else if UpAtomIs('DEPRECATED') then begin
-      ReadNextAtom;
-      if AtomIsStringConstant then
-        ReadConstant(true,false,[]);
-      if CurPos.Flag<>cafSemicolon then
-        RaiseSemicolonAfterPropSpecMissing('deprecated');
     end else if UpAtomIs('ENUMERATOR') then begin
       ReadNextAtom;
       AtomIsIdentifier(true);
@@ -2089,6 +2083,26 @@
         RaiseSemicolonAfterPropSpecMissing('enumerator');
     end else
       UndoReadNextAtom;
+
+    if CurPos.Flag=cafSemicolon then begin
+      // read hint directives
+      ReadNextAtom;
+      if UpAtomIs('DEPRECATED') then begin
+        ReadNextAtom;
+        if AtomIsStringConstant then
+          ReadConstant(true,false,[]);
+        if CurPos.Flag<>cafSemicolon then
+          RaiseSemicolonAfterPropSpecMissing('deprecated');
+      end else if UpAtomIs('PLATFORM') or UpAtomIs('UNIMPLEMENTED')
+        or UpAtomIs('EXPERIMENTAL')
+      then begin
+        ReadNextAtom;
+        if CurPos.Flag<>cafSemicolon then
+          RaiseSemicolonAfterPropSpecMissing('hint directive');
+      end else
+        UndoReadNextAtom;
+    end;
+
   end else
     UndoReadNextAtom;
   // close property
codetools.patch (1,510 bytes)

Issue History

Date Modified Username Field Change
2010-03-12 03:46 Martin Friebe New Issue
2010-03-12 03:46 Martin Friebe LazTarget => -
2010-03-12 16:13 Vincent Snijders Assigned To => Mattias Gaertner
2010-03-12 16:13 Vincent Snijders Status new => assigned
2010-03-14 13:20 Martin Friebe File Added: codetools.patch
2010-03-26 12:59 Martin Friebe Assigned To Mattias Gaertner => Martin Friebe
2010-03-26 13:00 Martin Friebe Fixed in Revision => 24218
2010-03-26 13:00 Martin Friebe LazTarget - => 0.9.30
2010-03-26 13:00 Martin Friebe Status assigned => resolved
2010-03-26 13:00 Martin Friebe Fixed in Version => 0.9.30
2010-03-26 13:00 Martin Friebe Resolution open => fixed
2010-03-26 13:00 Martin Friebe Target Version => 0.9.30
2010-03-26 16:02 Martin Friebe Status resolved => closed