Fix for Mantis #25959.

* pdecsub.pas, parse_proc_direc:
    when a hint directive is parsed we need to check whether the new token can still be a directive

+ added test (though that won't help much as we don't check the compiler output yet... :/ )

git-svn-id: trunk@27463 -
This commit is contained in:
svenbarth 2014-04-04 14:04:32 +00:00
parent 8efd857d76
commit 689996d84f
3 changed files with 21 additions and 1 deletions

1
.gitattributes vendored
View File

@ -13890,6 +13890,7 @@ tests/webtbs/tw25895.pp svneol=native#text/pascal
tests/webtbs/tw25929.pp svneol=native#text/pascal
tests/webtbs/tw2594.pp svneol=native#text/plain
tests/webtbs/tw2595.pp svneol=native#text/plain
tests/webtbs/tw25959.pp svneol=native#text/pascal
tests/webtbs/tw2602.pp svneol=native#text/plain
tests/webtbs/tw2607.pp svneol=native#text/plain
tests/webtbs/tw2620.pp svneol=native#text/plain

View File

@ -2503,7 +2503,13 @@ const
_EXPERIMENTAL,
_DEPRECATED :
if (m_delphi in current_settings.modeswitches) and (pd.typ=procdef) then
maybe_parse_hint_directives(tprocdef(pd))
begin
maybe_parse_hint_directives(tprocdef(pd));
{ could the new token still be a directive? }
if token<>_ID then
exit;
name:=tokeninfo^[idtoken].str;
end
else
exit;
end;

13
tests/webtbs/tw25959.pp Normal file
View File

@ -0,0 +1,13 @@
{ %NORUN }
program tw25959;
{$mode delphi}
procedure test; deprecated;
begin
end;
begin
test;
end.