Browse Source

* Fixed parsing of constref and one more case of deprecated hint

git-svn-id: trunk@21850 -
michael 13 years ago
parent
commit
f8e6cfc6b8

+ 2 - 2
packages/fcl-passrc/src/pastree.pp

@@ -496,7 +496,7 @@ type
 
 
 
-  TArgumentAccess = (argDefault, argConst, argVar, argOut);
+  TArgumentAccess = (argDefault, argConst, argVar, argOut, argConstRef);
 
   { TPasArgument }
 
@@ -1032,7 +1032,7 @@ type
   end;
 
 const
-  AccessNames: array[TArgumentAccess] of string[6] = ('', 'const ', 'var ', 'out ');
+  AccessNames: array[TArgumentAccess] of string[9] = ('', 'const ', 'var ', 'out ','constref ');
   AllVisibilities: TPasMemberVisibilities =
      [visDefault, visPrivate, visProtected, visPublic,
       visPublished, visAutomated];

+ 12 - 0
packages/fcl-passrc/src/pparser.pp

@@ -2357,6 +2357,10 @@ begin
         begin
           Access := argConst;
           Name := ExpectIdentifier;
+        end else if CurToken = tkConstRef then
+        begin
+          Access := argConstref;
+          Name := ExpectIdentifier;
         end else if CurToken = tkVar then
         begin
           Access := ArgVar;
@@ -2597,6 +2601,14 @@ begin
       if IsCurTokenHint(ahint) then  // deprecated,platform,experimental,library, unimplemented etc
         begin
         element.hints:=element.hints+[ahint];
+        if aHint=hDeprecated then
+          begin
+          nextToken;
+          if (CurToken<>tkString) then
+            UnGetToken
+          else
+            element.HintMessage:=curtokenstring;
+          end;  
         consumesemi;
         end
       else if (tok = 'PUBLIC') then

+ 2 - 0
packages/fcl-passrc/src/pscanner.pp

@@ -87,6 +87,7 @@ type
     tkcase,
     tkclass,
     tkconst,
+    tkconstref,
     tkconstructor,
     tkdestructor,
     tkdiv,
@@ -412,6 +413,7 @@ const
     'case',
     'class',
     'const',
+    'constref',
     'constructor',
     'destructor',
     'div',