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.de%2Fmailman%2Flistinfo%2Fgpc&data=04%7C01%7Cbaudouin.lecharlier%40uclouvain.be%7C72d3abced2b7412aedc908d8bea5adc2%7C7ab090d4fa2e4ecfbc7c4127b4d582ec%7C0%7C0%7C637468966401427140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=bUwtLbspUYNaqEM5j2%2BunZo2l4pxKCRnvYFsmkiWX1I%3D&reserved=0