Re: [BLACKBOX] Another compiler bug ?

From: [at]} <Robert>
Date: Tue, 3 Jan 2012 21:56:23 +0000

----boundary-LibPST-iamunique-1881628697_-_-
Content-type: text/plain

My work computer uses Outlook for email, and thinks that Chris's suggestion is
'Junk'!

My home computer (Thunderbird) is not so sensitive, and let me try it.

And lo & behold, it seems to work. Now 'z := -108.3' (unicode -) fails to
compile, rather than giving me an unwanted and unsuspected +108.3 as it did before.



Cheers

Robert





On 31/12/2011 04:12, Chris Burrows wrote:
>> -----Original Message-----
>> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>> Sent: Saturday, 31 December 2011 10:59 AM
>> To: BLACKBOX{([at]})nowhere.xy
>> Subject: [BLACKBOX] Another compiler bug ?
>>
>> Folks
>>
>>
>> If I write
>>
>> VAR
>> z : REAL;
>> BEGIN
>> z := %108.3;
>>
>> the compiler complains (factor starts with incorrect symbol).
>>
>>
>> However, if I replace '%' with '‰' (Unicode 2030) there is no
>> complaint; the 'per-thousand' sign is simply ignored. Surely
>> there should be a complaint?
>>
>
> It appears that (except when processing string constants) the compiler
> simply ignores any character that is not included in the 256-character
> LATIN-1 character set defined for the Component Pascal language. The
> relevant line of code is in DevCPM.Get:
>
> REPEAT in.ReadChar(ch1); INC(curpos) UNTIL (ch1< 100X)& (ch1 #
> TextModels.viewcode);
> ch := SHORT(ch1)
>
> I haven't tested it but if you want to see compile-time errors then try
> modifying this function so that instead of ignoring the bad characters it
> substitutes a LATIN-1 character that is not part of the Component Pascal
> language. e.g. something like:
>
> REPEAT in.ReadChar(ch1); INC(curpos) UNTIL (ch1 # TextModels.viewcode);
> IF ch1>= 100X THEN
> ch := "?"
> ELSE
> ch := SHORT(ch1)
> END
>
> A 16-bit Unicode character in your source code should then result in the
> same compilation error as the '%' character did in your example.
>
> Cheers,
> Chris
>
> Chris Burrows
> CFB Software
> Astrobe v4.0: Oberon for ARM embedded systems
> http://www.astrobe.com
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1901 / Virus Database: 2109/4713 - Release Date: 12/30/11
>
>
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1881628697_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBNeSB3b3JrIGNvbXB1dGVyIHVz
ZXMgT3V0bG9vayBmb3IgZW1haWwsIGFuZCB0aGlua3MgdGhhdCBDaHJpcydzIHN1Z2dlc3Rpb24g
aXMgXHBhcg0KJ0p1bmsnIVxwYXINClxwYXINCk15IGhvbWUgY29tcHV0ZXIgKFRodW5kZXJiaXJk
KSBpcyBub3Qgc28gc2Vuc2l0aXZlLCBhbmQgbGV0IG1lIHRyeSBpdC5ccGFyDQpccGFyDQpBbmQg
bG8gJiBiZWhvbGQsIGl0IHNlZW1zIHRvIHdvcmsuIE5vdyAneiA6PSBcdTg3MjIgLTEwOC4zJyAo
dW5pY29kZSBcdTg3MjIgLSkgZmFpbHMgdG8gXHBhcg0KY29tcGlsZSwgcmF0aGVyIHRoYW4gZ2l2
aW5nIG1lIGFuIHVud2FudGVkIGFuZCB1bnN1c3BlY3RlZCArMTA4LjMg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