* parentheses after an @-operator can contain a full expression, resolves #27517

git-svn-id: trunk@30272 -
This commit is contained in:
florian 2015-03-22 13:00:43 +00:00
parent 3396e2e1f4
commit 5f4dc5e54f
3 changed files with 15 additions and 6 deletions

1
.gitattributes vendored
View File

@ -14330,6 +14330,7 @@ tests/webtbs/tw2738.pp svneol=native#text/plain
tests/webtbs/tw2739.pp svneol=native#text/plain
tests/webtbs/tw27424.pp svneol=native#text/pascal
tests/webtbs/tw27515.pp svneol=native#text/pascal
tests/webtbs/tw27517.pp svneol=native#text/pascal
tests/webtbs/tw27529.pp svneol=native#text/pascal
tests/webtbs/tw2758.pp svneol=native#text/plain
tests/webtbs/tw2763.pp svneol=native#text/plain

View File

@ -3440,12 +3440,9 @@ implementation
if try_to_consume(_LKLAMMER) then
begin
p1:=factor(true,false);
if token in postfixoperator_tokens then
begin
again:=true;
postfixoperators(p1,again,getaddr);
end
else
{ inside parentheses a full expression is allowed, see also tests\webtbs\tb27517.pp }
if token<>_RKLAMMER then
p1:=sub_expr(opcompare,true,false,p1);
consume(_RKLAMMER);
end
else

11
tests/webtbs/tw27517.pp Normal file
View File

@ -0,0 +1,11 @@
program Project1;
{$mode objfpc}{$H+}
var
pTyped: PInteger;
p: Pointer;
begin
p := nil;
pTyped := @(PByte(p)+1)^; //project1.lpr(21,23) Fatal: Syntax error, ")" expected but "+" found
end.