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; ///--