[fpc-pascal] Re: Identifier not found "result"
giuliano.colla at fastwebnet.it
Mon Sep 3 09:52:02 CEST 2012
Il 02/09/2012 18:26, Sven Barth ha scritto:
> On 02.09.2012 12:39, Giuliano Colla wrote:
>> Il 31/08/2012 13:48, leledumbo ha scritto:
>>>> I question your assumption that
>>> "Result" is specifically more important than the other
>>> among different modes (i.e. your statement that it "will help...a
>>> lot"). I
>>> do not say that it is wrong to be more helpful in error messages, but
>>> rather that your proposal tries to "fix" a very small fragment of
>>> something much more general and moreover that the proposed message
>>> may be
>>> very easily misleading as already demonstrated by Mark. Yet other cases
>>> might not be detected by the compiler at all:
>>> +1. Since Result is not really special, i.e. it can be declared by
>>> user, it
>>> would be difficult to detect whether it's user's intention or not.
>> Treating just Result as a special case might not be worth while.
>> However a more general feature could perhaps be useful:
>> as the compiler knows all the keywords of all its modes, if an
>> unresolved identifier happens to match a keyword of a different mode, a
>> warning, sort of "wrong mode?" could be added. The overhead should be
>> negligible, because it would occur only in case of unresolved
>> identifier, and after a few of them compilation is stopped in any case.
> 1. "Result" is never a keyword.
> 2. There are context sensitive keywords that are not considered as
> global keywords in any mode (e.g. "read" and "write" of properties)
> and thus only the part that parses them (in the example the parser for
> properties) "knows" that it should consider these identifiers as
Too bad :-)
More information about the fpc-pascal