From 213c4710d09d3eafccefdcd2305246e3d131b544 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Sun, 18 Jul 2021 14:58:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=20null=5Fbased=20+=20=D1=81=D1=80=D0=B5=D0=B7=D1=8B=20+?= =?UTF-8?q?=20^1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- .../CompilationSamples/PABCExtensions.pas | 92 +++++++++---------- TestSuite/CompilationSamples/PABCSystem.pas | 6 +- TestSuite/slice_string_nullbased.pas | 2 + bin/Lib/PABCExtensions.pas | 92 +++++++++---------- bin/Lib/PABCSystem.pas | 6 +- 9 files changed, 99 insertions(+), 109 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 649bff609..7f7d45f78 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 = "0"; - public const string Revision = "2944"; + public const string Revision = "2945"; 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 7be07e61c..bff5ecf6b 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=0 -%REVISION%=2944 %MINOR%=8 +%REVISION%=2945 +%COREVERSION%=0 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 87b3eae49..46d815b51 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.0.2944 +3.8.0.2945 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 0bb0b9a52..25530f1f1 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.0.2944' +!define VERSION '3.8.0.2945' diff --git a/TestSuite/CompilationSamples/PABCExtensions.pas b/TestSuite/CompilationSamples/PABCExtensions.pas index be3cdf9d6..2a6a3b506 100644 --- a/TestSuite/CompilationSamples/PABCExtensions.pas +++ b/TestSuite/CompilationSamples/PABCExtensions.pas @@ -121,20 +121,20 @@ end; ///-- procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: integer; - step: integer); extensionmethod; + step: integer := 1); extensionmethod; begin SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step); end; ///-- -procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; +{procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; begin SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1); -end; +end;} ///-- procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex; - step: integer); extensionmethod; + step: integer := 1); extensionmethod; begin if from.IsInverted then from.IndexValue := Self.Length - from.IndexValue + 1; @@ -143,54 +143,48 @@ begin SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step); end; -///-- -procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; -begin - if from.IsInverted then - from.IndexValue := Self.Length - from.IndexValue + 1; - if &to.IsInverted then - &to.IndexValue := Self.Length - &to.IndexValue + 1; - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer; - step: integer); extensionmethod; -begin - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; -begin - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex; - step: integer); extensionmethod; -begin - if from.IsInverted then - from.IndexValue := Self.Length - from.IndexValue + 1; - if &to.IsInverted then - &to.IndexValue := Self.Length - &to.IndexValue + 1; - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; -begin - if from.IsInverted then - from.IndexValue := Self.Length - from.IndexValue + 1; - if &to.IsInverted then - &to.IndexValue := Self.Length - &to.IndexValue + 1; - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); -end; - ///-- {procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; begin - Self.SystemSliceAssignment(rightValue,situation,from, &to, 1); + if from.IsInverted then + from.IndexValue := Self.Length - from.IndexValue + 1; + if &to.IsInverted then + &to.IndexValue := Self.Length - &to.IndexValue + 1; + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1); +end;} + +///-- +procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer; + step: integer := 1); extensionmethod; +begin + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); +end; + +///-- +{procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; +begin + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); +end;} + +///-- +procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex; + step: integer := 1); extensionmethod; +begin + if from.IsInverted then + from.IndexValue := Self.Length - from.IndexValue; + if &to.IsInverted then + &to.IndexValue := Self.Length - &to.IndexValue; + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); +end; + +///-- +{procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; +begin + if from.IsInverted then + from.IndexValue := Self.Length - from.IndexValue; + if &to.IsInverted then + &to.IndexValue := Self.Length - &to.IndexValue; + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); end;} //{{{--doc: Конец секции расширений строк для срезов }}} diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index bc5f18d36..d394ada3b 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -13020,10 +13020,10 @@ end; function SystemSlice0(Self: string; situation: integer; from, &to: SystemIndex; step: integer := 1): string; extensionmethod; begin if from.IsInverted then - from.IndexValue := Self.Count - from.IndexValue + 1; + from.IndexValue := Self.Count - from.IndexValue; if &to.IsInverted then - &to.IndexValue := Self.Count - &to.IndexValue + 1; - Result := SystemSliceStringImpl(Self, situation, from.IndexValue-1, &to.IndexValue-1, step, 0); + &to.IndexValue := Self.Count - &to.IndexValue; + Result := SystemSliceStringImpl(Self, situation, from.IndexValue, &to.IndexValue, step, 0); end; ///-- diff --git a/TestSuite/slice_string_nullbased.pas b/TestSuite/slice_string_nullbased.pas index 4ea44a239..839ebcc1a 100644 --- a/TestSuite/slice_string_nullbased.pas +++ b/TestSuite/slice_string_nullbased.pas @@ -9,6 +9,8 @@ begin s := '123456'; a := s[::2]; Assert(a='135'); + a := s[1:^1]; + Assert(a='2345'); //s[::2]:=s[1::2]; //Assert(s='224466'); end. \ No newline at end of file diff --git a/bin/Lib/PABCExtensions.pas b/bin/Lib/PABCExtensions.pas index a82f2c8b8..ebc00cdd1 100644 --- a/bin/Lib/PABCExtensions.pas +++ b/bin/Lib/PABCExtensions.pas @@ -121,20 +121,20 @@ end; ///-- procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: integer; - step: integer); extensionmethod; + step: integer := 1); extensionmethod; begin SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step); end; ///-- -procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; +{procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; begin SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1); -end; +end;} ///-- procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex; - step: integer); extensionmethod; + step: integer := 1); extensionmethod; begin if from.IsInverted then from.IndexValue := Self.Length - from.IndexValue + 1; @@ -143,54 +143,48 @@ begin SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step); end; -///-- -procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; -begin - if from.IsInverted then - from.IndexValue := Self.Length - from.IndexValue + 1; - if &to.IsInverted then - &to.IndexValue := Self.Length - &to.IndexValue + 1; - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer; - step: integer); extensionmethod; -begin - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; -begin - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex; - step: integer); extensionmethod; -begin - if from.IsInverted then - from.IndexValue := Self.Length - from.IndexValue + 1; - if &to.IsInverted then - &to.IndexValue := Self.Length - &to.IndexValue + 1; - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); -end; - -///-- -procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; -begin - if from.IsInverted then - from.IndexValue := Self.Length - from.IndexValue + 1; - if &to.IsInverted then - &to.IndexValue := Self.Length - &to.IndexValue + 1; - SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); -end; - ///-- {procedure SystemSliceAssignment(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; begin - Self.SystemSliceAssignment(rightValue,situation,from, &to, 1); + if from.IsInverted then + from.IndexValue := Self.Length - from.IndexValue + 1; + if &to.IsInverted then + &to.IndexValue := Self.Length - &to.IndexValue + 1; + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1); +end;} + +///-- +procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer; + step: integer := 1); extensionmethod; +begin + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); +end; + +///-- +{procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: integer); extensionmethod; +begin + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); +end;} + +///-- +procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex; + step: integer := 1); extensionmethod; +begin + if from.IsInverted then + from.IndexValue := Self.Length - from.IndexValue; + if &to.IsInverted then + &to.IndexValue := Self.Length - &to.IndexValue; + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, step, 0); +end; + +///-- +{procedure SystemSliceAssignment0(var Self: string; rightValue: string; situation: integer; from, &to: SystemIndex); extensionmethod; +begin + if from.IsInverted then + from.IndexValue := Self.Length - from.IndexValue; + if &to.IsInverted then + &to.IndexValue := Self.Length - &to.IndexValue; + SystemSliceAssignmentStringImpl(Self, rightValue, situation, from, &to, 1, 0); end;} //{{{--doc: Конец секции расширений строк для срезов }}} diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index bc5f18d36..d394ada3b 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -13020,10 +13020,10 @@ end; function SystemSlice0(Self: string; situation: integer; from, &to: SystemIndex; step: integer := 1): string; extensionmethod; begin if from.IsInverted then - from.IndexValue := Self.Count - from.IndexValue + 1; + from.IndexValue := Self.Count - from.IndexValue; if &to.IsInverted then - &to.IndexValue := Self.Count - &to.IndexValue + 1; - Result := SystemSliceStringImpl(Self, situation, from.IndexValue-1, &to.IndexValue-1, step, 0); + &to.IndexValue := Self.Count - &to.IndexValue; + Result := SystemSliceStringImpl(Self, situation, from.IndexValue, &to.IndexValue, step, 0); end; ///--