[M3devel] Widechars

Darko darko at darko.org
Wed Jan 7 07:05:01 CET 2009


Yes it is documented, if you read the compiler source code.


On 07/01/2009, at 12:25 PM, Rodney M. Bates wrote:

> Literals of type WIDECHAR are written, e.g. W'\x304A', note the 'W'.
> It makes them have type WIDECHAR and also enables the 16-bit escape
> sequences you are using.  If it is a CHAR or plain TEXT literal
> (no 'W' or 'w'), octal escapes must have exactly 3 octal digits and
> hex escapes must have exactly 2 hex digits.  In WIDECHAR and wide
> TEXT literals, octal escapes must have exactly 6 and hex escapes
> exactly 4.
>
> Note that character literals without/with the 'W' are of different
> types, CHAR and WIDECHAR, respectively.  For Text literals, both
> forms have the same type TEXT, but the lexical formation rules
> are different without/with the 'W'.
>
> I'm not sure where or even whether this is documented.
>
> Rodney Bates
>
>
> Martin Bishop wrote:
>> I'm playing around with WIDECHARS, and having some trouble.
>> VAR wide := ARRAY OF WIDECHAR {'\x304A', '\x306F', '\x3088',  
>> '\x3046'};
>>    s := Text.FromWideChars(wide);
>> I get these errors from the compiler:
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: syntax error: missing '}' (4)
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: missing closing quote on character literal
>> "../Length.m3", line 5: missing closing quote on character literal
>> 9 errors encountered
>> It seems like it's reading '\x304A' as '\x30' (which is why it says
>> "syntax error: missing '}' (4)")
>> Do I need some special literal letter or something?
>




More information about the M3devel mailing list