ソースを参照

fcl-passrc: fixed proc arg file

mattias 8 ヶ月 前
コミット
5e41a1417f

+ 1 - 1
packages/fcl-passrc/src/pparser.pp

@@ -2159,7 +2159,7 @@ Const
   NoHintTokens = [tkProcedure,tkFunction];
   InterfaceKindTypes : Array[Boolean] of TPasObjKind = (okInterface,okObjcProtocol);
   ClassKindTypes : Array[TLocalClassType] of TPasObjKind = (okClass,okObjCClass,okObjcCategory,okClassHelper);
-  FuncArgResultTypeTokens = [tkIdentifier,tkarray,tkSpecialize];
+  FuncArgResultTypeTokens = [tkIdentifier,tkarray,tkSpecialize,tkfile];
 
 var
   PM: TPackMode;

+ 7 - 0
packages/fcl-passrc/tests/tcprocfunc.pas

@@ -104,6 +104,7 @@ type
     Procedure TestFunctionArrayOfConstArg;
     procedure TestProcedureConstArrayOfConstArg;
     Procedure TestFunctionConstArrayOfConstArg;
+    Procedure TestProcedureArgFile;
 
     Procedure TestProcedureCdecl;
     Procedure TestFunctionCdecl;
@@ -832,6 +833,12 @@ begin
   AssertArrayArg(FuncType,0,'B',argConst,'');
 end;
 
+procedure TTestProcedureFunction.TestProcedureArgFile;
+begin
+  ParseProcedure('(Const B : File)');
+  AssertProc([],[],ccDefault,1);
+end;
+
 procedure TTestProcedureFunction.TestCallingConventionSysV_ABI_Default;
 begin
   ParseProcedure('; SysV_ABI_Default');