diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index d949097f2a..74f5a517b3 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -220,6 +220,18 @@ implementation { may be an instruction has more case labels } repeat p:=expr; + if is_widechar(casedef) then + begin + if (p.nodetype=rangen) then + begin + trangenode(p).left:=ctypeconvnode.create(trangenode(p).left,cwidechartype); + trangenode(p).right:=ctypeconvnode.create(trangenode(p).right,cwidechartype); + end + else + p:=ctypeconvnode.create(p,cwidechartype); + do_resulttypepass(p); + end; + hl1:=0; hl2:=0; if (p.nodetype=rangen) then @@ -1270,7 +1282,10 @@ implementation end. { $Log$ - Revision 1.38 2001-10-16 15:10:35 jonas + Revision 1.39 2001-10-17 22:41:04 florian + * several widechar fixes, case works now + + Revision 1.38 2001/10/16 15:10:35 jonas * fixed goto/label/try bugs Revision 1.37 2001/09/22 11:11:43 peter diff --git a/compiler/scanner.pas b/compiler/scanner.pas index eaa5d6fca6..466e024161 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -2341,7 +2341,7 @@ implementation { strings with length 1 become const chars } if iswidestring then begin - if length(pattern)=1 then + if patternw^.len=1 then token:=_CWCHAR else token:=_CWSTRING; @@ -2605,7 +2605,10 @@ exit_label: end. { $Log$ - Revision 1.24 2001-10-12 16:02:34 peter + Revision 1.25 2001-10-17 22:41:05 florian + * several widechar fixes, case works now + + Revision 1.24 2001/10/12 16:02:34 peter * fix bug 1634 (merged) Revision 1.23 2001/09/30 21:23:59 peter diff --git a/compiler/types.pas b/compiler/types.pas index a2d19ee523..ed6210ec04 100644 --- a/compiler/types.pas +++ b/compiler/types.pas @@ -1169,6 +1169,8 @@ implementation is_subequal:=(torddef(def2).typ in [bool8bit,bool16bit,bool32bit]); uchar : is_subequal:=(torddef(def2).typ=uchar); + uwidechar : + is_subequal:=(torddef(def2).typ=uwidechar); end; end else @@ -1779,7 +1781,10 @@ implementation end. { $Log$ - Revision 1.48 2001-10-16 17:15:44 jonas + Revision 1.49 2001-10-17 22:41:05 florian + * several widechar fixes, case works now + + Revision 1.48 2001/10/16 17:15:44 jonas * auto-converting from int64 to real is again allowed for all modes (it's allowed in Delphi too)