Re: [BLACKBOX] Error in Case Label ?

From: [at]} <Chris>
Date: Sun, 19 Dec 2010 10:57:08 +1030

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

> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Behalf Of Werner Bossert
> Sent: Sunday, 19 December 2010 1:57 AM
> To: BLACKBOX{([at]})nowhere.xy
> Subject: [BLACKBOX] Error in Case Label ?
>
>
> Dear all,
>
> In the following programm extract the range
>1FB8H..1FB9H is defined twice. Compiling this in CP there will
>be no error message!
> In ETH Oberon the error message is: case label
>defined more than once.
>
>
> MODULE UnicodeCase_MappingExtPart;
>
>
> PROCEDURE Lower* (ch: INTEGER): INTEGER;
> BEGIN
> CASE ch OF
> | 41H..5AH, 0C0H..0D6H, 0D8H..0DEH: ch := ch + 20H
>
> (* Greek Extended *)
>
> | 1F08H..1F0FH, 1F18H..1F1DH,
> 1F28H..1F2FH, 1F38H..1F3FH,
> 1F48H..1F4DH,
> 1F59H, 1F5BH, 1F5DH, 1F5FH,
> 1F68H..1F6FH, 1F88H..1F8FH, ,
> 1F98H..1F9FH, 1FA8H..1FAFH,
> 1FB8H..1FB9H: ch := ch - 8H
>
> ELSE
> END;
> RETURN ch
> END Lower;
>
> END UnicodeCase_MappingExtPart.
>
>
> Kind regards
>
> Werner Bossert
>

I suspect that the code presented here is different from what you attempted
to compile as I can see no duplicate. However, I can see two consecutive
commas where it might have been:

> 1F68H..1F6FH, 1F88H..1F8FH, ,

Assuming the original code was:

   1F68H..1F6FH, 1F88H..1F8FH, 1FB8H..1FB9H,

the compiler can be excused for not reporting it as an *error* as both sets
of labels are in the same branch of the CASE statement and it makes
absolutely no difference to the result. It is similar to writing:

IF ch = 1FB8H THEN
  ch := ch - 8H
ELSIF ch = 1FB8H THEN
  ch := ch - 8H
END;

Not exactly an error but definitely suspicious. Hence, it could be helpful
if the compiler reported it as a warning as it is possible the programmer
did not actually intend to add the redundant labels.

If the duplicate definitions had been in different brances of the CASE
statement BlackBox *does* report an error "illegal value of constant" on the
second occurrence. e.g.

            CASE ch OF
            | 41H..5AH, 0C0H..0D6H, 0D8H..0DEH, 1FB8H..1FB9H: ch := ch +
20H
            
            (* Greek Extended *)
            
            | 1F08H..1F0FH, 1F18H..1F1DH,
               1F28H..1F2FH, 1F38H..1F3FH,
               1F48H..1F4DH,
               1F59H, 1F5BH, 1F5DH, 1F5FH,
               1F68H..1F6FH, 1F88H..1F8FH,
               1F98H..1F9FH, 1FA8H..1FAFH,
               1FB8H..1FB9H: ch := ch - 8H
        
            ELSE
            END;
            RETURN ch
          END Lower;

Regards,
Chris Burrows
CFB Software
Astrobe v3.2: ARM Oberon-07 Development System
http://www.astrobe.com


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1167639339_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID5cdGFiIEZyb206IEJsYWNrQm94IFttYWlsdG86
QkxBQ0tCT1hATElTVFMuT0JFUk9OLkNIXSBPbiBccGFyDQo+QmVoYWxmIE9mIFdlcm5lciBCb3Nz
ZXJ0XHBhcg0KPlx0YWIgU2VudDogU3VuZGF5LCAxOSBEZWNlbWJlciAyMDEwIDE6NTcgQU1ccGFy
DQo+XHRhYiBUbzogQk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YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0hcfX0ANQIq
----boundary-LibPST-iamunique-1167639339_-_---
Received on Sun Dec 19 2010 - 01:27:08 UTC

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