Ver Fonte

fcl-passrc: fixed proc arg file

mattias há 7 meses atrás
pai
commit
5e41a1417f

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

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

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

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