瀏覽代碼

Allow widechar sets, reduce to ansichar set

Michael VAN CANNEYT 2 年之前
父節點
當前提交
e4bd8c974e
共有 1 個文件被更改,包括 11 次插入2 次删除
  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