Forráskód Böngészése

* support {$i *.ext} to include source files with the same base name, but
with a different extension than the current source file (mantis #13696)

git-svn-id: trunk@13163 -

Jonas Maebe 16 éve
szülő
commit
b59d1f724b
4 módosított fájl, 18 hozzáadás és 0 törlés
  1. 2 0
      .gitattributes
  2. 6 0
      compiler/scanner.pas
  3. 3 0
      tests/webtbs/tw13696.inc
  4. 7 0
      tests/webtbs/tw13696.pp

+ 2 - 0
.gitattributes

@@ -8866,6 +8866,8 @@ tests/webtbs/tw13628b.pp svneol=native#text/plain
 tests/webtbs/tw13639.pp svneol=native#text/plain
 tests/webtbs/tw1364.pp svneol=native#text/plain
 tests/webtbs/tw1365.pp svneol=native#text/plain
+tests/webtbs/tw13696.inc svneol=native#text/plain
+tests/webtbs/tw13696.pp svneol=native#text/plain
 tests/webtbs/tw1374.pp svneol=native#text/plain
 tests/webtbs/tw1375.pp svneol=native#text/plain
 tests/webtbs/tw1376.pp svneol=native#text/plain

+ 6 - 0
compiler/scanner.pas

@@ -1682,6 +1682,12 @@ In case not, the value returned can be arbitrary.
            hs:=FixFileName(hs);
            path:=ExtractFilePath(hs);
            name:=ExtractFileName(hs);
+           { Special case for Delphi compatibility: '*' has to be replaced
+             by the file name of the current source file.  }
+           if (length(name)>=1) and
+              (name[1]='*') then
+             name:=ChangeFileExt(current_module.sourcefiles.get_file_name(current_filepos.fileindex),'')+ExtractFileExt(name);
+
            { try to find the file }
            found:=findincludefile(path,name,foundfile);
            if (ExtractFileExt(name)='') then

+ 3 - 0
tests/webtbs/tw13696.inc

@@ -0,0 +1,3 @@
+procedure test;
+begin
+end;

+ 7 - 0
tests/webtbs/tw13696.pp

@@ -0,0 +1,7 @@
+{ %norun }
+
+{$i *.inc}
+
+begin
+  test;
+end.