mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 12:31:01 +02:00
* parentheses after an @-operator can contain a full expression, resolves #27517
git-svn-id: trunk@30272 -
This commit is contained in:
parent
3396e2e1f4
commit
5f4dc5e54f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
11
tests/webtbs/tw27517.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user