From e124b9f8327548dc63f94b6ed9ccd36dc72c2a1d Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Mon, 22 Nov 2021 16:58:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=81=D0=BD=D0=BE=D0=B2=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=B0=D0=BD=D1=82=D0=B8=D0=B2=D0=B8=D1=80=D1=83=D1=81?= =?UTF-8?q?=D1=8B=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B0=D0=B3=D0=B8=D1=80=D1=83=D1=8E=D1=82=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=BD=D0=B8=D0=BC=D1=8B=D0=B5=20=D0=B2=D0=B8?= =?UTF-8?q?=D1=80=D1=83=D1=81=D1=8B=20=D0=B2=20=D0=BF=D1=80=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D0=BC=D0=B0=D1=85,=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BF=D0=B8=D0=BB=D0=B8=D1=80=D1=83=D0=B5=D0=BF=D1=8F=D1=85=20?= =?UTF-8?q?PascalABC.NET.=20=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D1=84?= =?UTF-8?q?=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F=20ErrorStringFromResource?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- Localization/DefaultLang.resources | Bin 99039 -> 99107 bytes .../LangGuide/Types/dynamicarrays.html | 4 +- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/PABCSystem.pas | 6 +- bin/Lib/PABCSystem.pas | 60 ++++++++++-------- 8 files changed, 42 insertions(+), 38 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index b2b85d5c9..8eb002ded 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "2"; - public const string Revision = "3027"; + public const string Revision = "3032"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 46321ccb4..f3912e706 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=8 -%REVISION%=3027 %COREVERSION%=2 +%REVISION%=3032 +%MINOR%=8 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 00c23fbf543dab7674561b70eb616ab6edd14b51..4a489bd429cb6b0947a1cb08559f82f5f349b330 100644 GIT binary patch delta 91 zcmV-h0Hpulg$ARB29V$aKZ1ecwc-H?W-^{L;^6Z9AnNYy@969Q^6u~;++Np5syY;0+BWo~n2x9Da8_Z#8yFV6q~ delta 24 gcmZ47#&*AzZNdYl-;IrrwmxFyNZYQL&iGXt0F{{wP5=M^ diff --git a/PABCNetHelp/LangGuide/Types/dynamicarrays.html b/PABCNetHelp/LangGuide/Types/dynamicarrays.html index f1cb37995..c0ba767e1 100644 --- a/PABCNetHelp/LangGuide/Types/dynamicarrays.html +++ b/PABCNetHelp/LangGuide/Types/dynamicarrays.html @@ -117,8 +117,8 @@
for var i:=0 to a.Length-1 do
  read(a[i]);

- ReadSeqInteger:

-
var a := ReadSeqInteger(10);
+ ReadArrInteger:

+
var a := ReadArrInteger(10);

.

write , diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index cf1815957..733f4c39f 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.2.3027 +3.8.2.3032 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 1965b8f30..e8f0557a4 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.2.3027' +!define VERSION '3.8.2.3032' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 579943c8c..13b3be037 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -14106,9 +14106,9 @@ begin try DefaultEncoding := Encoding.GetEncoding(1251); if (System.Environment.OSVersion.Version.Major >= 6) and (System.Environment.OSVersion.Version.Minor >= 2) then - System.Console.OutputEncoding := Encoding.GetEncoding(1251); + System.Console.OutputEncoding := Encoding.UTF8; except - DefaultEncoding := Encoding.UTF8; + //DefaultEncoding := Encoding.UTF8; DefaultEncoding := new System.Text.UTF8Encoding(false) end; rnd := new System.Random; @@ -14139,7 +14139,7 @@ begin System.Threading.Thread.CurrentThread.CurrentCulture := new System.Globalization.CultureInfo('en-US'); var defaultCulture := typeof(System.Globalization.CultureInfo).GetProperty('DefaultThreadCurrentCulture'); if defaultCulture <> nil then - defaultCulture.SetValue(nil, new System.Globalization.CultureInfo('en-US')); + defaultCulture.SetValue(nil, new System.Globalization.CultureInfo('en-US'), nil); input := new TextFile(); output := new TextFile(); output.sw := Console.Out; diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 13b3be037..8bcffc9f0 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -307,6 +307,10 @@ type // ----------------------------------------------------- // IOSystem interface & IOStandardSystem implementation // ----------------------------------------------------- + +// размер буфера. Определен эмпирически +const buflen = 256; + type /// Интерфейс подсистемы ввода/вывода IOSystem = interface @@ -338,7 +342,7 @@ type IOStandardSystem = class(IOSystem) state := 0; // 0 - нет символа в буфере char, 1 - есть символ в буфере char sym: integer; // буфер в 1 символ для моделирования Peek в консоли - buf: array of char; + buf: array of char := new char[buflen]; pos := 0; realbuflen := -1; // только вначале tr: TextReader; @@ -2859,6 +2863,8 @@ const MATR_DIMENSIONS_MUST_BE_EQUAL = 'Размеры матриц должны совпадать!!Matrix dimensions must be equal'; COUNT_PARAMS_MAXFUN_MUSTBE_GREATER1 = 'Количество параметров функции Max должно быть > 1!!The number of parameters of the Max function must be > 1'; COUNT_PARAMS_MINFUN_MUSTBE_GREATER1 = 'Количество параметров функции Min должно быть > 1!!The number of parameters of the Min function must be > 1'; + Format_InvalidString = 'Входная строка имела неверный формат!!Input string was not in a correct format'; + Overflow_Int32 = 'Целочисленное переполнение!!Integer overflow'; // ----------------------------------------------------- // WINAPI // ----------------------------------------------------- @@ -5279,16 +5285,15 @@ end; // IOStandardSystem: implementation // ----------------------------------------------------- -// размер буфера. Определен эмпирически -const - buflen = 256; - constructor IOStandardSystem.Create; begin tr := Console.In; - buf := new char[buflen]; + //buf := new char[buflen]; - теперь при объявлении поля end; +const + m = char(-1); + procedure IOStandardSystem.ReadNextBuf; begin realbuflen := tr.ReadBlock(buf, 0, buflen); @@ -5297,8 +5302,6 @@ begin pos := 0; end; -const - m = char(-1); var _IsPipedRedirectedQuery := False; @@ -5524,11 +5527,12 @@ begin end; end; -function ErrorStringFromResource(s: string): string; +{function ErrorStringFromResource(s: string): string; begin - var _rm := new System.Resources.ResourceManager('mscorlib', typeof(object).Assembly); - Result := _rm.GetString(s); -end; + //var _rm := new System.Resources.ResourceManager('mscorlib', typeof(object).Assembly); + //Result := _rm.GetString(s); + Result := GetTranslation(s); +end;} procedure IOStandardSystem.read(var x: integer); begin @@ -5557,7 +5561,7 @@ begin raise new System.IO.IOException(GetTranslation(READ_LEXEM_AFTER_END_OF_INPUT_STREAM)); if (c < #48) or (c > #57) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString') + ' ' + Ord(c)); + raise new System.FormatException(GetTranslation(Format_InvalidString) + ' ' + Ord(c)); x := integer(c) - 48; repeat @@ -5574,11 +5578,11 @@ begin break; if c > #57 then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString') + ' ' + Ord(c)); + raise new System.FormatException(GetTranslation(Format_InvalidString) + ' ' + Ord(c)); if c < #48 then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString') + ' ' + Ord(c)); + raise new System.FormatException(GetTranslation(Format_InvalidString) + ' ' + Ord(c)); if x > 214748364 then - raise new System.OverflowException(ErrorStringFromResource('Overflow_Int32')); + raise new System.OverflowException(GetTranslation(Overflow_Int32)); x := x * 10 + (integer(c) - 48); pos += 1; @@ -5587,7 +5591,7 @@ begin if x < 0 then if (x = -2147483648) and (sign = -1) then exit - else raise new System.OverflowException(ErrorStringFromResource('Overflow_Int32')); + else raise new System.OverflowException(GetTranslation(Overflow_Int32)); if sign = -1 then x := -x; end @@ -9041,7 +9045,7 @@ begin while (j <= s.Length) and char.IsWhiteSpace(s[j]) do j += 1; if (j > s.Length) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); var sign := 0; if s[j] = '-' then begin @@ -9054,10 +9058,10 @@ begin j += 1; end; if (j > s.Length) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); var c := integer(s[j]); if (c < 48) or (c > 57) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); Result := c - 48; j += 1; while j <= s.Length do @@ -9068,20 +9072,20 @@ begin if c < 48 then break; if Result > 214748364 then - raise new System.OverflowException(ErrorStringFromResource('Overflow_Int32')); + raise new System.OverflowException(GetTranslation(Overflow_Int32)); Result := Result * 10 + (c - 48); j += 1; end; if Result < 0 then if (Result = -2147483648) and (sign = -1) then exit - else raise new System.OverflowException(ErrorStringFromResource('Overflow_Int32')); + else raise new System.OverflowException(GetTranslation(Overflow_Int32)); if sign = -1 then Result := -Result; while (j <= s.Length) and char.IsWhiteSpace(s[j]) do j += 1; if j <= s.Length then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); end; function TryStrToInt(s: string; var value: integer): boolean; @@ -9170,7 +9174,7 @@ begin while (from <= s.Length) and char.IsWhiteSpace(s[from]) do from += 1; if (from > s.Length) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); var sign := 0; if s[from] = '-' then begin @@ -9183,10 +9187,10 @@ begin from += 1; end; if (from > s.Length) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); var c := integer(s[from]); if (c < 48) or (c > 57) then - raise new System.FormatException(ErrorStringFromResource('Format_InvalidString')); + raise new System.FormatException(GetTranslation(Format_InvalidString)); Result := c - 48; from += 1; while from <= s.Length do @@ -9197,14 +9201,14 @@ begin if c < 48 then break; if Result > 214748364 then - raise new System.OverflowException(ErrorStringFromResource('Overflow_Int32')); + raise new System.OverflowException(GetTranslation(Overflow_Int32)); Result := Result * 10 + (c - 48); from += 1; end; if Result < 0 then if (Result = -2147483648) and (sign = -1) then exit - else raise new System.OverflowException(ErrorStringFromResource('Overflow_Int32')); + else raise new System.OverflowException(GetTranslation(Overflow_Int32)); if sign = -1 then Result := -Result; end;