[fpc-devel] Re: Porting FPC to IBM zArch
Mark Morgan Lloyd
markMLl.fpc-devel at telemetry.co.uk
Tue Aug 20 14:16:59 CEST 2013
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]
More information about the fpc-devel
mailing list