소스 검색

* Allow widechar sets, reduce to ansichar set

Michaël Van Canneyt 2 년 전
부모
커밋
56006aa002
5개의 변경된 파일373개의 추가작업 그리고 354개의 파일을 삭제
  1. 3 0
      compiler/msg/errore.msg
  2. 3 2
      compiler/msgidx.inc
  3. 355 350
      compiler/msgtxt.inc
  4. 11 2
      compiler/ptype.pas
  5. 1 0
      rtl/inc/systemh.inc

+ 3 - 0
compiler/msg/errore.msg

@@ -1651,6 +1651,9 @@ parser_e_promising_exports_not_supported_on_current_platform=03367_E_Declaring e
 % Promising exports are WebAssembly-specific. They are not allowed on other platforms.
 parser_e_suspending_externals_not_supported_on_current_platform=03368_E_Declaring externals as 'suspending' is WebAssembly-specific and is not supported on the current platform
 % Suspending externals are WebAssembly-specific. They are not allowed on other platforms.
+parser_w_widechar_set_reduced=03369_W_Reducing Widechar set to single-byte AnsiChar set.
+% The base type of a set can only have 255 elements. Sets of wide characters
+% are reduced to sets of 1-byte characters.
 %
 % \end{description}
 %

+ 3 - 2
compiler/msgidx.inc

@@ -482,6 +482,7 @@ const
   parser_e_wasm_ref_types_can_only_be_passed_by_value=03366;
   parser_e_promising_exports_not_supported_on_current_platform=03367;
   parser_e_suspending_externals_not_supported_on_current_platform=03368;
+  parser_w_widechar_set_reduced=03369;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
@@ -1167,9 +1168,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 91554;
+  MsgTxtSize = 91613;
 
   MsgIdxMax : array[1..20] of longint=(
-    28,109,369,134,102,63,148,38,223,71,
+    28,109,370,134,102,63,148,38,223,71,
     68,20,30,1,1,1,1,1,1,1
   );

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 355 - 350
compiler/msgtxt.inc


+ 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

+ 1 - 0
rtl/inc/systemh.inc

@@ -546,6 +546,7 @@ Type
 { Zero - terminated strings }
 
 {$IF DECLARED(AnsiChar)}
+=======
 // Compiler defines AnsiChar and WideChar, not AnsiChar
 {$IFDEF UNICODERTL}
   Char = WideChar;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.