Le 22 janv. 2021 à 08:08, Paul Isaacs paul@redpineinstruments.org a écrit :
Hello:
gpc --classic-pascal compiles the following without error:
procedure test; type xHandle = ^xRecord; xRecord = record field1 : integer; end; var a : integer;
function b : xHandle; var c : xHandle; begin b := c; end; begin a := b^.field1; end;
Is this 7185 compliant?
The right hand side of the assignment is a 6.7.3 function-designator rule :
function-designator = function-identifier [ actual-parameter-list ] .
followed by "^."
I can not see how the grammar permits the following pointer and record accesses.
The expression b^.field1 is not correct, since b^ is not, because b is an expression, not a variable. However, in my opinion, the syntax should allow one to write b^ where b is an expression. It seems to me that the syntax itself is mistaken, while the program meaning is clear.
Baudouin
Thank you,
Paul Isaacs
Gpc mailing list Gpc@gnu.de https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.g-n-u....