浏览代码

fcl-passrc: useanalyzer: do not export resourcestrings

git-svn-id: trunk@43310 -
Mattias Gaertner 5 年之前
父节点
当前提交
acc72f01a1
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 4 1
      packages/fcl-passrc/src/pasuseanalyzer.pas
  2. 1 1
      packages/fcl-passrc/tests/tcuseanalyzer.pas

+ 4 - 1
packages/fcl-passrc/src/pasuseanalyzer.pas

@@ -1404,7 +1404,10 @@ begin
       UseVariable(TPasVariable(Decl),rraNone,true);
       UseVariable(TPasVariable(Decl),rraNone,true);
       end
       end
     else if C=TPasResString then
     else if C=TPasResString then
-      UseResourcestring(TPasResString(Decl))
+      begin
+      if OnlyExports then continue;
+      UseResourcestring(TPasResString(Decl));
+      end
     else if C=TPasAttributes then
     else if C=TPasAttributes then
       // attributes are never used directly
       // attributes are never used directly
     else
     else

+ 1 - 1
packages/fcl-passrc/tests/tcuseanalyzer.pas

@@ -842,9 +842,9 @@ begin
   StartProgram(false);
   StartProgram(false);
   Add([
   Add([
   'resourcestring',
   'resourcestring',
-  'resourcestring',
   '  {#a_used}a = ''txt'';',
   '  {#a_used}a = ''txt'';',
   '  {#b_used}b = ''foo'';',
   '  {#b_used}b = ''foo'';',
+  '  {#c_notused}c = ''bar'';',
   'procedure {#DoIt_used}DoIt(s: string);',
   'procedure {#DoIt_used}DoIt(s: string);',
   'var',
   'var',
   '  {#d_used}d: string;',
   '  {#d_used}d: string;',