Frank Heckenbach wrote:
Adriaan van Os wrote:
Frank Heckenbach wrote:
In the ISO Pascal Standard Report (Jensen, Wirth, third edition) I read at the end of Section 5:
Comment = { "{" | "(*" ) { CommentElement } ( "}" | "*)" ) .
A CommentElement is either an end of line or any sequence of characters not containing "}" or "*)".
Notes: { ...*) and (* ...} are valid comments. The comment {(*) is equivalent to the comment {(}.
This means that {{} is a valid comment, but {}} isn't, according to the standard. Several other Pascal compilers, however, only allow (*.. { .. } .. *) or { .. (* .. *) .. }. But, as Frank noted, you can use the --nested-comments option in GPC to get similar behaviour.
This would be `--no-mixed-comments' which is set (i.e. "no") by default, except in standard Pascal modes.
I see. Then --nested-comments --no-mixed-comments would be the ideal default for --mac-pascal.
Does Mac Pascal allow real nested comments, i.e. `{ ... { ... } ... }'? (Then it might be the first compiler I hear of that does so, apart from GPC. I had even considered dropping that option, OTOH, it's quite useful for embedding TeX etc. in comments.)
At least according to the documentation, none of the MacPascal dialect compilers allow nested comments in the `{ ... { ... } ... }' form. CodeWarrior Pascal and MPW Pascal compilers support a nest comments Pascal non-standard extension but you must use different comment delimiters for nesting; e.g. '{ ... (* ... *) ... }'. THINK Pascal doesn't support nested comments and it isn't completely ISO compliant in allowing different syntax forms for beginning and ending comment delimiters - only '{ ... }' and '(* ... *)' are doucmented to be accepted comments. (As an aside, there is a THINK Pascal add-on tool which provides the sort of capability nested comments are intended to provide. Basicly, it is just a bulk text editor which modifies blocks of program text with specific character formatting markups to indicate the level of commenting out - no non-standard extensions required since it is just a markup convention employed inside "regular" comment delimiters which the add-on tool assists with using the convention.)
Gale Paeper gpaeper@empirenet.com