Browse Source

* several widechar fixes, case works now

florian 24 years ago
parent
commit
451ca157c4
3 changed files with 27 additions and 4 deletions
  1. 16 1
      compiler/pstatmnt.pas
  2. 5 2
      compiler/scanner.pas
  3. 6 1
      compiler/types.pas

+ 16 - 1
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

+ 5 - 2
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

+ 6 - 1
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)