Adriaan van Os wrote:
: - if (co->pascal_dialect & C_E_O_M_PASCAL) : + if (co->pascal_dialect & C_E_O_PASCAL) : build_predef_call (p_CaseNoMatchError, NULL_TREE);
Peter N. Lewis added Mac Pascal here in his original patch for MP dialect support (2003-03-31). Could you please make sure which one is correct?
This addresses a problem reported recently on the macpascal mailing list. In MPW, Think and MW Pascal, it is not an error if the case selector value matches no case constant (so I believe Peter was wrong).
OK.
Extended Pascal standard allows direct acces to files only if you declare an index type like:
var direct_file : file [0..Maxint] of char;
OK, we can add another patch (change B_D_PASCAL to B_D_M_PASCAL here also).
OK.
#define NEG_ZERO_WIDTH_ERROR_MASK 8 COMMENT ((give an error when field width < 0))
<= 0 ?
Yes, thanks.
There was a disscusion how GPC should handle negative width specification for `Write'. The code above implements results of the disscusion.
OK, I will have a further look.
I checked that MW Pascal behaves like Borland Pascal, so we can add another patch (change B_D_PASCAL to B_D_M_PASCAL here also).
OK.
I'm applying most of your patch now, considering Waldek's previous comments.
I've omitted the following options which are off by default and not enabled by any other dialects:
+ "-fno-nested-comments", + "-Wno-interface-file-name", + "-Wno-identifier-case", + "-Wno-identifier-case-local",
The following changes (predef.h) add new built-in identifiers:
+PREDEF_TYPE (UnsignedWord,short_unsigned_type_node, MAC_PASCAL) +PREDEF_TYPE (UnsignedLong,pascal_cardinal_type_node, MAC_PASCAL)
-PREDEF_ROUTINE (Flush, "-F", ER_IOCRITICAL, B_D_PASCAL) +PREDEF_ROUTINE (Flush, "-F", ER_IOCRITICAL, B_D_M_PASCAL) +PREDEF_ALIAS (PLFlush, Flush, "-F", ER_IOCRITICAL, MAC_PASCAL)
-PREDEF_ALIAS (FilePos, Position, "lF", ER_IOCRITICAL, B_D_PASCAL) +PREDEF_ALIAS (FilePos, Position, "lF", ER_IOCRITICAL, B_D_M_PASCAL) +PREDEF_ALIAS (PLFilePos, Position,"lF", ER_IOCRITICAL, MAC_PASCAL) +PREDEF_ALIAS (PLCrunch, Truncate, "-F", ER_IOCRITICAL, MAC_PASCAL)
PREDEF_ROUTINE (ReadStr, "-x,|", 0, E_O_PASCAL) +PREDEF_ALIAS (ReadString, ReadStr, "-x,|", 0, MAC_PASCAL)
(Just so be sure: MP has both `Flush' and `PLFlush' which are equivalent, same for `FilePos' and `PLFilePos'; and `ReadString' is equivalent to Extended Pascal's `ReadStr', i.e. full `Read' compatible parameter list with a source string as first argument?)
`ReadString' probably requires a few extra additions to predef.c (look for `p_ReadStr'), or did you test it without it already?
All built-in identifiers should be listed in doc/en/reference.texi. Can you add the relevant parts (easiest by copying from the equivalent names, changing names (also in the demo programs if any) and dialect info, and adding cross-references on both sides, as well as in other relevant entries that reference the other equivalent name).
You might want to add test programs for some or all changes, but I won't insist on it.
Frank