Hans-Peter Diettrich wrote:
Mark Morgan Lloyd schrieb:

Apropos Paul's comments of doing a good cross-reference and handling compiler directives, I think the thing that is likely to give real problems is the {$if defined() } form...

I'm not sure whether $if defined() works with ordinary constants. The $DEFINE and CONST identifiers most probably reside in different lists.

const   a= 1;

var     b: integer;

begin
{$if defined(a) }
This should work better:
 {$if a=1 }

I think you're right, but your correction doesn't detract from the point that it is a slightly awkward "crossover case" where it is necessary to do more than simply parse {$ (and, for most cases, (*$ ) lines. I can only think of one other compiler implementation which did this sort of thing, and that was TopSpeed/JPI.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to