Grant Jacobs wrote:
... snip ...
As an aside, it makes me think that the const, type and var section probably could have been designed to have an "end" keyword to avoid this sort of thing (when Pascal was first designed, that is); this isn't a suggestion, just a idle thought. Something like:
const-begin <const declarations> const-end type-begin <type declarations> type-end
This way later development of new things like operator = ... wouldn't impact on the declaration sections, as they'd have one unique end-point "for all time".
They do, at least in standard Pascal. Parsing is something like:
WHILE NOT (nextsym IN [typesy, varsy, procsy, funcsy, beginsy]) DO BEGIN (* parse a constant *) END;
and an extension, to avoid the order dependance of ISO 7185, is to add 'constsy' to the above set of terminators.