Procházet zdrojové kódy

Allow widechar sets, reduce to ansichar set

Michael VAN CANNEYT před 2 roky
rodič
revize
e4bd8c974e
1 změnil soubory, kde provedl 11 přidání a 2 odebrání
  1. 11 2
      compiler/ptype.pas

+ 11 - 2
compiler/ptype.pas

@@ -1320,8 +1320,17 @@ implementation
                   Message(sym_e_ill_type_decl_set);
                orddef :
                  begin
-                   if (torddef(tt2).ordtype<>uvoid) and
-                      (torddef(tt2).ordtype<>uwidechar) and
+                   if (torddef(tt2).ordtype=uwidechar) then
+                     begin
+                     if (m_default_unicodestring in current_settings.modeswitches) then
+                       begin
+                       Message(parser_w_widechar_set_reduced);
+                       def:=csetdef.create(cansichartype,torddef(cansichartype).low.svalue,torddef(cansichartype).high.svalue,true);
+                       end
+                     else
+                       Message(sym_e_ill_type_decl_set);  
+                     end
+                   else if (torddef(tt2).ordtype<>uvoid) and
                       (torddef(tt2).low>=0) then
                      // !! def:=csetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high),true)
                      if Torddef(tt2).high>int64(high(byte)) then