(unknown charset) Re: [BLACKBOX] Another compiler bug ?

From: (unknown charset) [at]} <Chris>
Date: Sat, 31 Dec 2011 14:42:37 +1030

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

>-----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----boundary-LibPST-iamunique-216482320_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTFcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDIwNCBBcmlhbDt9DQp7XGYxXGZ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V3Y29kZSk7XHBhcg0KICBJRiBjaDEgPj0gMTAwWCBUSEVOIFxwYXINCiAg
ICAgIGNoIDo9ICI/IiBccGFyDQogIEVMU0VccGFyDQogICAgICBjaCA6PSBTSE9SVChjaDEpXHBh
cg0KICBFTkRccGFyDQpccGFyDQpBIDE2LWJpdCBVbmljb2RlIGNoYXJhY3RlciBpbiB5b3VyIHNv
dXJjZSBjb2RlIHNob3VsZCB0aGVuIHJlc3VsdCBpbiB0aGVccGFyDQpzYW1lIGNvbXBpbGF0aW9u
IGVycm9yIGFzIHRoZSAnJScgY2hhcmFjdGVyIGRpZCBpbiB5b3VyIGV4YW1wbGUuIFxwYXINClxw
YXINCkNoZWVycyxccGFyDQpDaHJpc1xwYXINClxwYXINCkNocmlzIEJ1cnJvd3NccGFyDQpDRkIg
U29mdHdhcmVccGFyDQpBc3Ryb2JlIHY0LjA6IE9iZXJvbiBmb3IgQVJNIGVtYmVkZGVkIHN5c3Rl
bXNccGFyDQpodHRwOi8vd3d3LmFzdHJvYmUuY29tXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXIN
ClRvIHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tC
T1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSFxwYXINCn0
----boundary-LibPST-iamunique-216482320_-_---
Received on Sat Dec 31 2011 - 05:12:37 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:09 UTC