GPC supports a number of keywords that do not belong to all (or any ;-) known Pascal standards/dialects. To relieve the resulting problems, there are currently 3 mechanisms:
- If any dialect option (`--extended-pascal' etc.) is used, all keywords not belonging to this standard are deactivated completely.
- Individual keywords can be disabled using `--disable-keyword'.
- Some keywords are recognized only depending on context, so compiling a program that uses them as identifiers is still possible without any of the above options.
However, the 3rd approach only works in some situations (and can never work perfectly, since at some points there would simply be syntactic ambiguities between certain keywords and identifiers).
I think for some words it would be easier to recognize them as keywords only if they have no current meaning (as identifiers) in the program, rather than turning them on and off in certain syntactic places (which is quite error-prone and probably still has some subtle bugs). I'm not sure if this approach will work for all problematic keywords, but at least for some.
So this will still work:
program Foo;
var Foo: static Integer;
begin end.
Also this:
program Foo;
procedure Bar; var Static: Integer; begin end;
var Foo: static Integer;
begin end.
But not this (which works now):
program Foo;
var Static: Integer; Foo: static Integer;
begin end.
Do you think this would a problem? It should not affect the ability to compile, say, EP code without `--extended-pascal' *as far as* that's possible now, since EP code can't use `static' as a directive (and it can't use as identifiers what are keywords in EP).
Frank