From dc95f368d7f47efeff6f920f725653e97f44e34d Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Tue, 6 Jun 2023 08:14:59 +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=20x[1:^1][5]?= 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 101340 -> 101547 bytes Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- SyntaxVisitors/SugarVisitors/IndexVisitor.cs | 5 +++++ TestSuite/sl_ind.pas | 4 ++++ 7 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 TestSuite/sl_ind.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index fae86a280..006b50de2 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 = "9"; public const string Build = "0"; - public const string Revision = "3295"; + public const string Revision = "3296"; 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 78c55ed74..f7e61fbab 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=9 -%REVISION%=3295 %COREVERSION%=0 +%REVISION%=3296 +%MINOR%=9 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 4b676290dd0c6f76a5fe9f2bdcf3e32bfeef840d..d2b5c02f7b1d3ff02ebe3afea62b385eb4c1aa8d 100644 GIT binary patch delta 205 zcmcaJoo)3@wh0fIj(2Z-bj(*gH9fPqB(=yfFU2`OucRnHCm^RZJu`1Iqk^zV5L8kj zF)u{{Dm^)nQKCM`)!j2V#5E}1(a$B`+21cD$loVEz$et*(=VQv%g@o*)%L)nPwzgw zc>dtqi~qb_F0R4OL7o92p8kHw5>^V2zP@{+@b;;~qu=k}y?*=jtpYEXn}3imrU|@U Zyj=SFL8W;mnYpRW>-@H_^JCPr1pw}4UY!5{ delta 24 gcmZ2IlkLuQwh0fIespbobj-K8+<$wyKck5)0G;;>mH+?% diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 8667c77f1..6f786e869 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.9.0.3295 +3.9.0.3296 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 5d939162d..159d4c880 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.9.0.3295' +!define VERSION '3.9.0.3296' diff --git a/SyntaxVisitors/SugarVisitors/IndexVisitor.cs b/SyntaxVisitors/SugarVisitors/IndexVisitor.cs index 536363f52..c4faa8a8d 100644 --- a/SyntaxVisitors/SugarVisitors/IndexVisitor.cs +++ b/SyntaxVisitors/SugarVisitors/IndexVisitor.cs @@ -35,8 +35,13 @@ namespace SyntaxVisitors.SugarVisitors ind.source_context); syntax_tree_node mc = null; var possibleIndexer = ind.Parent?.Parent; + if (ind.Parent != null && !(ind.Parent is expression_list)) + possibleIndexer = null; if (possibleIndexer != null && possibleIndexer is indexer indexer) { + // x[1:^1][5] - не должно сюда заходить в этом случае !!! Но неожиданно possibleIndexer оказывается expr[5] + // Сюда должно заходить только при x[^1,3]. То есть, ind.Parent д.б. expression_list и только в этом случае!!! + // Надо подняться до узла indexer и запомнить индекс, под которым данный index входит // Идём по Parent - и смотрим, когда Parent = indexer // Находим у него expressions и ищем, под каким индексом в нем содержится текущий. diff --git a/TestSuite/sl_ind.pas b/TestSuite/sl_ind.pas new file mode 100644 index 000000000..46e4ed855 --- /dev/null +++ b/TestSuite/sl_ind.pas @@ -0,0 +1,4 @@ +begin + var x:=|1,2,3,4,5,6,7,8,9,10|; + Assert(x[1:^1][5] = 7); +end. \ No newline at end of file