diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 65f9f0f2b..ba405df1c 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 = "4"; public const string Build = "2"; - public const string Revision = "1813"; + public const string Revision = "1814"; 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 351d60589..56d5f336f 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=2 -%REVISION%=1813 %MINOR%=4 +%REVISION%=1814 +%COREVERSION%=2 %MAJOR%=3 diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index b733926e6..45d648692 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: IVAN-PC -// DateTime: 30.09.2018 11:51:35 -// UserName: Ivan +// Machine: DESKTOP-A6LT9RI +// DateTime: 02.10.2018 18:24:40 +// UserName: ????????? // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 873932071..a7d68e6e6 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -817,8 +817,6 @@ const_factor { $$ = $1; } | unsigned_number { $$ = $1; } - | literal - { $$ = $1; } | tkNil { $$ = new nil_const(); @@ -887,6 +885,8 @@ sign const_variable : identifier { $$ = $1; } + | literal // SSM 02.10.18 äëÿ '123'.Length ïðè èíèöèàëèçàöèè êîíñòàíò + { $$ = $1; } | tkInherited identifier { $$ = new inherited_ident($2.name, @$); diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 4b21fee0d..228ed27a3 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: IVAN-PC -// DateTime: 30.09.2018 11:51:36 -// UserName: Ivan +// Machine: DESKTOP-A6LT9RI +// DateTime: 02.10.2018 18:24:41 +// UserName: ????????? // Input file // options: no-lines gplex @@ -275,30 +275,30 @@ public partial class GPPGParser: ShiftReduceParser unsigned_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 147: // const_factor -> literal -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 148: // const_factor -> tkNil + case 147: // const_factor -> tkNil { CurrentSemanticValue.ex = new nil_const(); CurrentSemanticValue.ex.source_context = CurrentLocationSpan; } break; - case 149: // const_factor -> tkAddressOf, const_factor + case 148: // const_factor -> tkAddressOf, const_factor { CurrentSemanticValue.ex = new get_address(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); } break; - case 150: // const_factor -> tkRoundOpen, const_expr, tkRoundClose + case 149: // const_factor -> tkRoundOpen, const_expr, tkRoundClose { CurrentSemanticValue.ex = new bracket_expr(ValueStack[ValueStack.Depth-2].ex, CurrentLocationSpan); } break; - case 151: // const_factor -> tkNot, const_factor + case 150: // const_factor -> tkNot, const_factor { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 152: // const_factor -> sign, const_factor + case 151: // const_factor -> sign, const_factor { // ������ ��������� ����� �������� if (ValueStack[ValueStack.Depth-2].op.type == Operators.Minus) @@ -3200,23 +3197,26 @@ public partial class GPPGParser: ShiftReduceParser new_expr + case 152: // const_factor -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 154: // const_set -> tkSquareOpen, const_elem_list, tkSquareClose + case 153: // const_set -> tkSquareOpen, const_elem_list, tkSquareClose { CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 155: // sign -> tkPlus + case 154: // sign -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 156: // sign -> tkMinus + case 155: // sign -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 157: // const_variable -> identifier + case 156: // const_variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; + case 157: // const_variable -> literal +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; case 158: // const_variable -> tkInherited, identifier { CurrentSemanticValue.ex = new inherited_ident(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index d7fb6476d..99f0f19ff 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -218,5 +218,6 @@ script= + diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index c33bb9201..cb0760a27 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.4.2.1813' +!define VERSION '3.4.2.1814' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 4b1ba161e..88664edea 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -1836,6 +1836,24 @@ function ReadMatrInteger(m, n: integer): array [,] of integer; /// Возвращает матрицу m на n вещественных, введенных с клавиатуры function ReadMatrReal(m, n: integer): array [,] of real; +// ----------------------------------------------------- +//>> Подпрограммы для создания кортежей # Subroutines for tuple generation +// ----------------------------------------------------- +///- function Rec(x1: T1, x2: T2,...): (T1,T2,...); +/// Возвращает кортеж из элементов разных типов +function Rec(x1: T1; x2: T2): System.Tuple; +///-- +function Rec(x1: T1; x2: T2; x3: T3): (T1, T2, T3); +///-- +function Rec(x1: T1; x2: T2; x3: T3; x4: T4): (T1, T2, T3, T4); +///-- +function Rec(x1: T1; x2: T2; x3: T3; x4: T4; x5: T5): (T1, T2, T3, T4, T5); +///-- +function Rec(x1: T1; x2: T2; x3: T3; x4: T4; x5: T5; x6: T6): (T1, T2, T3, T4, T5, T6); +///-- +function Rec(x1: T1; x2: T2; x3: T3; x4: T4; x5: T5; x6: T6; x7: T7): (T1, T2, T3, T4, T5, T6, T7); + + // ----------------------------------------------------- //>> Короткие функции Lst, LLst, HSet, SSet, Dict, KV # Short functions Lst, HSet, SSet, Dict, KV // ----------------------------------------------------- @@ -4260,6 +4278,21 @@ begin Result := ReadSeqStringWhile(cond); end; +// ----------------------------------------------------------------------------- +// Функции Rec для создания кортежей +// ----------------------------------------------------------------------------- +function Rec(x1: T1; x2: T2) := Tuple.Create(x1, x2); + +function Rec(x1: T1; x2: T2; x3: T3) := Tuple.Create(x1, x2, x3); + +function Rec(x1: T1; x2: T2; x3: T3; x4: T4) := Tuple.Create(x1, x2, x3, x4); + +function Rec(x1: T1; x2: T2; x3: T3; x4: T4; x5: T5) := Tuple.Create(x1, x2, x3, x4, x5); + +function Rec(x1: T1; x2: T2; x3: T3; x4: T4; x5: T5; x6: T6) := Tuple.Create(x1, x2, x3, x4, x5, x6); + +function Rec(x1: T1; x2: T2; x3: T3; x4: T4; x5: T5; x6: T6; x7: T7) := Tuple.Create(x1, x2, x3, x4, x5, x6, x7); + // ----------------------------------------------------------------------------- // Функции Lst, LLst, Dict, KV, HSet, SSet // ----------------------------------------------------------------------------- diff --git a/TestSuite/var_typed_init_literalconst_method.pas b/TestSuite/var_typed_init_literalconst_method.pas new file mode 100644 index 000000000..d6bb7a317 --- /dev/null +++ b/TestSuite/var_typed_init_literalconst_method.pas @@ -0,0 +1,4 @@ +begin + var a: integer := '123'.Length; + Assert(a=3); +end. \ No newline at end of file