[fpc-devel] adding a new token to compiler cause exception
Sven Barth
pascaldragon at googlemail.com
Tue Oct 13 23:54:51 CEST 2015
Am 13.10.2015 21:51 schrieb "Jonas Maebe" <jonas.maebe at elis.ugent.be>:
>
> On 13/10/15 19:59, Mohsen wrote:
>>
>> if (idtoken in [_EXPORT,_EXTERNAL,_WEAKEXTERNAL,_PUBLIC,_CVAR]) then
>>
>> ptconst.pas(95,45) Error: range check error in set constructor or
>> duplicate set element
>>
>> how to solve it ?
>
>
> Pascal sets can only contain values/enumerations whose ordinal value is
<= 255. There are more than 256 tokens already. If you add new tokens at
the start, existing tokens may get an ordinal value > 255, so existing set
expressions that previously worked may now fail.
>
> The only way to solve that is to remove the items whose ordinal values
are > 255 from set expressions and to test for them using the regular '='
operator.
Maybe I should start to work on the support for array constructors and
operators once generic functions and dynamic packages are working... :P
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20151013/0409ff21/attachment.html>
More information about the fpc-devel
mailing list