diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index e0d47d338..f5acc4689 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 = "3081"; + public const string Revision = "3085"; 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 7db63b750..5dd7c4a72 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=3081 +%REVISION%=3085 %COREVERSION%=2 %MAJOR%=3 diff --git a/ICSharpCode.TextEditor/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs b/ICSharpCode.TextEditor/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs index 56735effd..7e4a9cb97 100644 --- a/ICSharpCode.TextEditor/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs +++ b/ICSharpCode.TextEditor/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs @@ -350,6 +350,19 @@ namespace ICSharpCode.TextEditor.Document } } } + var fe = words.FindIndex(tw => string.Compare(tw.Word, "foreach", true) == 0); + if (fe >= 0) + { + var index = words.FindIndex(tw => string.Compare(tw.Word, "index", true) == 0); + if (index >= 0) + { + var f = words[fe]; + var ind = words[index]; + ind.SyntaxColor = f.SyntaxColor; + } + + } + if (currentSpanStack != null && currentSpanStack.IsEmpty) { currentSpanStack = null; diff --git a/InstallerSamples/WhatsNew/3_8_3/foreach_index.pas b/InstallerSamples/WhatsNew/3_8_3/foreach_index.pas new file mode 100644 index 000000000..79485f75c --- /dev/null +++ b/InstallerSamples/WhatsNew/3_8_3/foreach_index.pas @@ -0,0 +1,6 @@ +п»їbegin + var index := 0; + var a := Arr(3, 5, 7); + foreach var x in a index i do + Println(i, x); +end. \ No newline at end of file diff --git a/Libraries/ICSharpCode.TextEditor.dll b/Libraries/ICSharpCode.TextEditor.dll index 1c64e7654..3fffb04e8 100644 Binary files a/Libraries/ICSharpCode.TextEditor.dll and b/Libraries/ICSharpCode.TextEditor.dll differ diff --git a/PABCNetHelp/LangGuide/Operators/for.html b/PABCNetHelp/LangGuide/Operators/for.html index e22d61ec9..510abc4ab 100644 --- a/PABCNetHelp/LangGuide/Operators/for.html +++ b/PABCNetHelp/LangGuide/Operators/for.html @@ -6,6 +6,7 @@ + @@ -65,6 +66,17 @@ for var i := 1 to 5 do
  Print(i*i);

+

Наконец, в заголовке цикла for можно указать шаг изменения цикла:

+
+

for var переменная := + начальное + значение to конечное + значение step значение do
+  
оператор

+
+

При наличии шага цикла разрешается использовать только направление to.

+

Шаг step может быть отрицательным. Если шаг +step равен нулю, возникает ошибка времени выполнения программы.

Текст от слова for до слова do включительно называется заголовком цикла, а оператор после do - телом цикла. @@ -86,7 +98,7 @@ ...
for en := red to blue do
  write(Ord(en):2);
- for var c := 'a' to 'z' do
+ for var c := 'a' to 'z' step 2 do
  write(c);

Если для цикла for ... to diff --git a/PABCNetHelp/LangGuide/Operators/foreach.html b/PABCNetHelp/LangGuide/Operators/foreach.html index b1876a3ea..1efd7f27f 100644 --- a/PABCNetHelp/LangGuide/Operators/foreach.html +++ b/PABCNetHelp/LangGuide/Operators/foreach.html @@ -4,6 +4,7 @@ + @@ -16,19 +17,22 @@ форм:

foreach переменная - in контейнер do
+ in
контейнер [index + переменная] do
 
оператор

или

foreach переменная: тип in контейнер + [index переменная] do
 
оператор

или

foreach var переменная in контейнер + [index переменная] do
 
оператор

@@ -40,8 +44,11 @@ должна иметь тип, совпадающий с типом элементов контейнера (если контейнер удовлетворяет интерфейсу IEnumerable, то это тип object). В последней форме -foreach тип переменной цикла автовыводится по типу элементов +foreach тип переменной цикла автовыводится по типу элементов контейнера.

+

Необязательная часть +index переменная вводит переменную, которая хранит на +каждой итерации индекс элемента контейнера (элементы индексируются с нуля).

Переменная цикла пробегает все значения элементов контейнера и для каждого значения переменной цикла выполняется тело цикла. Изменение переменной цикла diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Common subroutines for files.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Common subroutines for files.html index b31b1dac7..51fb1dfcc 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Common subroutines for files.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Common subroutines for files.html @@ -8,9 +8,9 @@

Общие подпрограммы для работы с файлами

- - - + - + - + - - + + - - - - - - + + + + + + - - + + - - + + - + - - - - - + + + + + - +
procedure Assign(f: файл; name: string); + - diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Functions for file names.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Functions for file names.html index c2b043825..f204e74fc 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Functions for file names.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Functions for file names.html @@ -7,17 +7,17 @@

Подпрограммы для работы с именами файлов

-
procedure Assign(f: файл; fileName: string);
        Связывает файловую переменную с файлом на диске
procedure AssignFile(f: файл; name: string); +
procedure AssignFile(f: файл; fileName: string);
        Связывает файловую переменную с файлом на диске
procedure Close(f: файл);
        Закрывает файл
- - - - - +
function ExpandFileName(fname: string): string; -
        Возвращает полное имя файла fname
function ExtractFileDir(fname: string): string; -
        Выделяет имя диска и путь из полного имени файла fname
function ExtractFileDrive(fname: string): string; -
        Выделяет путь из полного имени файла fname
function ExtractFileExt(fname: string): string; -
        Выделяет расширение из полного имени файла fname
function ExtractFileName(fname: string): string; -
        Выделяет имя файла из полного имени файла fname
function ExtractFilePath(fname: string): string; -
        Выделяет путь из полного имени файла fname
+ + + + +
function ExpandFileName(fileName: string): string; +
        Возвращает полное имя файла fileName
function ExtractFileDir(fileName: string): string; +
        Выделяет имя диска и путь из полного имени файла fileName
function ExtractFileDrive(fileName: string): string; +
        Выделяет путь из полного имени файла fileName
function ExtractFileExt(fileName: string): string; +
        Выделяет расширение из полного имени файла fileName
function ExtractFileName(fileName: string): string; +
        Выделяет имя файла из полного имени файла fileName
function ExtractFilePath(fileName: string): string; +
        Выделяет путь из полного имени файла fileName
\ No newline at end of file diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for binary files.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for binary files.html index 0a2a5ac0e..841742988 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for binary files.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for binary files.html @@ -13,20 +13,20 @@
        Возвращает количество элементов в двоичном файле
procedure Reset(f: двоичный файл);
        Открывает двоичный файл на чтение и запись.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Reset(f: двоичный файл; name: string); +
procedure Reset(f: двоичный файл; fileName: string);
        Связывает файловую переменную f с файлом name на диске и открывает двоичный файл на чтение и запись.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Reset(f: двоичный файл; en: Encoding);
        Открывает двоичный файл на чтение и запись в заданной кодировке.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Reset(f: двоичный файл; name: string; en: Encoding); -
        Связывает файловую переменную f с файлом name на диске и открывает двоичный файл на чтение и запись в заданной кодировке.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Reset(f: двоичный файл; fileName: string; en: Encoding); +
        Связывает файловую переменную f с файлом fileName на диске и открывает двоичный файл на чтение и запись в заданной кодировке.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Rewrite(f: двоичный файл);
        Открывает двоичный файл на чтение и запись, при этом обнуляя его содержимое. Если файл существовал, он обнуляется.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Rewrite(f: двоичный файл; name: string); -
        Связывает файловую переменную f с файлом name на диске и открывает двоичный файл на чтение и запись, при этом обнуляя его содержимое.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Rewrite(f: двоичный файл; fileName: string); +
        Связывает файловую переменную f с файлом fileName на диске и открывает двоичный файл на чтение и запись, при этом обнуляя его содержимое.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Rewrite(f: двоичный файл; en: Encoding);
        Открывает двоичный файл на чтение и запись в заданной кодировке, при этом обнуляя его содержимое. Если файл существовал, он обнуляется.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Rewrite(f: двоичный файл; name: string; en: Encoding); -
        Связывает файловую переменную f с файлом name на диске и открывает двоичный файл на чтение и запись в заданной кодировке, при этом обнуляя его содержимое.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Rewrite(f: двоичный файл; fileName: string; en: Encoding); +
        Связывает файловую переменную f с файлом fileName на диске и открывает двоичный файл на чтение и запись в заданной кодировке, при этом обнуляя его содержимое.Двоичный файл - это либо типизированный файл file of T, либо бестиповой файл file
procedure Seek(f: двоичный файл; n: int64);
        Устанавливает текущую позицию файлового указателя в двоичном файле на элемент с данным номером
procedure Truncate(f: двоичный файл); diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for text files.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for text files.html index bf3f3d19a..452cbacea 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for text files.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Subroutines for text files.html @@ -21,26 +21,26 @@
        Открывает текстовый файл на дополнение в кодировке Windows
procedure Append(f: Text; en: Encoding);
        Открывает текстовый файл на дополнение в указанной кодировке
procedure Append(f: Text; name: string); -
        Связывает файловую переменную f с именем файла name и открывает текстовый файл на дополнение в кодировке Windows
procedure Append(f: Text; name: string; en: Encoding); -
        Связывает файловую переменную f с именем файла name и открывает текстовый файл на дополнение в указанной кодировке
procedure Append(f: Text; fileName: string); +
        Связывает файловую переменную f с именем файла fileName и открывает текстовый файл на дополнение в кодировке Windows
procedure Append(f: Text; fileName: string; en: Encoding); +
        Связывает файловую переменную f с именем файла fileName и открывает текстовый файл на дополнение в указанной кодировке
function Eoln(f: Text): boolean;
        Возвращает True, если в файле достигнут конец строки
procedure Flush(f: Text);
        Записывает содержимое буфера файла на диск
function OpenAppend(fname: string): Text; -
        Возвращает текстовый файл с именем fname, открытый на дополнение в кодировке Windows
function OpenAppend(fname: string; en: Encoding): Text; -
        Возвращает текстовый файл с именем fname, открытый на дополнение в указанной кодировке
function OpenRead(fname: string): Text; -
        Возвращает текстовый файл с именем fname, открытый на чтение в кодировке Windows
function OpenRead(fname: string; en: Encoding): Text; -
        Возвращает текстовый файл с именем fname, открытый на чтение в указанной кодировке
function OpenWrite(fname: string): Text; -
        Возвращает текстовый файл с именем fname, открытый на запись в кодировке Windows
function OpenWrite(fname: string; en: Encoding): Text; -
        Возвращает текстовый файл с именем fname, открытый на запись в указанной кодировке
function OpenAppend(fileName: string): Text; +
        Возвращает текстовый файл с именем fileName, открытый на дополнение в кодировке Windows
function OpenAppend(fileName: string; en: Encoding): Text; +
        Возвращает текстовый файл с именем fileName, открытый на дополнение в указанной кодировке
function OpenRead(fileName: string): Text; +
        Возвращает текстовый файл с именем fileName, открытый на чтение в кодировке Windows
function OpenRead(fileName: string; en: Encoding): Text; +
        Возвращает текстовый файл с именем fileName, открытый на чтение в указанной кодировке
function OpenWrite(fileName: string): Text; +
        Возвращает текстовый файл с именем fileName, открытый на запись в кодировке Windows
function OpenWrite(fileName: string; en: Encoding): Text; +
        Возвращает текстовый файл с именем fileName, открытый на запись в указанной кодировке
function ReadAllLines(path: string): array of string;
        Открывает файл, считывает из него строки в кодировке Windows в виде массива строк, после чего закрывает файл
function ReadAllLines(path: string; en: Encoding): array of string; @@ -57,18 +57,18 @@
        Открывает текстовый файл на чтение в кодировке Windows
procedure Reset(f: Text; en: Encoding);
        Открывает текстовый файл на чтение в указанной кодировке
procedure Reset(f: Text; name: string); -
        Связывает файловую переменную f с именем файла name и открывает текстовый файл на чтение в кодировке Windows
procedure Reset(f: Text; name: string; en: Encoding); -
        Связывает файловую переменную f с именем файла name и открывает текстовый файл на чтение в указанной кодировке
procedure Reset(f: Text; fileName: string); +
        Связывает файловую переменную f с именем файла fileName и открывает текстовый файл на чтение в кодировке Windows
procedure Reset(f: Text; fileName: string; en: Encoding); +
        Связывает файловую переменную f с именем файла fileName и открывает текстовый файл на чтение в указанной кодировке
procedure Rewrite(f: Text);
        Открывает текстовый файл на запись в кодировке Windows.Если файл существовал - он обнуляется, если нет - создается пустой
procedure Rewrite(f: Text; en: Encoding);
        Открывает текстовый файл на запись в указанной кодировке.Если файл существовал - он обнуляется, если нет - создается пустой
procedure Rewrite(f: Text; name: string); -
        Связывает файловую переменную с именем файла name и открывает текстовый файл f на запись в кодировке Windows.Если файл существовал - он обнуляется, если нет - создается пустой
procedure Rewrite(f: Text; name: string; en: Encoding); -
        Связывает файловую переменную f с именем файла name и открывает текстовый файл f на запись в указанной кодировке.Если файл существовал - он обнуляется, если нет - создается пустой
procedure Rewrite(f: Text; fileName: string); +
        Связывает файловую переменную с именем файла fileName и открывает текстовый файл f на запись в кодировке Windows.Если файл существовал - он обнуляется, если нет - создается пустой
procedure Rewrite(f: Text; fileName: string; en: Encoding); +
        Связывает файловую переменную f с именем файла fileName и открывает текстовый файл f на запись в указанной кодировке.Если файл существовал - он обнуляется, если нет - создается пустой
function SeekEof(f: Text): boolean;
        Пропускает пробельные символы, после чего возвращает True, если достигнут конец файла
function SeekEoln(f: Text): boolean; diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/System subroutines.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/System subroutines.html index 63fdd1544..31ba73aa5 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/System subroutines.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/System subroutines.html @@ -37,8 +37,8 @@
        Выводит в специальном окне стек вызовов подпрограмм если условие не выполняется
procedure Assert(cond: boolean; message: string);
        Выводит в специальном окне диагностическое сообщение и стек вызовов подпрограмм если условие не выполняется
function ChangeFileNameExtension(name, newext: string): string; -
        Изменяет расширение файла с именем name на newext
function ChangeFileNameExtension(fileName, newExt: string): string; +
        Изменяет расширение файла с именем fileName на newExt
procedure ChDir(s: string);
        Меняет текущий каталог
function CreateDir(s: string): boolean; @@ -63,16 +63,16 @@
        Возвращает последовательность имен каталогов по заданному пути
function EnumerateFiles(path: string; searchPattern: string := '*.*'): sequence of string;
        Возвращает последовательность имен файлов по заданному пути, соответствующих шаблону поиска
procedure Exec(filename: string); -
        Запускает программу или документ с именем filename
procedure Exec(filename: string; args: string); -
        Запускает программу или документ с именем filename и параметрами командной строки args
procedure Execute(filename: string); -
        Запускает программу или документ с именем filename
procedure Execute(filename: string; args: string); -
        Запускает программу или документ с именем filename и параметрами командной строки args
function FileExists(name: string): boolean; -
        Возвращает True, если файл с именем name существует
procedure Exec(fileName: string); +
        Запускает программу или документ с именем fileName
procedure Exec(fileName: string; args: string); +
        Запускает программу или документ с именем fileName и параметрами командной строки args
procedure Execute(fileName: string); +
        Запускает программу или документ с именем fileName
procedure Execute(fileName: string; args: string); +
        Запускает программу или документ с именем fileName и параметрами командной строки args
function FileExists(fileName: string): boolean; +
        Возвращает True, если файл с именем fileName существует
function GetCurrentDir: string;
        Возвращает текущий каталог
function GetDir: string; @@ -101,8 +101,8 @@
        Преобразует указатель к строковому представлению
function RemoveDir(s: string): boolean;
        Удаляет каталог. Возвращает True, если каталог успешно удален
function RenameFile(name, newname: string): boolean; -
        Переименовывает файл name, давая ему новое имя newname. Возвращает True, если файл успешно переименован
function RenameFile(fileName, newfileName: string): boolean; +
        Переименовывает файл fileName, давая ему новое имя newfileName. Возвращает True, если файл успешно переименован
procedure RmDir(s: string);
        Удаляет каталог
function SetCurrentDir(s: string): boolean; diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html index aec417fac..eb568952e 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html @@ -9,7 +9,7 @@

Подпрограммы вывода

-
function Deserialize(filename: string): object; + @@ -19,7 +19,7 @@
        Выводит значения a,b,... на экран, после каждого значения выводит пробел и переходит на новую строку - diff --git a/PABCNetHelp/LangGuide/_ProgrStruct_Defs/identifiers.html b/PABCNetHelp/LangGuide/_ProgrStruct_Defs/identifiers.html index 8e87d18d6..fc7a0d397 100644 --- a/PABCNetHelp/LangGuide/_ProgrStruct_Defs/identifiers.html +++ b/PABCNetHelp/LangGuide/_ProgrStruct_Defs/identifiers.html @@ -35,7 +35,7 @@ uses using var where while with xor

Ряд слов является контекстно ключевыми (они являются ключевыми только в некотором контексте):

abstract default external forward internal on overload override -params private protected public read reintroduce unit virtual write

+params private protected public read reintroduce unit virtual write step index

Контекстно ключевые слова могут использоваться в качестве имен.

Некоторые ключевые слова совпадают с важнейшими именами платформы .NET. Поэтому в PascalABC.NET diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index fdf94bc09..411b9a5f1 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: DESKTOP-G8V08V4 -// DateTime: 17.02.2022 17:47:15 +// DateTime: 23.02.2022 10:29:10 // UserName: ????????? // GPLEX input file // GPLEX frame file @@ -1994,6 +1994,7 @@ string cur_yytext = yytext; case (int)Tokens.tkInternal: case (int)Tokens.tkRead: case (int)Tokens.tkWrite: + case (int)Tokens.tkIndex: yylval = new Union(); yylval.id = new ident(cur_yytext,currentLexLocation); break; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex index e8ac0468b..cd83ca11b 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex @@ -408,6 +408,7 @@ UNICODEARROW \x890 case (int)Tokens.tkInternal: case (int)Tokens.tkRead: case (int)Tokens.tkWrite: + case (int)Tokens.tkIndex: yylval = new Union(); yylval.id = new ident(cur_yytext,currentLexLocation); break; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 2845f9a6f..308c7921f 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -41,7 +41,8 @@ %token tkSequence tkYield tkShortProgram tkVertParen tkShortSFProgram %token tkNew %token tkOn -%token tkName tkPrivate tkProtected tkPublic tkInternal tkRead tkWrite +%token tkName tkPrivate tkProtected tkPublic tkInternal tkRead tkWrite +%token tkIndex %token tkParseModeExpression tkParseModeStatement tkParseModeType tkBegin tkEnd %token tkAsmBody tkILCode tkError INVISIBLE %token tkRepeat tkUntil tkDo tkComma tkFinally tkTry @@ -53,7 +54,7 @@ %token tkAbstract tkForward tkOverload tkReintroduce tkOverride tkVirtual tkExtensionMethod %token tkInteger tkBigInteger tkFloat tkHex %token tkUnknown -%token tkStep +%token tkStep %type unit_key_word class_or_static %type assignment @@ -185,6 +186,7 @@ %type const_pattern_expression pattern deconstruction_or_const_pattern pattern_optional_var collection_pattern tuple_pattern collection_pattern_list_item tuple_pattern_item collection_pattern_var_item match_with pattern_case pattern_cases pattern_out_param pattern_out_param_optional_var %type pattern_out_param_list pattern_out_param_list_optional_var collection_pattern_expr_list tuple_pattern_item_list const_pattern_expr_list %type var_with_init_for_expr_with_let var_with_init_for_expr_with_let_list +%type index_or_nothing %% @@ -3028,39 +3030,46 @@ lock_stmt } ; +index_or_nothing + : tkIndex tkIdentifier + { $$ = $2; } + | + { $$ = null; } + ; + foreach_stmt - : tkForeach identifier foreach_stmt_ident_dype_opt tkIn expr_l1 tkDo unlabelled_stmt + : tkForeach identifier foreach_stmt_ident_dype_opt tkIn expr_l1 index_or_nothing tkDo unlabelled_stmt { - $$ = new foreach_stmt($2, $3, $5, $7 as statement, @$); + $$ = new foreach_stmt($2, $3, $5, $8 as statement, $6, @$); if ($3 == null) parsertools.AddWarningFromResource("USING_UNLOCAL_FOREACH_VARIABLE", $2.source_context); } - | tkForeach tkVar identifier tkColon type_ref tkIn expr_l1 tkDo unlabelled_stmt + | tkForeach tkVar identifier tkColon type_ref tkIn expr_l1 index_or_nothing tkDo unlabelled_stmt { - $$ = new foreach_stmt($3, $5, $7, $9 as statement, @$); + $$ = new foreach_stmt($3, $5, $7, $10 as statement, $8, @$); } - | tkForeach tkVar identifier tkIn expr_l1 tkDo unlabelled_stmt + | tkForeach tkVar identifier tkIn expr_l1 index_or_nothing tkDo unlabelled_stmt { - $$ = new foreach_stmt($3, new no_type_foreach(), $5, (statement)$7, @$); + $$ = new foreach_stmt($3, new no_type_foreach(), $5, (statement)$8, $6, @$); } - | tkForeach tkVar tkRoundOpen ident_list tkRoundClose tkIn expr_l1 tkDo unlabelled_stmt // сахарное правило + | tkForeach tkVar tkRoundOpen ident_list tkRoundClose tkIn expr_l1 index_or_nothing tkDo unlabelled_stmt // сахарное правило { if (parsertools.build_tree_for_formatter) { var il = $4 as ident_list; il.source_context = LexLocation.MergeAll(@4,@5); // нужно для форматирования - $$ = new foreach_stmt_formatting(il,$7,$9 as statement,@$); + $$ = new foreach_stmt_formatting(il,$7,$10 as statement,$8,@$); } else { - // Есть проблема - непонятно, где здесь сделать семантческий узед для проверки + // Есть проблема - непонятно, где здесь сделать семантческий узел для проверки // Проверить можно и в foreach, но где-то должен быть маркер, что это сахарный узел // Например, идентификатор #fe - но это плохая идея var id = NewId("#fe",@4); var tttt = new assign_var_tuple($4 as ident_list, id, @$); - statement_list nine = $9 is statement_list ? $9 as statement_list : new statement_list($9 as statement,@9); + statement_list nine = $10 is statement_list ? $10 as statement_list : new statement_list($10 as statement,@9); nine.Insert(0,tttt); - var fe = new foreach_stmt(id, new no_type_foreach(), $7, nine, @$); + var fe = new foreach_stmt(id, new no_type_foreach(), $7, nine, $8, @$); fe.ext = $4 as ident_list; $$ = fe; } @@ -4477,6 +4486,8 @@ identifier { $$ = $1; } | tkStep { $$ = new ident($1.text, @$); } + | tkIndex + { $$ = $1; } ; identifier_or_keyword diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index e8d941824..e8d5024bc 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,9 +2,9 @@ // GPPG version 1.3.6 // Machine: DESKTOP-G8V08V4 -// DateTime: 17.02.2022 17:47:16 +// DateTime: 23.02.2022 10:29:11 // UserName: ????????? -// Input file +// Input file // options: no-lines gplex @@ -37,19 +37,19 @@ public enum Tokens { tkSealed=67,tkPartial=68,tkTo=69,tkDownto=70,tkLoop=71,tkSequence=72, tkYield=73,tkShortProgram=74,tkVertParen=75,tkShortSFProgram=76,tkNew=77,tkOn=78, tkName=79,tkPrivate=80,tkProtected=81,tkPublic=82,tkInternal=83,tkRead=84, - tkWrite=85,tkParseModeExpression=86,tkParseModeStatement=87,tkParseModeType=88,tkBegin=89,tkEnd=90, - tkAsmBody=91,tkILCode=92,tkError=93,INVISIBLE=94,tkRepeat=95,tkUntil=96, - tkDo=97,tkComma=98,tkFinally=99,tkTry=100,tkInitialization=101,tkFinalization=102, - tkUnit=103,tkLibrary=104,tkExternal=105,tkParams=106,tkNamespace=107,tkAssign=108, - tkPlusEqual=109,tkMinusEqual=110,tkMultEqual=111,tkDivEqual=112,tkMinus=113,tkPlus=114, - tkSlash=115,tkStar=116,tkStarStar=117,tkEqual=118,tkGreater=119,tkGreaterEqual=120, - tkLower=121,tkLowerEqual=122,tkNotEqual=123,tkCSharpStyleOr=124,tkArrow=125,tkOr=126, - tkXor=127,tkAnd=128,tkDiv=129,tkMod=130,tkShl=131,tkShr=132, - tkNot=133,tkAs=134,tkIn=135,tkIs=136,tkImplicit=137,tkExplicit=138, - tkAddressOf=139,tkDeref=140,tkIdentifier=141,tkStringLiteral=142,tkFormatStringLiteral=143,tkAsciiChar=144, - tkAbstract=145,tkForward=146,tkOverload=147,tkReintroduce=148,tkOverride=149,tkVirtual=150, - tkExtensionMethod=151,tkInteger=152,tkBigInteger=153,tkFloat=154,tkHex=155,tkUnknown=156, - tkStep=157}; + tkWrite=85,tkIndex=86,tkParseModeExpression=87,tkParseModeStatement=88,tkParseModeType=89,tkBegin=90, + tkEnd=91,tkAsmBody=92,tkILCode=93,tkError=94,INVISIBLE=95,tkRepeat=96, + tkUntil=97,tkDo=98,tkComma=99,tkFinally=100,tkTry=101,tkInitialization=102, + tkFinalization=103,tkUnit=104,tkLibrary=105,tkExternal=106,tkParams=107,tkNamespace=108, + tkAssign=109,tkPlusEqual=110,tkMinusEqual=111,tkMultEqual=112,tkDivEqual=113,tkMinus=114, + tkPlus=115,tkSlash=116,tkStar=117,tkStarStar=118,tkEqual=119,tkGreater=120, + tkGreaterEqual=121,tkLower=122,tkLowerEqual=123,tkNotEqual=124,tkCSharpStyleOr=125,tkArrow=126, + tkOr=127,tkXor=128,tkAnd=129,tkDiv=130,tkMod=131,tkShl=132, + tkShr=133,tkNot=134,tkAs=135,tkIn=136,tkIs=137,tkImplicit=138, + tkExplicit=139,tkAddressOf=140,tkDeref=141,tkIdentifier=142,tkStringLiteral=143,tkFormatStringLiteral=144, + tkAsciiChar=145,tkAbstract=146,tkForward=147,tkOverload=148,tkReintroduce=149,tkOverride=150, + tkVirtual=151,tkExtensionMethod=152,tkInteger=153,tkBigInteger=154,tkFloat=155,tkHex=156, + tkUnknown=157,tkStep=158}; // Abstract base class for GPLEX scanners public abstract class ScanBase : AbstractScanner { @@ -60,7 +60,7 @@ public abstract class ScanBase : AbstractScanner { - // Verbatim content from ABCPascal.y + // Verbatim content from D:\PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y // пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅ GPPGParser, пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ, пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ gppg public syntax_tree_node root; // пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ @@ -72,13 +72,13 @@ public partial class GPPGParser: ShiftReduceParser scanner) : base(scanner) { } - // End verbatim content from ABCPascal.y + // End verbatim content from D:\PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y #pragma warning disable 649 private static Dictionary aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[1009]; - private static State[] states = new State[1675]; + private static Rule[] rules = new Rule[1012]; + private static State[] states = new State[1682]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "class_or_static", "assignment", "optional_array_initializer", "attribute_declarations", "ot_visibility_specifier", "one_attribute", "attribute_variable", @@ -170,17 +170,18 @@ public partial class GPPGParser: ShiftReduceParser tkForeach, identifier, foreach_stmt_ident_dype_opt, tkIn, - // expr_l1, tkDo, unlabelled_stmt + case 552: // index_or_nothing -> tkIndex, tkIdentifier +{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } + break; + case 553: // index_or_nothing -> /* empty */ +{ CurrentSemanticValue.id = null; } + break; + case 554: // foreach_stmt -> tkForeach, identifier, foreach_stmt_ident_dype_opt, tkIn, + // expr_l1, index_or_nothing, tkDo, unlabelled_stmt { - CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-6].id, ValueStack[ValueStack.Depth-5].td, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); - if (ValueStack[ValueStack.Depth-5].td == null) - parsertools.AddWarningFromResource("USING_UNLOCAL_FOREACH_VARIABLE", ValueStack[ValueStack.Depth-6].id.source_context); + CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-7].id, ValueStack[ValueStack.Depth-6].td, ValueStack[ValueStack.Depth-4].ex, ValueStack[ValueStack.Depth-1].stn as statement, ValueStack[ValueStack.Depth-3].id, CurrentLocationSpan); + if (ValueStack[ValueStack.Depth-6].td == null) + parsertools.AddWarningFromResource("USING_UNLOCAL_FOREACH_VARIABLE", ValueStack[ValueStack.Depth-7].id.source_context); } break; - case 553: // foreach_stmt -> tkForeach, tkVar, identifier, tkColon, type_ref, tkIn, expr_l1, + case 555: // foreach_stmt -> tkForeach, tkVar, identifier, tkColon, type_ref, tkIn, expr_l1, + // index_or_nothing, tkDo, unlabelled_stmt +{ + CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-8].id, ValueStack[ValueStack.Depth-6].td, ValueStack[ValueStack.Depth-4].ex, ValueStack[ValueStack.Depth-1].stn as statement, ValueStack[ValueStack.Depth-3].id, CurrentLocationSpan); + } + break; + case 556: // foreach_stmt -> tkForeach, tkVar, identifier, tkIn, expr_l1, index_or_nothing, // tkDo, unlabelled_stmt { - CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-7].id, ValueStack[ValueStack.Depth-5].td, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); + CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-6].id, new no_type_foreach(), ValueStack[ValueStack.Depth-4].ex, (statement)ValueStack[ValueStack.Depth-1].stn, ValueStack[ValueStack.Depth-3].id, CurrentLocationSpan); } break; - case 554: // foreach_stmt -> tkForeach, tkVar, identifier, tkIn, expr_l1, tkDo, - // unlabelled_stmt -{ - CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-5].id, new no_type_foreach(), ValueStack[ValueStack.Depth-3].ex, (statement)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); - } - break; - case 555: // foreach_stmt -> tkForeach, tkVar, tkRoundOpen, ident_list, tkRoundClose, tkIn, - // expr_l1, tkDo, unlabelled_stmt + case 557: // foreach_stmt -> tkForeach, tkVar, tkRoundOpen, ident_list, tkRoundClose, tkIn, + // expr_l1, index_or_nothing, tkDo, unlabelled_stmt { if (parsertools.build_tree_for_formatter) { - var il = ValueStack[ValueStack.Depth-6].stn as ident_list; - il.source_context = LexLocation.MergeAll(LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5]); // пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ - CurrentSemanticValue.stn = new foreach_stmt_formatting(il,ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].stn as statement,CurrentLocationSpan); + var il = ValueStack[ValueStack.Depth-7].stn as ident_list; + il.source_context = LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6]); // пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ + CurrentSemanticValue.stn = new foreach_stmt_formatting(il,ValueStack[ValueStack.Depth-4].ex,ValueStack[ValueStack.Depth-1].stn as statement,ValueStack[ValueStack.Depth-3].id,CurrentLocationSpan); } else { // пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ - пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ, пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ // пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅ пїЅ foreach, пїЅпїЅ пїЅпїЅпїЅ-пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ, пїЅпїЅпїЅ пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ // пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ, пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ #fe - пїЅпїЅ пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ - var id = NewId("#fe",LocationStack[LocationStack.Depth-6]); - var tttt = new assign_var_tuple(ValueStack[ValueStack.Depth-6].stn as ident_list, id, CurrentLocationSpan); - statement_list nine = ValueStack[ValueStack.Depth-1].stn is statement_list ? ValueStack[ValueStack.Depth-1].stn as statement_list : new statement_list(ValueStack[ValueStack.Depth-1].stn as statement,LocationStack[LocationStack.Depth-1]); + var id = NewId("#fe",LocationStack[LocationStack.Depth-7]); + var tttt = new assign_var_tuple(ValueStack[ValueStack.Depth-7].stn as ident_list, id, CurrentLocationSpan); + statement_list nine = ValueStack[ValueStack.Depth-1].stn is statement_list ? ValueStack[ValueStack.Depth-1].stn as statement_list : new statement_list(ValueStack[ValueStack.Depth-1].stn as statement,LocationStack[LocationStack.Depth-2]); nine.Insert(0,tttt); - var fe = new foreach_stmt(id, new no_type_foreach(), ValueStack[ValueStack.Depth-3].ex, nine, CurrentLocationSpan); - fe.ext = ValueStack[ValueStack.Depth-6].stn as ident_list; + var fe = new foreach_stmt(id, new no_type_foreach(), ValueStack[ValueStack.Depth-4].ex, nine, ValueStack[ValueStack.Depth-3].id, CurrentLocationSpan); + fe.ext = ValueStack[ValueStack.Depth-7].stn as ident_list; CurrentSemanticValue.stn = fe; } } break; - case 556: // foreach_stmt_ident_dype_opt -> tkColon, type_ref + case 558: // foreach_stmt_ident_dype_opt -> tkColon, type_ref { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 558: // for_stmt -> tkFor, optional_var, identifier, for_stmt_decl_or_assign, expr_l1, + case 560: // for_stmt -> tkFor, optional_var, identifier, for_stmt_decl_or_assign, expr_l1, // for_cycle_type, expr_l1, optional_tk_do, unlabelled_stmt { CurrentSemanticValue.stn = NewForStmt((bool)ValueStack[ValueStack.Depth-8].ob, ValueStack[ValueStack.Depth-7].id, ValueStack[ValueStack.Depth-6].td, ValueStack[ValueStack.Depth-5].ex, (for_cycle_type)ValueStack[ValueStack.Depth-4].ob, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-2].ti, ValueStack[ValueStack.Depth-1].stn as statement, null, CurrentLocationSpan); } break; - case 559: // for_stmt -> tkFor, optional_var, identifier, for_stmt_decl_or_assign, expr_l1, + case 561: // for_stmt -> tkFor, optional_var, identifier, for_stmt_decl_or_assign, expr_l1, // for_cycle_type, expr_l1, tkStep, expr_l1, optional_tk_do, // unlabelled_stmt { CurrentSemanticValue.stn = NewForStmt((bool)ValueStack[ValueStack.Depth-10].ob, ValueStack[ValueStack.Depth-9].id, ValueStack[ValueStack.Depth-8].td, ValueStack[ValueStack.Depth-7].ex, (for_cycle_type)ValueStack[ValueStack.Depth-6].ob, ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-4].ti, ValueStack[ValueStack.Depth-1].stn as statement, ValueStack[ValueStack.Depth-3].ex, CurrentLocationSpan); } break; - case 560: // optional_var -> tkVar + case 562: // optional_var -> tkVar { CurrentSemanticValue.ob = true; } break; - case 561: // optional_var -> /* empty */ + case 563: // optional_var -> /* empty */ { CurrentSemanticValue.ob = false; } break; - case 563: // for_stmt_decl_or_assign -> tkColon, simple_type_identifier, tkAssign + case 565: // for_stmt_decl_or_assign -> tkColon, simple_type_identifier, tkAssign { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-2].td; } break; - case 564: // for_cycle_type -> tkTo + case 566: // for_cycle_type -> tkTo { CurrentSemanticValue.ob = for_cycle_type.to; } break; - case 565: // for_cycle_type -> tkDownto + case 567: // for_cycle_type -> tkDownto { CurrentSemanticValue.ob = for_cycle_type.downto; } break; - case 566: // with_stmt -> tkWith, expr_list, tkDo, unlabelled_stmt + case 568: // with_stmt -> tkWith, expr_list, tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new with_statement(ValueStack[ValueStack.Depth-1].stn as statement, ValueStack[ValueStack.Depth-3].stn as expression_list, CurrentLocationSpan); } break; - case 567: // inherited_message -> tkInherited + case 569: // inherited_message -> tkInherited { CurrentSemanticValue.stn = new inherited_message(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 568: // try_stmt -> tkTry, stmt_list, try_handler + case 570: // try_stmt -> tkTry, stmt_list, try_handler { CurrentSemanticValue.stn = new try_stmt(ValueStack[ValueStack.Depth-2].stn as statement_list, ValueStack[ValueStack.Depth-1].stn as try_handler, CurrentLocationSpan); (ValueStack[ValueStack.Depth-2].stn as statement_list).left_logical_bracket = ValueStack[ValueStack.Depth-3].ti; ValueStack[ValueStack.Depth-2].stn.source_context = LocationStack[LocationStack.Depth-3].Merge(LocationStack[LocationStack.Depth-2]); } break; - case 569: // try_handler -> tkFinally, stmt_list, tkEnd + case 571: // try_handler -> tkFinally, stmt_list, tkEnd { CurrentSemanticValue.stn = new try_handler_finally(ValueStack[ValueStack.Depth-2].stn as statement_list, CurrentLocationSpan); (ValueStack[ValueStack.Depth-2].stn as statement_list).left_logical_bracket = ValueStack[ValueStack.Depth-3].ti; (ValueStack[ValueStack.Depth-2].stn as statement_list).right_logical_bracket = ValueStack[ValueStack.Depth-1].ti; } break; - case 570: // try_handler -> tkExcept, exception_block, tkEnd + case 572: // try_handler -> tkExcept, exception_block, tkEnd { CurrentSemanticValue.stn = new try_handler_except((exception_block)ValueStack[ValueStack.Depth-2].stn, CurrentLocationSpan); if ((ValueStack[ValueStack.Depth-2].stn as exception_block).stmt_list != null) @@ -5630,166 +5647,166 @@ public partial class GPPGParser: ShiftReduceParser exception_handler_list, exception_block_else_branch + case 573: // exception_block -> exception_handler_list, exception_block_else_branch { CurrentSemanticValue.stn = new exception_block(null, (exception_handler_list)ValueStack[ValueStack.Depth-2].stn, (statement_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 572: // exception_block -> exception_handler_list, tkSemiColon, + case 574: // exception_block -> exception_handler_list, tkSemiColon, // exception_block_else_branch { CurrentSemanticValue.stn = new exception_block(null, (exception_handler_list)ValueStack[ValueStack.Depth-3].stn, (statement_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 573: // exception_block -> stmt_list + case 575: // exception_block -> stmt_list { CurrentSemanticValue.stn = new exception_block(ValueStack[ValueStack.Depth-1].stn as statement_list, null, null, LocationStack[LocationStack.Depth-1]); } break; - case 574: // exception_handler_list -> exception_handler + case 576: // exception_handler_list -> exception_handler { CurrentSemanticValue.stn = new exception_handler_list(ValueStack[ValueStack.Depth-1].stn as exception_handler, CurrentLocationSpan); } break; - case 575: // exception_handler_list -> exception_handler_list, tkSemiColon, + case 577: // exception_handler_list -> exception_handler_list, tkSemiColon, // exception_handler { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as exception_handler_list).Add(ValueStack[ValueStack.Depth-1].stn as exception_handler, CurrentLocationSpan); } break; - case 576: // exception_block_else_branch -> /* empty */ + case 578: // exception_block_else_branch -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 577: // exception_block_else_branch -> tkElse, stmt_list + case 579: // exception_block_else_branch -> tkElse, stmt_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 578: // exception_handler -> tkOn, exception_identifier, tkDo, unlabelled_stmt + case 580: // exception_handler -> tkOn, exception_identifier, tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new exception_handler((ValueStack[ValueStack.Depth-3].stn as exception_ident).variable, (ValueStack[ValueStack.Depth-3].stn as exception_ident).type_name, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 579: // exception_identifier -> exception_class_type_identifier + case 581: // exception_identifier -> exception_class_type_identifier { CurrentSemanticValue.stn = new exception_ident(null, (named_type_reference)ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 580: // exception_identifier -> exception_variable, tkColon, + case 582: // exception_identifier -> exception_variable, tkColon, // exception_class_type_identifier { CurrentSemanticValue.stn = new exception_ident(ValueStack[ValueStack.Depth-3].id, (named_type_reference)ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 581: // exception_class_type_identifier -> simple_type_identifier + case 583: // exception_class_type_identifier -> simple_type_identifier { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 582: // exception_variable -> identifier + case 584: // exception_variable -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 583: // raise_stmt -> tkRaise + case 585: // raise_stmt -> tkRaise { CurrentSemanticValue.stn = new raise_stmt(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 584: // raise_stmt -> tkRaise, expr + case 586: // raise_stmt -> tkRaise, expr { CurrentSemanticValue.stn = new raise_stmt(ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 585: // expr_list -> expr_with_func_decl_lambda + case 587: // expr_list -> expr_with_func_decl_lambda { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 586: // expr_list -> expr_list, tkComma, expr_with_func_decl_lambda + case 588: // expr_list -> expr_list, tkComma, expr_with_func_decl_lambda { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 587: // expr_as_stmt -> allowable_expr_as_stmt + case 589: // expr_as_stmt -> allowable_expr_as_stmt { CurrentSemanticValue.stn = new expression_as_statement(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 588: // allowable_expr_as_stmt -> new_expr + case 590: // allowable_expr_as_stmt -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 589: // expr_with_func_decl_lambda -> expr + case 591: // expr_with_func_decl_lambda -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 590: // expr_with_func_decl_lambda -> func_decl_lambda + case 592: // expr_with_func_decl_lambda -> func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 591: // expr_with_func_decl_lambda -> tkInherited + case 593: // expr_with_func_decl_lambda -> tkInherited { CurrentSemanticValue.ex = new inherited_ident("", CurrentLocationSpan); } break; - case 592: // expr -> expr_l1 + case 594: // expr -> expr_l1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 593: // expr -> format_expr + case 595: // expr -> format_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 594: // expr_l1 -> expr_dq + case 596: // expr_l1 -> expr_dq { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 595: // expr_l1 -> question_expr + case 597: // expr_l1 -> question_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 596: // expr_l1 -> new_question_expr + case 598: // expr_l1 -> new_question_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 597: // expr_l1_for_question_expr -> expr_dq + case 599: // expr_l1_for_question_expr -> expr_dq { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 598: // expr_l1_for_question_expr -> question_expr + case 600: // expr_l1_for_question_expr -> question_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 599: // expr_l1_for_new_question_expr -> expr_dq + case 601: // expr_l1_for_new_question_expr -> expr_dq { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 600: // expr_l1_for_new_question_expr -> new_question_expr + case 602: // expr_l1_for_new_question_expr -> new_question_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 601: // expr_l1_func_decl_lambda -> expr_l1 + case 603: // expr_l1_func_decl_lambda -> expr_l1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 602: // expr_l1_func_decl_lambda -> func_decl_lambda + case 604: // expr_l1_func_decl_lambda -> func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 603: // expr_l1_for_lambda -> expr_dq + case 605: // expr_l1_for_lambda -> expr_dq { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 604: // expr_l1_for_lambda -> question_expr + case 606: // expr_l1_for_lambda -> question_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 605: // expr_l1_for_lambda -> func_decl_lambda + case 607: // expr_l1_for_lambda -> func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 606: // expr_dq -> relop_expr + case 608: // expr_dq -> relop_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 607: // expr_dq -> expr_dq, tkDoubleQuestion, relop_expr + case 609: // expr_dq -> expr_dq, tkDoubleQuestion, relop_expr { CurrentSemanticValue.ex = new double_question_node(ValueStack[ValueStack.Depth-3].ex as expression, ValueStack[ValueStack.Depth-1].ex as expression, CurrentLocationSpan);} break; - case 608: // sizeof_expr -> tkSizeOf, tkRoundOpen, simple_or_template_type_reference, + case 610: // sizeof_expr -> tkSizeOf, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new sizeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, null, CurrentLocationSpan); } break; - case 609: // typeof_expr -> tkTypeOf, tkRoundOpen, simple_or_template_type_reference, + case 611: // typeof_expr -> tkTypeOf, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new typeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 610: // typeof_expr -> tkTypeOf, tkRoundOpen, empty_template_type_reference, + case 612: // typeof_expr -> tkTypeOf, tkRoundOpen, empty_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new typeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 611: // question_expr -> expr_l1_for_question_expr, tkQuestion, + case 613: // question_expr -> expr_l1_for_question_expr, tkQuestion, // expr_l1_for_question_expr, tkColon, // expr_l1_for_question_expr { @@ -5798,7 +5815,7 @@ public partial class GPPGParser: ShiftReduceParser tkIf, expr_l1_for_new_question_expr, tkThen, + case 614: // new_question_expr -> tkIf, expr_l1_for_new_question_expr, tkThen, // expr_l1_for_new_question_expr, tkElse, // expr_l1_for_new_question_expr { @@ -5814,58 +5831,58 @@ public partial class GPPGParser: ShiftReduceParser simple_type_identifier, + case 615: // empty_template_type_reference -> simple_type_identifier, // template_type_empty_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-2].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 614: // empty_template_type_reference -> simple_type_identifier, tkAmpersend, + case 616: // empty_template_type_reference -> simple_type_identifier, tkAmpersend, // template_type_empty_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-3].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 615: // simple_or_template_type_reference -> simple_type_identifier + case 617: // simple_or_template_type_reference -> simple_type_identifier { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 616: // simple_or_template_type_reference -> simple_type_identifier, + case 618: // simple_or_template_type_reference -> simple_type_identifier, // template_type_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-2].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 617: // simple_or_template_type_reference -> simple_type_identifier, tkAmpersend, + case 619: // simple_or_template_type_reference -> simple_type_identifier, tkAmpersend, // template_type_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-3].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 618: // simple_or_template_or_question_type_reference -> + case 620: // simple_or_template_or_question_type_reference -> // simple_or_template_type_reference { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 619: // simple_or_template_or_question_type_reference -> simple_type_question + case 621: // simple_or_template_or_question_type_reference -> simple_type_question { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 620: // optional_array_initializer -> tkRoundOpen, typed_const_list, tkRoundClose + case 622: // optional_array_initializer -> tkRoundOpen, typed_const_list, tkRoundClose { CurrentSemanticValue.stn = new array_const((expression_list)ValueStack[ValueStack.Depth-2].stn, CurrentLocationSpan); } break; - case 622: // new_expr -> tkNew, simple_or_template_type_reference, + case 624: // new_expr -> tkNew, simple_or_template_type_reference, // optional_expr_list_with_bracket { CurrentSemanticValue.ex = new new_expr(ValueStack[ValueStack.Depth-2].td, ValueStack[ValueStack.Depth-1].stn as expression_list, false, null, CurrentLocationSpan); } break; - case 623: // new_expr -> tkNew, simple_or_template_type_reference, tkSquareOpen, + case 625: // new_expr -> tkNew, simple_or_template_type_reference, tkSquareOpen, // optional_expr_list, tkSquareClose, optional_array_initializer { var el = ValueStack[ValueStack.Depth-3].stn as expression_list; @@ -5881,7 +5898,7 @@ public partial class GPPGParser: ShiftReduceParser tkNew, tkClass, tkRoundOpen, list_fields_in_unnamed_object, + case 626: // new_expr -> tkNew, tkClass, tkRoundOpen, list_fields_in_unnamed_object, // tkRoundClose { // sugared node @@ -5896,14 +5913,14 @@ public partial class GPPGParser: ShiftReduceParser identifier, tkAssign, expr_l1 + case 627: // field_in_unnamed_object -> identifier, tkAssign, expr_l1 { if (ValueStack[ValueStack.Depth-1].ex is nil_const) parsertools.AddErrorFromResource("NIL_IN_UNNAMED_OBJECT",CurrentLocationSpan); CurrentSemanticValue.ob = new name_assign_expr(ValueStack[ValueStack.Depth-3].id,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); } break; - case 626: // field_in_unnamed_object -> expr_l1 + case 628: // field_in_unnamed_object -> expr_l1 { ident name = null; var id = ValueStack[ValueStack.Depth-1].ex as ident; @@ -5923,13 +5940,13 @@ public partial class GPPGParser: ShiftReduceParser field_in_unnamed_object + case 629: // list_fields_in_unnamed_object -> field_in_unnamed_object { var l = new name_assign_expr_list(); CurrentSemanticValue.ob = l.Add(ValueStack[ValueStack.Depth-1].ob as name_assign_expr); } break; - case 628: // list_fields_in_unnamed_object -> list_fields_in_unnamed_object, tkComma, + case 630: // list_fields_in_unnamed_object -> list_fields_in_unnamed_object, tkComma, // field_in_unnamed_object { var nel = ValueStack[ValueStack.Depth-3].ob as name_assign_expr_list; @@ -5940,17 +5957,17 @@ public partial class GPPGParser: ShiftReduceParser /* empty */ + case 631: // optional_expr_list_with_bracket -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 630: // optional_expr_list_with_bracket -> tkRoundOpen, optional_expr_list, + case 632: // optional_expr_list_with_bracket -> tkRoundOpen, optional_expr_list, // tkRoundClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 631: // relop_expr -> simple_expr + case 633: // relop_expr -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 632: // relop_expr -> relop_expr, relop, simple_expr + case 634: // relop_expr -> relop_expr, relop, simple_expr { if (ValueStack[ValueStack.Depth-2].op.type == Operators.NotIn) CurrentSemanticValue.ex = new un_expr(new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, Operators.In, CurrentLocationSpan),Operators.LogicalNOT,CurrentLocationSpan); @@ -5958,7 +5975,7 @@ public partial class GPPGParser: ShiftReduceParser relop_expr, relop, new_question_expr + case 635: // relop_expr -> relop_expr, relop, new_question_expr { if (ValueStack[ValueStack.Depth-2].op.type == Operators.NotIn) CurrentSemanticValue.ex = new un_expr(new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, Operators.In, CurrentLocationSpan),Operators.LogicalNOT,CurrentLocationSpan); @@ -5966,26 +5983,26 @@ public partial class GPPGParser: ShiftReduceParser is_type_expr, tkRoundOpen, pattern_out_param_list, tkRoundClose + case 636: // relop_expr -> is_type_expr, tkRoundOpen, pattern_out_param_list, tkRoundClose { var isTypeCheck = ValueStack[ValueStack.Depth-4].ex as typecast_node; var deconstructorPattern = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, isTypeCheck.type_def, null, CurrentLocationSpan); CurrentSemanticValue.ex = new is_pattern_expr(isTypeCheck.expr, deconstructorPattern, CurrentLocationSpan); } break; - case 635: // pattern -> simple_or_template_type_reference, tkRoundOpen, + case 637: // pattern -> simple_or_template_type_reference, tkRoundOpen, // pattern_out_param_list, tkRoundClose { CurrentSemanticValue.stn = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 636: // pattern_optional_var -> simple_or_template_type_reference, tkRoundOpen, + case 638: // pattern_optional_var -> simple_or_template_type_reference, tkRoundOpen, // pattern_out_param_list_optional_var, tkRoundClose { CurrentSemanticValue.stn = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 637: // deconstruction_or_const_pattern -> simple_or_template_type_reference, + case 639: // deconstruction_or_const_pattern -> simple_or_template_type_reference, // tkRoundOpen, // pattern_out_param_list_optional_var, // tkRoundClose @@ -5993,18 +6010,18 @@ public partial class GPPGParser: ShiftReduceParser, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 638: // deconstruction_or_const_pattern -> const_pattern_expr_list + case 640: // deconstruction_or_const_pattern -> const_pattern_expr_list { CurrentSemanticValue.stn = new const_pattern(ValueStack[ValueStack.Depth-1].ob as List, CurrentLocationSpan); } break; - case 639: // const_pattern_expr_list -> const_pattern_expression + case 641: // const_pattern_expr_list -> const_pattern_expression { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn); } break; - case 640: // const_pattern_expr_list -> const_pattern_expr_list, tkComma, + case 642: // const_pattern_expr_list -> const_pattern_expr_list, tkComma, // const_pattern_expression { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -6012,36 +6029,36 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 643: // const_pattern_expression -> literal_or_number { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 642: // const_pattern_expression -> simple_or_template_type_reference + case 644: // const_pattern_expression -> simple_or_template_type_reference { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } break; - case 643: // const_pattern_expression -> tkNil + case 645: // const_pattern_expression -> tkNil { CurrentSemanticValue.stn = new nil_const(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 644: // const_pattern_expression -> sizeof_expr + case 646: // const_pattern_expression -> sizeof_expr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 645: // const_pattern_expression -> typeof_expr + case 647: // const_pattern_expression -> typeof_expr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 646: // collection_pattern -> tkSquareOpen, collection_pattern_expr_list, tkSquareClose + case 648: // collection_pattern -> tkSquareOpen, collection_pattern_expr_list, tkSquareClose { CurrentSemanticValue.stn = new collection_pattern(ValueStack[ValueStack.Depth-2].ob as List, CurrentLocationSpan); } break; - case 647: // collection_pattern_expr_list -> collection_pattern_list_item + case 649: // collection_pattern_expr_list -> collection_pattern_list_item { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 648: // collection_pattern_expr_list -> collection_pattern_expr_list, tkComma, + case 650: // collection_pattern_expr_list -> collection_pattern_expr_list, tkComma, // collection_pattern_list_item { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -6049,108 +6066,108 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 651: // collection_pattern_list_item -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 650: // collection_pattern_list_item -> collection_pattern_var_item + case 652: // collection_pattern_list_item -> collection_pattern_var_item { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 651: // collection_pattern_list_item -> tkUnderscore + case 653: // collection_pattern_list_item -> tkUnderscore { CurrentSemanticValue.stn = new collection_pattern_wild_card(CurrentLocationSpan); } break; - case 652: // collection_pattern_list_item -> pattern_optional_var + case 654: // collection_pattern_list_item -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 653: // collection_pattern_list_item -> collection_pattern + case 655: // collection_pattern_list_item -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 654: // collection_pattern_list_item -> tuple_pattern + case 656: // collection_pattern_list_item -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 655: // collection_pattern_list_item -> tkDotDot + case 657: // collection_pattern_list_item -> tkDotDot { CurrentSemanticValue.stn = new collection_pattern_gap_parameter(CurrentLocationSpan); } break; - case 656: // collection_pattern_var_item -> tkVar, identifier + case 658: // collection_pattern_var_item -> tkVar, identifier { CurrentSemanticValue.stn = new collection_pattern_var_parameter(ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 657: // tuple_pattern -> tkRoundOpen, tuple_pattern_item_list, tkRoundClose + case 659: // tuple_pattern -> tkRoundOpen, tuple_pattern_item_list, tkRoundClose { if ((ValueStack[ValueStack.Depth-2].ob as List).Count>6) parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",CurrentLocationSpan); CurrentSemanticValue.stn = new tuple_pattern(ValueStack[ValueStack.Depth-2].ob as List, CurrentLocationSpan); } break; - case 658: // tuple_pattern_item -> tkUnderscore + case 660: // tuple_pattern_item -> tkUnderscore { CurrentSemanticValue.stn = new tuple_pattern_wild_card(CurrentLocationSpan); } break; - case 659: // tuple_pattern_item -> literal_or_number + case 661: // tuple_pattern_item -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 660: // tuple_pattern_item -> sign, literal_or_number + case 662: // tuple_pattern_item -> sign, literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan), CurrentLocationSpan); } break; - case 661: // tuple_pattern_item -> tkVar, identifier + case 663: // tuple_pattern_item -> tkVar, identifier { CurrentSemanticValue.stn = new tuple_pattern_var_parameter(ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 662: // tuple_pattern_item -> pattern_optional_var + case 664: // tuple_pattern_item -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 663: // tuple_pattern_item -> collection_pattern + case 665: // tuple_pattern_item -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 664: // tuple_pattern_item -> tuple_pattern + case 666: // tuple_pattern_item -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 665: // tuple_pattern_item_list -> tuple_pattern_item + case 667: // tuple_pattern_item_list -> tuple_pattern_item { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 666: // tuple_pattern_item_list -> tuple_pattern_item_list, tkComma, tuple_pattern_item + case 668: // tuple_pattern_item_list -> tuple_pattern_item_list, tkComma, tuple_pattern_item { var list = ValueStack[ValueStack.Depth-3].ob as List; list.Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); CurrentSemanticValue.ob = list; } break; - case 667: // pattern_out_param_list_optional_var -> pattern_out_param_optional_var + case 669: // pattern_out_param_list_optional_var -> pattern_out_param_optional_var { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 668: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, + case 670: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, // tkSemiColon, // pattern_out_param_optional_var { @@ -6159,7 +6176,7 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param_list_optional_var, + case 671: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, // tkComma, // pattern_out_param_optional_var { @@ -6168,13 +6185,13 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param + case 672: // pattern_out_param_list -> pattern_out_param { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 671: // pattern_out_param_list -> pattern_out_param_list, tkSemiColon, + case 673: // pattern_out_param_list -> pattern_out_param_list, tkSemiColon, // pattern_out_param { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -6182,182 +6199,182 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param_list, tkComma, pattern_out_param + case 674: // pattern_out_param_list -> pattern_out_param_list, tkComma, pattern_out_param { var list = ValueStack[ValueStack.Depth-3].ob as List; list.Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); CurrentSemanticValue.ob = list; } break; - case 673: // pattern_out_param -> tkUnderscore + case 675: // pattern_out_param -> tkUnderscore { CurrentSemanticValue.stn = new wild_card_deconstructor_parameter(CurrentLocationSpan); } break; - case 674: // pattern_out_param -> literal_or_number + case 676: // pattern_out_param -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 675: // pattern_out_param -> tkVar, identifier, tkColon, type_ref + case 677: // pattern_out_param -> tkVar, identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, true, CurrentLocationSpan); } break; - case 676: // pattern_out_param -> tkVar, identifier + case 678: // pattern_out_param -> tkVar, identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, true, CurrentLocationSpan); } break; - case 677: // pattern_out_param -> pattern + case 679: // pattern_out_param -> pattern { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 678: // pattern_out_param -> collection_pattern + case 680: // pattern_out_param -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 679: // pattern_out_param -> tuple_pattern + case 681: // pattern_out_param -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 680: // pattern_out_param_optional_var -> tkUnderscore + case 682: // pattern_out_param_optional_var -> tkUnderscore { CurrentSemanticValue.stn = new wild_card_deconstructor_parameter(CurrentLocationSpan); } break; - case 681: // pattern_out_param_optional_var -> literal_or_number + case 683: // pattern_out_param_optional_var -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 682: // pattern_out_param_optional_var -> sign, literal_or_number + case 684: // pattern_out_param_optional_var -> sign, literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan), CurrentLocationSpan); } break; - case 683: // pattern_out_param_optional_var -> identifier, tkColon, type_ref + case 685: // pattern_out_param_optional_var -> identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, false, CurrentLocationSpan); } break; - case 684: // pattern_out_param_optional_var -> identifier + case 686: // pattern_out_param_optional_var -> identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, false, CurrentLocationSpan); } break; - case 685: // pattern_out_param_optional_var -> tkVar, identifier, tkColon, type_ref + case 687: // pattern_out_param_optional_var -> tkVar, identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, true, CurrentLocationSpan); } break; - case 686: // pattern_out_param_optional_var -> tkVar, identifier + case 688: // pattern_out_param_optional_var -> tkVar, identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, true, CurrentLocationSpan); } break; - case 687: // pattern_out_param_optional_var -> pattern_optional_var + case 689: // pattern_out_param_optional_var -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 688: // pattern_out_param_optional_var -> collection_pattern + case 690: // pattern_out_param_optional_var -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 689: // pattern_out_param_optional_var -> tuple_pattern + case 691: // pattern_out_param_optional_var -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 690: // simple_expr_or_nothing -> simple_expr + case 692: // simple_expr_or_nothing -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 691: // simple_expr_or_nothing -> /* empty */ + case 693: // simple_expr_or_nothing -> /* empty */ { CurrentSemanticValue.ex = null; } break; - case 692: // const_expr_or_nothing -> const_expr + case 694: // const_expr_or_nothing -> const_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 693: // const_expr_or_nothing -> /* empty */ + case 695: // const_expr_or_nothing -> /* empty */ { CurrentSemanticValue.ex = null; } break; - case 694: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing + case 696: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 695: // format_expr -> tkColon, simple_expr_or_nothing + case 697: // format_expr -> tkColon, simple_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 696: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing, tkColon, + case 698: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing, tkColon, // simple_expr { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 697: // format_expr -> tkColon, simple_expr_or_nothing, tkColon, simple_expr + case 699: // format_expr -> tkColon, simple_expr_or_nothing, tkColon, simple_expr { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 698: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing + case 700: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 699: // format_const_expr -> tkColon, const_expr_or_nothing + case 701: // format_const_expr -> tkColon, const_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 700: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing, tkColon, + case 702: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing, tkColon, // const_expr { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 701: // format_const_expr -> tkColon, const_expr_or_nothing, tkColon, const_expr + case 703: // format_const_expr -> tkColon, const_expr_or_nothing, tkColon, const_expr { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 702: // relop -> tkEqual + case 704: // relop -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 703: // relop -> tkNotEqual + case 705: // relop -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 704: // relop -> tkLower + case 706: // relop -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 705: // relop -> tkGreater + case 707: // relop -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 706: // relop -> tkLowerEqual + case 708: // relop -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 707: // relop -> tkGreaterEqual + case 709: // relop -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 708: // relop -> tkIn + case 710: // relop -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 709: // relop -> tkNot, tkIn + case 711: // relop -> tkNot, tkIn { if (parsertools.build_tree_for_formatter) CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; @@ -6368,10 +6385,10 @@ public partial class GPPGParser: ShiftReduceParser term1 + case 712: // simple_expr -> term1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 711: // simple_expr -> simple_expr, tkDotDot, term1 + case 713: // simple_expr -> simple_expr, tkDotDot, term1 { if (parsertools.build_tree_for_formatter) CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); @@ -6379,128 +6396,128 @@ public partial class GPPGParser: ShiftReduceParser term + case 714: // term1 -> term { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 713: // term1 -> term1, addop, term + case 715: // term1 -> term1, addop, term { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 714: // term1 -> term1, addop, new_question_expr + case 716: // term1 -> term1, addop, new_question_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 715: // addop -> tkPlus + case 717: // addop -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 716: // addop -> tkMinus + case 718: // addop -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 717: // addop -> tkOr + case 719: // addop -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 718: // addop -> tkXor + case 720: // addop -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 719: // addop -> tkCSharpStyleOr + case 721: // addop -> tkCSharpStyleOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 720: // typecast_op -> tkAs + case 722: // typecast_op -> tkAs { CurrentSemanticValue.ob = op_typecast.as_op; } break; - case 721: // typecast_op -> tkIs + case 723: // typecast_op -> tkIs { CurrentSemanticValue.ob = op_typecast.is_op; } break; - case 722: // as_is_expr -> is_type_expr + case 724: // as_is_expr -> is_type_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 723: // as_is_expr -> as_expr + case 725: // as_is_expr -> as_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 724: // as_expr -> term, tkAs, simple_or_template_type_reference + case 726: // as_expr -> term, tkAs, simple_or_template_type_reference { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.as_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 725: // as_expr -> term, tkAs, array_type + case 727: // as_expr -> term, tkAs, array_type { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.as_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 726: // is_type_expr -> term, tkIs, simple_or_template_type_reference + case 728: // is_type_expr -> term, tkIs, simple_or_template_type_reference { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.is_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 727: // is_type_expr -> term, tkIs, array_type + case 729: // is_type_expr -> term, tkIs, array_type { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.is_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 728: // power_expr -> factor_without_unary_op, tkStarStar, factor + case 730: // power_expr -> factor_without_unary_op, tkStarStar, factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 729: // power_expr -> factor_without_unary_op, tkStarStar, power_expr + case 731: // power_expr -> factor_without_unary_op, tkStarStar, power_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 730: // power_expr -> sign, power_expr + case 732: // power_expr -> sign, power_expr { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 731: // term -> factor + case 733: // term -> factor { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 732: // term -> new_expr + case 734: // term -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 733: // term -> power_expr + case 735: // term -> power_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 734: // term -> term, mulop, factor + case 736: // term -> term, mulop, factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 735: // term -> term, mulop, power_expr + case 737: // term -> term, mulop, power_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 736: // term -> term, mulop, new_question_expr + case 738: // term -> term, mulop, new_question_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 737: // term -> as_is_expr + case 739: // term -> as_is_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 738: // mulop -> tkStar + case 740: // mulop -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 739: // mulop -> tkSlash + case 741: // mulop -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 740: // mulop -> tkDiv + case 742: // mulop -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 741: // mulop -> tkMod + case 743: // mulop -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 742: // mulop -> tkShl + case 744: // mulop -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 743: // mulop -> tkShr + case 745: // mulop -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 744: // mulop -> tkAnd + case 746: // mulop -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 745: // default_expr -> tkDefault, tkRoundOpen, + case 747: // default_expr -> tkDefault, tkRoundOpen, // simple_or_template_or_question_type_reference, tkRoundClose { CurrentSemanticValue.ex = new default_operator(ValueStack[ValueStack.Depth-2].td as named_type_reference, CurrentLocationSpan); } break; - case 746: // tuple -> tkRoundOpen, expr_l1_or_unpacked, tkComma, expr_l1_or_unpacked_list, + case 748: // tuple -> tkRoundOpen, expr_l1_or_unpacked, tkComma, expr_l1_or_unpacked_list, // lambda_type_ref, optional_full_lambda_fp_list, tkRoundClose { if (ValueStack[ValueStack.Depth-6].ex is unpacked_list_of_ident_or_list) @@ -6519,35 +6536,35 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 749: // factor_without_unary_op -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 748: // factor_without_unary_op -> var_reference + case 750: // factor_without_unary_op -> var_reference { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 749: // factor -> tkNil + case 751: // factor -> tkNil { CurrentSemanticValue.ex = new nil_const(); CurrentSemanticValue.ex.source_context = CurrentLocationSpan; } break; - case 750: // factor -> literal_or_number + case 752: // factor -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 751: // factor -> default_expr + case 753: // factor -> default_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 752: // factor -> tkSquareOpen, elem_list, tkSquareClose + case 754: // factor -> tkSquareOpen, elem_list, tkSquareClose { CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 753: // factor -> tkNot, factor + case 755: // factor -> tkNot, factor { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 754: // factor -> sign, factor + case 756: // factor -> sign, factor { if (ValueStack[ValueStack.Depth-2].op.type == Operators.Minus) { @@ -6573,116 +6590,116 @@ public partial class GPPGParser: ShiftReduceParser tkDeref, factor + case 757: // factor -> tkDeref, factor { CurrentSemanticValue.ex = new index(ValueStack[ValueStack.Depth-1].ex, true, CurrentLocationSpan); } break; - case 756: // factor -> var_reference + case 758: // factor -> var_reference { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 757: // factor -> tuple + case 759: // factor -> tuple { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 758: // literal_or_number -> literal + case 760: // literal_or_number -> literal { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 759: // literal_or_number -> unsigned_number + case 761: // literal_or_number -> unsigned_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 760: // var_question_point -> variable, tkQuestionPoint, variable + case 762: // var_question_point -> variable, tkQuestionPoint, variable { CurrentSemanticValue.ex = new dot_question_node(ValueStack[ValueStack.Depth-3].ex as addressed_value,ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 761: // var_question_point -> variable, tkQuestionPoint, var_question_point + case 763: // var_question_point -> variable, tkQuestionPoint, var_question_point { CurrentSemanticValue.ex = new dot_question_node(ValueStack[ValueStack.Depth-3].ex as addressed_value,ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 762: // var_reference -> var_address, variable + case 764: // var_reference -> var_address, variable { CurrentSemanticValue.ex = NewVarReference(ValueStack[ValueStack.Depth-2].stn as get_address, ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); } break; - case 763: // var_reference -> variable + case 765: // var_reference -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 764: // var_reference -> var_question_point + case 766: // var_reference -> var_question_point { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 765: // var_address -> tkAddressOf + case 767: // var_address -> tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(CurrentLocationSpan); } break; - case 766: // var_address -> var_address, tkAddressOf + case 768: // var_address -> var_address, tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(ValueStack[ValueStack.Depth-2].stn as get_address, CurrentLocationSpan); } break; - case 767: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket + case 769: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket { CurrentSemanticValue.stn = new attribute(null, ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as expression_list, CurrentLocationSpan); } break; - case 768: // attribute_variable -> template_type, optional_expr_list_with_bracket + case 770: // attribute_variable -> template_type, optional_expr_list_with_bracket { CurrentSemanticValue.stn = new attribute(null, ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as expression_list, CurrentLocationSpan); } break; - case 769: // dotted_identifier -> identifier + case 771: // dotted_identifier -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 770: // dotted_identifier -> dotted_identifier, tkPoint, identifier_or_keyword + case 772: // dotted_identifier -> dotted_identifier, tkPoint, identifier_or_keyword { if (ValueStack[ValueStack.Depth-3].ex is index) parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-3], "^"); CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 771: // variable_as_type -> dotted_identifier + case 773: // variable_as_type -> dotted_identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex;} break; - case 772: // variable_as_type -> dotted_identifier, template_type_params + case 774: // variable_as_type -> dotted_identifier, template_type_params { CurrentSemanticValue.ex = new ident_with_templateparams(ValueStack[ValueStack.Depth-2].ex as addressed_value, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 773: // variable_or_literal_or_number -> variable + case 775: // variable_or_literal_or_number -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 774: // variable_or_literal_or_number -> literal_or_number + case 776: // variable_or_literal_or_number -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 775: // var_with_init_for_expr_with_let -> tkVar, identifier, tkAssign, expr, + case 777: // var_with_init_for_expr_with_let -> tkVar, identifier, tkAssign, expr, // tkSemiColon { CurrentSemanticValue.stn = new assign(ValueStack[ValueStack.Depth-4].id as addressed_value, ValueStack[ValueStack.Depth-2].ex, Operators.Assignment, CurrentLocationSpan); } break; - case 776: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let + case 778: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 777: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let_list, + case 779: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let_list, // var_with_init_for_expr_with_let { ValueStack[ValueStack.Depth-2].stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 778: // variable -> identifier + case 780: // variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 779: // variable -> operator_name_ident + case 781: // variable -> operator_name_ident { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 780: // variable -> tkInherited, identifier + case 782: // variable -> tkInherited, identifier { CurrentSemanticValue.ex = new inherited_ident(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 781: // variable -> tkRoundOpen, expr, tkRoundClose + case 783: // variable -> tkRoundOpen, expr, tkRoundClose { if (!parsertools.build_tree_for_formatter) { @@ -6692,7 +6709,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, var_with_init_for_expr_with_let_list, expr, + case 784: // variable -> tkRoundOpen, var_with_init_for_expr_with_let_list, expr, // tkRoundClose { if (!parsertools.build_tree_for_formatter) @@ -6703,20 +6720,20 @@ public partial class GPPGParser: ShiftReduceParser sizeof_expr + case 785: // variable -> sizeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 784: // variable -> typeof_expr + case 786: // variable -> typeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 785: // variable -> literal_or_number, tkPoint, identifier_or_keyword + case 787: // variable -> literal_or_number, tkPoint, identifier_or_keyword { if (ValueStack[ValueStack.Depth-3].ex is index) parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-3], "^"); CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 786: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, + case 788: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, // tkSquareClose { var el = ValueStack[ValueStack.Depth-2].stn as expression_list; // SSM 10/03/16 @@ -6762,7 +6779,7 @@ public partial class GPPGParser: ShiftReduceParser variable_or_literal_or_number, tkQuestionSquareOpen, format_expr, + case 789: // variable -> variable_or_literal_or_number, tkQuestionSquareOpen, format_expr, // tkSquareClose { var fe = ValueStack[ValueStack.Depth-2].ex as format_expr; // SSM 9/01/17 @@ -6776,80 +6793,80 @@ public partial class GPPGParser: ShiftReduceParser tkVertParen, elem_list, tkVertParen + case 790: // variable -> tkVertParen, elem_list, tkVertParen { CurrentSemanticValue.ex = new array_const_new(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 789: // variable -> variable, tkRoundOpen, optional_expr_list, tkRoundClose + case 791: // variable -> variable, tkRoundOpen, optional_expr_list, tkRoundClose { if (ValueStack[ValueStack.Depth-4].ex is index) parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-4], "^"); CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-4].ex as addressed_value,ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 790: // variable -> variable, tkPoint, identifier_keyword_operatorname + case 792: // variable -> variable, tkPoint, identifier_keyword_operatorname { if (ValueStack[ValueStack.Depth-3].ex is index) parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-3], "^"); CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 791: // variable -> tuple, tkPoint, identifier_keyword_operatorname + case 793: // variable -> tuple, tkPoint, identifier_keyword_operatorname { CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 792: // variable -> variable, tkDeref + case 794: // variable -> variable, tkDeref { CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-2].ex as addressed_value,CurrentLocationSpan); } break; - case 793: // variable -> variable, tkAmpersend, template_type_params + case 795: // variable -> variable, tkAmpersend, template_type_params { CurrentSemanticValue.ex = new ident_with_templateparams(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 794: // optional_expr_list -> expr_list + case 796: // optional_expr_list -> expr_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 795: // optional_expr_list -> /* empty */ + case 797: // optional_expr_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 796: // elem_list -> elem_list1 + case 798: // elem_list -> elem_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 797: // elem_list -> /* empty */ + case 799: // elem_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 798: // elem_list1 -> elem + case 800: // elem_list1 -> elem { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 799: // elem_list1 -> elem_list1, tkComma, elem + case 801: // elem_list1 -> elem_list1, tkComma, elem { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 800: // elem -> expr + case 802: // elem -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 801: // elem -> expr, tkDotDot, expr + case 803: // elem -> expr, tkDotDot, expr { CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 802: // one_literal -> tkStringLiteral + case 804: // one_literal -> tkStringLiteral { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 803: // one_literal -> tkAsciiChar + case 805: // one_literal -> tkAsciiChar { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 804: // literal -> literal_list + case 806: // literal -> literal_list { CurrentSemanticValue.ex = NewLiteral(ValueStack[ValueStack.Depth-1].stn as literal_const_line); } break; - case 805: // literal -> tkFormatStringLiteral + case 807: // literal -> tkFormatStringLiteral { if (parsertools.build_tree_for_formatter) { @@ -6861,12 +6878,12 @@ public partial class GPPGParser: ShiftReduceParser one_literal + case 808: // literal_list -> one_literal { CurrentSemanticValue.stn = new literal_const_line(ValueStack[ValueStack.Depth-1].ex as literal, CurrentLocationSpan); } break; - case 807: // literal_list -> literal_list, one_literal + case 809: // literal_list -> literal_list, one_literal { var line = ValueStack[ValueStack.Depth-2].stn as literal_const_line; if (line.literals.Last() is string_const && ValueStack[ValueStack.Depth-1].ex is string_const) @@ -6874,478 +6891,481 @@ public partial class GPPGParser: ShiftReduceParser tkOperator, overload_operator + case 810: // operator_name_ident -> tkOperator, overload_operator { CurrentSemanticValue.ex = new operator_name_ident((ValueStack[ValueStack.Depth-1].op as op_type_node).text, (ValueStack[ValueStack.Depth-1].op as op_type_node).type, CurrentLocationSpan); } break; - case 809: // optional_method_modificators -> tkSemiColon + case 811: // optional_method_modificators -> tkSemiColon { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 810: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon + case 812: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon { //parsertools.AddModifier((procedure_attributes_list)$2, proc_attribute.attr_overload); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 811: // optional_method_modificators1 -> /* empty */ + case 813: // optional_method_modificators1 -> /* empty */ { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 812: // optional_method_modificators1 -> tkSemiColon, meth_modificators + case 814: // optional_method_modificators1 -> tkSemiColon, meth_modificators { //parsertools.AddModifier((procedure_attributes_list)$2, proc_attribute.attr_overload); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 813: // meth_modificators -> meth_modificator + case 815: // meth_modificators -> meth_modificator { CurrentSemanticValue.stn = new procedure_attributes_list(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 814: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator + case 816: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as procedure_attributes_list).Add(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 815: // identifier -> tkIdentifier + case 817: // identifier -> tkIdentifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 816: // identifier -> property_specifier_directives + case 818: // identifier -> property_specifier_directives { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 817: // identifier -> non_reserved + case 819: // identifier -> non_reserved { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 818: // identifier -> tkStep + case 820: // identifier -> tkStep { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 819: // identifier_or_keyword -> identifier + case 821: // identifier -> tkIndex { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 820: // identifier_or_keyword -> keyword -{ CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } - break; - case 821: // identifier_or_keyword -> reserved_keyword -{ CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } - break; - case 822: // identifier_keyword_operatorname -> identifier + case 822: // identifier_or_keyword -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 823: // identifier_keyword_operatorname -> keyword + case 823: // identifier_or_keyword -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 824: // identifier_keyword_operatorname -> operator_name_ident + case 824: // identifier_or_keyword -> reserved_keyword +{ CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } + break; + case 825: // identifier_keyword_operatorname -> identifier +{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } + break; + case 826: // identifier_keyword_operatorname -> keyword +{ CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } + break; + case 827: // identifier_keyword_operatorname -> operator_name_ident { CurrentSemanticValue.id = (ident)ValueStack[ValueStack.Depth-1].ex; } break; - case 825: // meth_modificator -> tkAbstract + case 828: // meth_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 826: // meth_modificator -> tkOverload + case 829: // meth_modificator -> tkOverload { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; parsertools.AddWarningFromResource("OVERLOAD_IS_NOT_USED", ValueStack[ValueStack.Depth-1].id.source_context); } break; - case 827: // meth_modificator -> tkReintroduce + case 830: // meth_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 828: // meth_modificator -> tkOverride + case 831: // meth_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 829: // meth_modificator -> tkExtensionMethod + case 832: // meth_modificator -> tkExtensionMethod { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 830: // meth_modificator -> tkVirtual + case 833: // meth_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 831: // property_modificator -> tkVirtual + case 834: // property_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 832: // property_modificator -> tkOverride + case 835: // property_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 833: // property_modificator -> tkAbstract + case 836: // property_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 834: // property_modificator -> tkReintroduce + case 837: // property_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 835: // property_specifier_directives -> tkRead + case 838: // property_specifier_directives -> tkRead { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 836: // property_specifier_directives -> tkWrite + case 839: // property_specifier_directives -> tkWrite { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 837: // non_reserved -> tkName + case 840: // non_reserved -> tkName { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 838: // non_reserved -> tkNew + case 841: // non_reserved -> tkNew { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 839: // visibility_specifier -> tkInternal + case 842: // visibility_specifier -> tkInternal { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 840: // visibility_specifier -> tkPublic + case 843: // visibility_specifier -> tkPublic { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 841: // visibility_specifier -> tkProtected + case 844: // visibility_specifier -> tkProtected { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 842: // visibility_specifier -> tkPrivate + case 845: // visibility_specifier -> tkPrivate { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 843: // keyword -> visibility_specifier + case 846: // keyword -> visibility_specifier { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 844: // keyword -> tkSealed + case 847: // keyword -> tkSealed { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 845: // keyword -> tkTemplate + case 848: // keyword -> tkTemplate { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 846: // keyword -> tkOr + case 849: // keyword -> tkOr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 847: // keyword -> tkTypeOf + case 850: // keyword -> tkTypeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 848: // keyword -> tkSizeOf + case 851: // keyword -> tkSizeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 849: // keyword -> tkDefault + case 852: // keyword -> tkDefault { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 850: // keyword -> tkWhere + case 853: // keyword -> tkWhere { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 851: // keyword -> tkXor + case 854: // keyword -> tkXor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 852: // keyword -> tkAnd + case 855: // keyword -> tkAnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 853: // keyword -> tkDiv + case 856: // keyword -> tkDiv { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 854: // keyword -> tkMod + case 857: // keyword -> tkMod { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 855: // keyword -> tkShl + case 858: // keyword -> tkShl { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 856: // keyword -> tkShr + case 859: // keyword -> tkShr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 857: // keyword -> tkNot + case 860: // keyword -> tkNot { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 858: // keyword -> tkAs + case 861: // keyword -> tkAs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 859: // keyword -> tkIn + case 862: // keyword -> tkIn { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 860: // keyword -> tkIs + case 863: // keyword -> tkIs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 861: // keyword -> tkArray + case 864: // keyword -> tkArray { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 862: // keyword -> tkSequence + case 865: // keyword -> tkSequence { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 863: // keyword -> tkBegin + case 866: // keyword -> tkBegin { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 864: // keyword -> tkCase + case 867: // keyword -> tkCase { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 865: // keyword -> tkClass + case 868: // keyword -> tkClass { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 866: // keyword -> tkConst + case 869: // keyword -> tkConst { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 867: // keyword -> tkConstructor + case 870: // keyword -> tkConstructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 868: // keyword -> tkDestructor + case 871: // keyword -> tkDestructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 869: // keyword -> tkDownto + case 872: // keyword -> tkDownto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 870: // keyword -> tkDo + case 873: // keyword -> tkDo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 871: // keyword -> tkElse + case 874: // keyword -> tkElse { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 872: // keyword -> tkEnd + case 875: // keyword -> tkEnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 873: // keyword -> tkExcept + case 876: // keyword -> tkExcept { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 874: // keyword -> tkFile + case 877: // keyword -> tkFile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 875: // keyword -> tkAuto + case 878: // keyword -> tkAuto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 876: // keyword -> tkFinalization + case 879: // keyword -> tkFinalization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 877: // keyword -> tkFinally + case 880: // keyword -> tkFinally { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 878: // keyword -> tkFor + case 881: // keyword -> tkFor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 879: // keyword -> tkForeach + case 882: // keyword -> tkForeach { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 880: // keyword -> tkFunction + case 883: // keyword -> tkFunction { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 881: // keyword -> tkIf + case 884: // keyword -> tkIf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 882: // keyword -> tkImplementation + case 885: // keyword -> tkImplementation { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 883: // keyword -> tkInherited + case 886: // keyword -> tkInherited { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 884: // keyword -> tkInitialization + case 887: // keyword -> tkInitialization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 885: // keyword -> tkInterface + case 888: // keyword -> tkInterface { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 886: // keyword -> tkProcedure + case 889: // keyword -> tkProcedure { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 887: // keyword -> tkProperty + case 890: // keyword -> tkProperty { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 888: // keyword -> tkRaise + case 891: // keyword -> tkRaise { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 889: // keyword -> tkRecord + case 892: // keyword -> tkRecord { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 890: // keyword -> tkRepeat + case 893: // keyword -> tkRepeat { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 891: // keyword -> tkSet + case 894: // keyword -> tkSet { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 892: // keyword -> tkTry + case 895: // keyword -> tkTry { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 893: // keyword -> tkType + case 896: // keyword -> tkType { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 894: // keyword -> tkStatic + case 897: // keyword -> tkStatic { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 895: // keyword -> tkThen + case 898: // keyword -> tkThen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 896: // keyword -> tkTo + case 899: // keyword -> tkTo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 897: // keyword -> tkUntil + case 900: // keyword -> tkUntil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 898: // keyword -> tkUses + case 901: // keyword -> tkUses { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 899: // keyword -> tkVar + case 902: // keyword -> tkVar { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 900: // keyword -> tkWhile + case 903: // keyword -> tkWhile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 901: // keyword -> tkWith + case 904: // keyword -> tkWith { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 902: // keyword -> tkNil + case 905: // keyword -> tkNil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 903: // keyword -> tkGoto + case 906: // keyword -> tkGoto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 904: // keyword -> tkOf + case 907: // keyword -> tkOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 905: // keyword -> tkLabel + case 908: // keyword -> tkLabel { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 906: // keyword -> tkProgram + case 909: // keyword -> tkProgram { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 907: // keyword -> tkUnit + case 910: // keyword -> tkUnit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 908: // keyword -> tkLibrary + case 911: // keyword -> tkLibrary { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 909: // keyword -> tkNamespace + case 912: // keyword -> tkNamespace { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 910: // keyword -> tkExternal + case 913: // keyword -> tkExternal { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 911: // keyword -> tkParams + case 914: // keyword -> tkParams { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 912: // keyword -> tkEvent + case 915: // keyword -> tkEvent { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 913: // keyword -> tkYield + case 916: // keyword -> tkYield { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 914: // keyword -> tkMatch + case 917: // keyword -> tkMatch { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 915: // keyword -> tkWhen + case 918: // keyword -> tkWhen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 916: // keyword -> tkPartial + case 919: // keyword -> tkPartial { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 917: // keyword -> tkAbstract + case 920: // keyword -> tkAbstract { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 918: // keyword -> tkLock + case 921: // keyword -> tkLock { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 919: // keyword -> tkImplicit + case 922: // keyword -> tkImplicit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 920: // keyword -> tkExplicit + case 923: // keyword -> tkExplicit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 921: // keyword -> tkOn + case 924: // keyword -> tkOn { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 922: // keyword -> tkVirtual + case 925: // keyword -> tkVirtual { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 923: // keyword -> tkOverride + case 926: // keyword -> tkOverride { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 924: // keyword -> tkLoop + case 927: // keyword -> tkLoop { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 925: // keyword -> tkExtensionMethod + case 928: // keyword -> tkExtensionMethod { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 926: // keyword -> tkOverload + case 929: // keyword -> tkOverload { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 927: // keyword -> tkReintroduce + case 930: // keyword -> tkReintroduce { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 928: // keyword -> tkForward + case 931: // keyword -> tkForward { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 929: // reserved_keyword -> tkOperator + case 932: // reserved_keyword -> tkOperator { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 930: // overload_operator -> tkMinus + case 933: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 931: // overload_operator -> tkPlus + case 934: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 932: // overload_operator -> tkSlash + case 935: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 933: // overload_operator -> tkStar + case 936: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 934: // overload_operator -> tkEqual + case 937: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 935: // overload_operator -> tkGreater + case 938: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 936: // overload_operator -> tkGreaterEqual + case 939: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 937: // overload_operator -> tkLower + case 940: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 938: // overload_operator -> tkLowerEqual + case 941: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 939: // overload_operator -> tkNotEqual + case 942: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 940: // overload_operator -> tkOr + case 943: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 941: // overload_operator -> tkXor + case 944: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 942: // overload_operator -> tkAnd + case 945: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 943: // overload_operator -> tkDiv + case 946: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 944: // overload_operator -> tkMod + case 947: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 945: // overload_operator -> tkShl + case 948: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 946: // overload_operator -> tkShr + case 949: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 947: // overload_operator -> tkNot + case 950: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 948: // overload_operator -> tkIn + case 951: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 949: // overload_operator -> tkImplicit + case 952: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 950: // overload_operator -> tkExplicit + case 953: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 951: // overload_operator -> assign_operator + case 954: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 952: // overload_operator -> tkStarStar + case 955: // overload_operator -> tkStarStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 953: // assign_operator -> tkAssign + case 956: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 954: // assign_operator -> tkPlusEqual + case 957: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 955: // assign_operator -> tkMinusEqual + case 958: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 956: // assign_operator -> tkMultEqual + case 959: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 957: // assign_operator -> tkDivEqual + case 960: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 958: // lambda_unpacked_params -> tkBackSlashRoundOpen, + case 961: // lambda_unpacked_params -> tkBackSlashRoundOpen, // lambda_list_of_unpacked_params_or_id, tkComma, // lambda_unpacked_params_or_id, tkRoundClose { @@ -7354,24 +7374,24 @@ public partial class GPPGParser: ShiftReduceParser lambda_unpacked_params + case 962: // lambda_unpacked_params_or_id -> lambda_unpacked_params { CurrentSemanticValue.ob = new ident_or_list(ValueStack[ValueStack.Depth-1].ex as unpacked_list_of_ident_or_list); } break; - case 960: // lambda_unpacked_params_or_id -> identifier + case 963: // lambda_unpacked_params_or_id -> identifier { CurrentSemanticValue.ob = new ident_or_list(ValueStack[ValueStack.Depth-1].id as ident); } break; - case 961: // lambda_list_of_unpacked_params_or_id -> lambda_unpacked_params_or_id + case 964: // lambda_list_of_unpacked_params_or_id -> lambda_unpacked_params_or_id { CurrentSemanticValue.ob = new unpacked_list_of_ident_or_list(); (CurrentSemanticValue.ob as unpacked_list_of_ident_or_list).Add(ValueStack[ValueStack.Depth-1].ob as ident_or_list); (CurrentSemanticValue.ob as unpacked_list_of_ident_or_list).source_context = LocationStack[LocationStack.Depth-1]; } break; - case 962: // lambda_list_of_unpacked_params_or_id -> lambda_list_of_unpacked_params_or_id, + case 965: // lambda_list_of_unpacked_params_or_id -> lambda_list_of_unpacked_params_or_id, // tkComma, lambda_unpacked_params_or_id { CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-3].ob; @@ -7379,24 +7399,24 @@ public partial class GPPGParser: ShiftReduceParser expr_l1 + case 966: // expr_l1_or_unpacked -> expr_l1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 964: // expr_l1_or_unpacked -> lambda_unpacked_params + case 967: // expr_l1_or_unpacked -> lambda_unpacked_params { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 965: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked + case 968: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 966: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked_list, tkComma, + case 969: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked_list, tkComma, // expr_l1_or_unpacked { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 967: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 970: // func_decl_lambda -> identifier, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]); var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]); @@ -7407,7 +7427,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 971: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, // tkArrow, lambda_function_body { // пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ lambda_inferred_type, пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅ null! @@ -7417,7 +7437,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 972: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-7].id, LocationStack[LocationStack.Depth-7]); @@ -7429,7 +7449,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 973: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -7443,7 +7463,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 974: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -7458,7 +7478,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1_or_unpacked, tkComma, + case 975: // func_decl_lambda -> tkRoundOpen, expr_l1_or_unpacked, tkComma, // expr_l1_or_unpacked_list, lambda_type_ref, // optional_full_lambda_fp_list, tkRoundClose, rem_lambda { @@ -7568,7 +7588,7 @@ public partial class GPPGParser: ShiftReduceParser lambda_unpacked_params, rem_lambda + case 976: // func_decl_lambda -> lambda_unpacked_params, rem_lambda { var pair = ValueStack[ValueStack.Depth-1].ob as pair_type_stlist; // пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ - null. пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ @@ -7580,62 +7600,62 @@ public partial class GPPGParser: ShiftReduceParser expl_func_decl_lambda + case 977: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 975: // optional_full_lambda_fp_list -> /* empty */ + case 978: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 976: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 979: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 977: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 980: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body { CurrentSemanticValue.ob = new pair_type_stlist(ValueStack[ValueStack.Depth-3].td,ValueStack[ValueStack.Depth-1].stn as statement_list); } break; - case 978: // expl_func_decl_lambda -> tkFunction, lambda_type_ref_noproctype, tkArrow, + case 981: // expl_func_decl_lambda -> tkFunction, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 979: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, + case 982: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 980: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 983: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 981: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 984: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 982: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 985: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, // lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 983: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 986: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, tkArrow, lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), ValueStack[ValueStack.Depth-4].stn as formal_parameters, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 984: // full_lambda_fp_list -> lambda_simple_fp_sect + case 987: // full_lambda_fp_list -> lambda_simple_fp_sect { var typed_pars = ValueStack[ValueStack.Depth-1].stn as typed_parameters; if (typed_pars.vars_type is lambda_inferred_type) @@ -7655,102 +7675,102 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 988: // full_lambda_fp_list -> full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect { CurrentSemanticValue.stn =(ValueStack[ValueStack.Depth-3].stn as formal_parameters).Add(ValueStack[ValueStack.Depth-1].stn as typed_parameters, CurrentLocationSpan); } break; - case 986: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 989: // lambda_simple_fp_sect -> ident_list, lambda_type_ref { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-2].stn as ident_list, ValueStack[ValueStack.Depth-1].td, parametr_kind.none, null, CurrentLocationSpan); } break; - case 987: // lambda_type_ref -> /* empty */ + case 990: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 988: // lambda_type_ref -> tkColon, fptype + case 991: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 989: // lambda_type_ref_noproctype -> /* empty */ + case 992: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 990: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 993: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 991: // common_lambda_body -> compound_stmt + case 994: // common_lambda_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 992: // common_lambda_body -> if_stmt + case 995: // common_lambda_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 993: // common_lambda_body -> while_stmt + case 996: // common_lambda_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 994: // common_lambda_body -> repeat_stmt + case 997: // common_lambda_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 995: // common_lambda_body -> for_stmt + case 998: // common_lambda_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 996: // common_lambda_body -> foreach_stmt + case 999: // common_lambda_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 997: // common_lambda_body -> loop_stmt + case 1000: // common_lambda_body -> loop_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 998: // common_lambda_body -> case_stmt + case 1001: // common_lambda_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 999: // common_lambda_body -> try_stmt + case 1002: // common_lambda_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1000: // common_lambda_body -> lock_stmt + case 1003: // common_lambda_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1001: // common_lambda_body -> raise_stmt + case 1004: // common_lambda_body -> raise_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1002: // common_lambda_body -> yield_stmt + case 1005: // common_lambda_body -> yield_stmt { parsertools.AddErrorFromResource("YIELD_STATEMENT_CANNOT_BE_USED_IN_LAMBDA_BODY", CurrentLocationSpan); } break; - case 1003: // common_lambda_body -> tkRoundOpen, assignment, tkRoundClose + case 1006: // common_lambda_body -> tkRoundOpen, assignment, tkRoundClose { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-2].stn as statement, CurrentLocationSpan); } break; - case 1004: // lambda_function_body -> expr_l1_for_lambda + case 1007: // lambda_function_body -> expr_l1_for_lambda { var id = SyntaxVisitors.HasNameVisitor.HasName(ValueStack[ValueStack.Depth-1].ex, "Result"); if (id != null) @@ -7762,22 +7782,22 @@ public partial class GPPGParser: ShiftReduceParser common_lambda_body + case 1008: // lambda_function_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 1006: // lambda_procedure_body -> proc_call + case 1009: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1007: // lambda_procedure_body -> assignment + case 1010: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1008: // lambda_procedure_body -> common_lambda_body + case 1011: // lambda_procedure_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } diff --git a/Parsers/PascalABCParserNewSaushkin/Keywords.cs b/Parsers/PascalABCParserNewSaushkin/Keywords.cs index 63d599d95..e504a835f 100644 --- a/Parsers/PascalABCParserNewSaushkin/Keywords.cs +++ b/Parsers/PascalABCParserNewSaushkin/Keywords.cs @@ -146,6 +146,7 @@ namespace GPPGParserScanner keywords.Add(Convert("namespace"), (int)Tokens.tkNamespace); keywords.Add(Convert("static"), (int)Tokens.tkStatic); keywords.Add(Convert("step"), (int)Tokens.tkStep); + keywords.Add(Convert("index"), (int)Tokens.tkIndex); } static Keywords() diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 765bb2d3a..63d955009 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -356,5 +356,6 @@ script= + diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 46c40caeb..6ed6ccb1a 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.2.3081 +3.8.2.3085 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index f5ffa4eec..292262020 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.2.3081' +!define VERSION '3.8.2.3085' diff --git a/SyntaxTree/tree/HierarchyVisitor.cs b/SyntaxTree/tree/HierarchyVisitor.cs index f6f572b83..8335a0d2a 100644 --- a/SyntaxTree/tree/HierarchyVisitor.cs +++ b/SyntaxTree/tree/HierarchyVisitor.cs @@ -3310,6 +3310,7 @@ namespace PascalABCCompiler.SyntaxTree visit(foreach_stmt.type_name); visit(foreach_stmt.in_what); visit(foreach_stmt.stmt); + visit(foreach_stmt.index); post_do_visit(_foreach_stmt); } @@ -4270,6 +4271,7 @@ namespace PascalABCCompiler.SyntaxTree visit(foreach_stmt_formatting.il); visit(foreach_stmt_formatting.in_what); visit(foreach_stmt_formatting.stmt); + visit(foreach_stmt_formatting.index); post_do_visit(_foreach_stmt_formatting); } diff --git a/SyntaxTree/tree/SyntaxTreeStreamReader.cs b/SyntaxTree/tree/SyntaxTreeStreamReader.cs index 20dc0eb10..fe03e07d1 100644 --- a/SyntaxTree/tree/SyntaxTreeStreamReader.cs +++ b/SyntaxTree/tree/SyntaxTreeStreamReader.cs @@ -2729,6 +2729,7 @@ namespace PascalABCCompiler.SyntaxTree _foreach_stmt.type_name = _read_node() as type_definition; _foreach_stmt.in_what = _read_node() as expression; _foreach_stmt.stmt = _read_node() as statement; + _foreach_stmt.index = _read_node() as ident; } @@ -4477,6 +4478,7 @@ namespace PascalABCCompiler.SyntaxTree _foreach_stmt_formatting.il = _read_node() as ident_list; _foreach_stmt_formatting.in_what = _read_node() as expression; _foreach_stmt_formatting.stmt = _read_node() as statement; + _foreach_stmt_formatting.index = _read_node() as ident; } diff --git a/SyntaxTree/tree/SyntaxTreeStreamWriter.cs b/SyntaxTree/tree/SyntaxTreeStreamWriter.cs index 4d9b27874..baac8a166 100644 --- a/SyntaxTree/tree/SyntaxTreeStreamWriter.cs +++ b/SyntaxTree/tree/SyntaxTreeStreamWriter.cs @@ -4019,6 +4019,15 @@ namespace PascalABCCompiler.SyntaxTree bw.Write((byte)1); _foreach_stmt.stmt.visit(this); } + if (_foreach_stmt.index == null) + { + bw.Write((byte)0); + } + else + { + bw.Write((byte)1); + _foreach_stmt.index.visit(this); + } } @@ -7009,6 +7018,15 @@ namespace PascalABCCompiler.SyntaxTree bw.Write((byte)1); _foreach_stmt_formatting.stmt.visit(this); } + if (_foreach_stmt_formatting.index == null) + { + bw.Write((byte)0); + } + else + { + bw.Write((byte)1); + _foreach_stmt_formatting.index.visit(this); + } } diff --git a/SyntaxTree/tree/Tree.cs b/SyntaxTree/tree/Tree.cs index aa615ae5f..3119c44c8 100644 --- a/SyntaxTree/tree/Tree.cs +++ b/SyntaxTree/tree/Tree.cs @@ -30344,24 +30344,26 @@ namespace PascalABCCompiler.SyntaxTree ///

///Конструктор с параметрами. /// - public foreach_stmt(ident _identifier,type_definition _type_name,expression _in_what,statement _stmt) + public foreach_stmt(ident _identifier,type_definition _type_name,expression _in_what,statement _stmt,ident _index) { this._identifier=_identifier; this._type_name=_type_name; this._in_what=_in_what; this._stmt=_stmt; + this._index=_index; FillParentsInDirectChilds(); } /// ///Конструктор с параметрами. /// - public foreach_stmt(ident _identifier,type_definition _type_name,expression _in_what,statement _stmt,SourceContext sc) + public foreach_stmt(ident _identifier,type_definition _type_name,expression _in_what,statement _stmt,ident _index,SourceContext sc) { this._identifier=_identifier; this._type_name=_type_name; this._in_what=_in_what; this._stmt=_stmt; + this._index=_index; source_context = sc; FillParentsInDirectChilds(); } @@ -30369,6 +30371,7 @@ namespace PascalABCCompiler.SyntaxTree protected type_definition _type_name; protected expression _in_what; protected statement _stmt; + protected ident _index; /// /// @@ -30438,6 +30441,23 @@ namespace PascalABCCompiler.SyntaxTree } } + /// + /// + /// + public ident index + { + get + { + return _index; + } + set + { + _index=value; + if (_index != null) + _index.Parent = this; + } + } + /// Создает копию узла public override syntax_tree_node Clone() @@ -30471,6 +30491,11 @@ namespace PascalABCCompiler.SyntaxTree copy.stmt = (statement)stmt.Clone(); copy.stmt.Parent = copy; } + if (index != null) + { + copy.index = (ident)index.Clone(); + copy.index.Parent = copy; + } return copy; } @@ -30493,6 +30518,8 @@ namespace PascalABCCompiler.SyntaxTree in_what.Parent = this; if (stmt != null) stmt.Parent = this; + if (index != null) + index.Parent = this; } /// Заполняет поля Parent во всем поддереве @@ -30504,6 +30531,7 @@ namespace PascalABCCompiler.SyntaxTree type_name?.FillParentsInAllChilds(); in_what?.FillParentsInAllChilds(); stmt?.FillParentsInAllChilds(); + index?.FillParentsInAllChilds(); } /// @@ -30513,7 +30541,7 @@ namespace PascalABCCompiler.SyntaxTree { get { - return 4; + return 5; } } /// @@ -30523,7 +30551,7 @@ namespace PascalABCCompiler.SyntaxTree { get { - return 4; + return 5; } } /// @@ -30545,6 +30573,8 @@ namespace PascalABCCompiler.SyntaxTree return in_what; case 3: return stmt; + case 4: + return index; } return null; } @@ -30566,6 +30596,9 @@ namespace PascalABCCompiler.SyntaxTree case 3: stmt = (statement)value; break; + case 4: + index = (ident)value; + break; } } } @@ -54535,28 +54568,31 @@ namespace PascalABCCompiler.SyntaxTree /// ///Конструктор с параметрами. /// - public foreach_stmt_formatting(ident_list _il,expression _in_what,statement _stmt) + public foreach_stmt_formatting(ident_list _il,expression _in_what,statement _stmt,ident _index) { this._il=_il; this._in_what=_in_what; this._stmt=_stmt; + this._index=_index; FillParentsInDirectChilds(); } /// ///Конструктор с параметрами. /// - public foreach_stmt_formatting(ident_list _il,expression _in_what,statement _stmt,SourceContext sc) + public foreach_stmt_formatting(ident_list _il,expression _in_what,statement _stmt,ident _index,SourceContext sc) { this._il=_il; this._in_what=_in_what; this._stmt=_stmt; + this._index=_index; source_context = sc; FillParentsInDirectChilds(); } protected ident_list _il; protected expression _in_what; protected statement _stmt; + protected ident _index; /// /// @@ -54609,6 +54645,23 @@ namespace PascalABCCompiler.SyntaxTree } } + /// + /// + /// + public ident index + { + get + { + return _index; + } + set + { + _index=value; + if (_index != null) + _index.Parent = this; + } + } + /// Создает копию узла public override syntax_tree_node Clone() @@ -54637,6 +54690,11 @@ namespace PascalABCCompiler.SyntaxTree copy.stmt = (statement)stmt.Clone(); copy.stmt.Parent = copy; } + if (index != null) + { + copy.index = (ident)index.Clone(); + copy.index.Parent = copy; + } return copy; } @@ -54657,6 +54715,8 @@ namespace PascalABCCompiler.SyntaxTree in_what.Parent = this; if (stmt != null) stmt.Parent = this; + if (index != null) + index.Parent = this; } /// Заполняет поля Parent во всем поддереве @@ -54667,6 +54727,7 @@ namespace PascalABCCompiler.SyntaxTree il?.FillParentsInAllChilds(); in_what?.FillParentsInAllChilds(); stmt?.FillParentsInAllChilds(); + index?.FillParentsInAllChilds(); } /// @@ -54676,7 +54737,7 @@ namespace PascalABCCompiler.SyntaxTree { get { - return 3; + return 4; } } /// @@ -54686,7 +54747,7 @@ namespace PascalABCCompiler.SyntaxTree { get { - return 3; + return 4; } } /// @@ -54706,6 +54767,8 @@ namespace PascalABCCompiler.SyntaxTree return in_what; case 2: return stmt; + case 3: + return index; } return null; } @@ -54724,6 +54787,9 @@ namespace PascalABCCompiler.SyntaxTree case 2: stmt = (statement)value; break; + case 3: + index = (ident)value; + break; } } } diff --git a/SyntaxTree/tree/tree.xml b/SyntaxTree/tree/tree.xml index daa9df67b..e0a1b1dc9 100644 --- a/SyntaxTree/tree/tree.xml +++ b/SyntaxTree/tree/tree.xml @@ -1884,6 +1884,7 @@ + @@ -3306,6 +3307,7 @@ + @@ -3888,11 +3890,13 @@ + + diff --git a/SyntaxVisitors/SugarVisitors/LoopDesugarVisitor.cs b/SyntaxVisitors/SugarVisitors/LoopDesugarVisitor.cs index 1322bd6f8..c7cbcceed 100644 --- a/SyntaxVisitors/SugarVisitors/LoopDesugarVisitor.cs +++ b/SyntaxVisitors/SugarVisitors/LoopDesugarVisitor.cs @@ -55,6 +55,8 @@ namespace SyntaxVisitors.SugarVisitors var un = UniqueNumStr(); var a = new ident("#a" + un, fn.initial_value.source_context); var b = new ident("#b" + un, fn.finish_value.source_context); + var oa = new ident("#oa" + un, a.source_context); + var ob = new ident("#ob" + un, b.source_context); var h = new ident("#h" + un, fn.increment_value.source_context); var n = new ident("#n" + un, a.source_context); var i = fn.loop_variable; //new ident(iname, a.source_context); @@ -70,7 +72,19 @@ namespace SyntaxVisitors.SugarVisitors var mcOrdb = new method_call(new dot_node(new ident("PABCSystem"), new ident("Ord")), new expression_list(b), b.source_context); var mcOrda = new method_call(new dot_node(new ident("PABCSystem"), new ident("Ord")), new expression_list(a), a.source_context); - var sub = new bin_expr(mcOrdb, mcOrda, Operators.Minus, b.source_context); + var oavar = new var_statement(oa, mcOrda, oa.source_context); + var obvar = new var_statement(ob, mcOrdb, ob.source_context); + var bexhg0 = new bin_expr(h.TypedClone(), new int32_const(0), Operators.Greater, h.source_context); + var bexhl0 = new bin_expr(h.TypedClone(), new int32_const(0), Operators.Less, h.source_context); + var bexbla = new bin_expr(b.TypedClone(), a.TypedClone(), Operators.Less, b.source_context); + var bexalb = new bin_expr(a.TypedClone(), b.TypedClone(), Operators.Less, a.source_context); + var bexand1 = new bin_expr(bexhg0, bexbla, Operators.LogicalAND, h.source_context); + var bexand2 = new bin_expr(bexhl0, bexalb, Operators.LogicalAND, h.source_context); + var bexor = new bin_expr(bexand1, bexand2, Operators.LogicalOR, h.source_context); + var assn0 = new assign(n.TypedClone(), new int32_const(0), Operators.Assignment, n.source_context); + var ifn = new if_node(bexor, assn0, null, bexor.source_context); + + var sub = new bin_expr(ob.TypedClone(), oa.TypedClone(), Operators.Minus, b.source_context); var div = new bin_expr(sub, h, Operators.IntegerDivision, b.source_context); var nexpr = new bin_expr(div, new int32_const(1), Operators.Plus, b.source_context); var nvar = new var_statement(n, nexpr, n.source_context); @@ -86,7 +100,7 @@ namespace SyntaxVisitors.SugarVisitors var semCheck1 = new semantic_check_sugared_statement_node(typeof(for_node), new List { a,b }, a.source_context); var for_st = new for_node(j, new int32_const(1), n, stlist, fn.statements.source_context); - var mainstlist = new statement_list(avar, bvar, semCheck1, hvar, nvar, ivar, for_st); + var mainstlist = new statement_list(avar, bvar, semCheck1, oavar, obvar, hvar, nvar, ifn, ivar, for_st); mainstlist.source_context = avar.source_context; ReplaceUsingParent(fn, mainstlist); @@ -111,7 +125,11 @@ namespace SyntaxVisitors.SugarVisitors // семантика - b приводится к типу a /* if h = 0 then raise new ZeroStepException; - var n := (Ord(b) - Ord(a)) div h + 1; + var ob := Ord(b); + var oa := Ord(a); + var n := (ob - oa) div h + 1; + if h > 0 and b < a or h < 0 and b > a then + n := 0; var i := a; for var j := 1 to n do begin @@ -135,5 +153,23 @@ namespace SyntaxVisitors.SugarVisitors visit(fn);*/ //} + public override void visit(foreach_stmt fe) + { + if (fe.index != null && !fe.index.name.StartsWith("##")) // Повторно обходить ## не надо - он для семантики + { + var newindex = new ident("##" + fe.index, fe.index.source_context); // нам нужно это имя на семантике для контроля неизменения переменной внутри цикла + var indexvar = new var_statement(fe.index, new int32_const(0), fe.index.source_context); + var IncIndex = new assign(fe.index.TypedClone(), new int32_const(1), Operators.AssignmentAddition); + var forstat = new statement_list(fe.stmt, IncIndex); + var fe2 = new foreach_stmt(fe.identifier, fe.type_name, fe.in_what, forstat, newindex, fe.source_context); + var stat = new statement_list(indexvar,fe2); + ReplaceUsingParent(fe, stat); + ProcessNode(fe2.in_what); + ProcessNode(forstat.list[0]); + } + else DefaultVisit(fe); + } + + } } diff --git a/SyntaxVisitors/YieldVisitors/LoweringYieldSequenceVisitor.cs b/SyntaxVisitors/YieldVisitors/LoweringYieldSequenceVisitor.cs index e2046fa23..afa6a9893 100644 --- a/SyntaxVisitors/YieldVisitors/LoweringYieldSequenceVisitor.cs +++ b/SyntaxVisitors/YieldVisitors/LoweringYieldSequenceVisitor.cs @@ -36,7 +36,7 @@ namespace SyntaxVisitors { var id = NewVarName(); id.source_context = yn.source_context; - var fe = new foreach_stmt(id, new no_type_foreach(), yn.ex, new yield_node(id,yn.source_context),yn.source_context); + var fe = new foreach_stmt(id, new no_type_foreach(), yn.ex, new yield_node(id,yn.source_context),null,yn.source_context); ReplaceStatement(yn, fe); } } diff --git a/TestSuite/for_step1.pas b/TestSuite/for_step1.pas index 642165846..111afd274 100644 --- a/TestSuite/for_step1.pas +++ b/TestSuite/for_step1.pas @@ -15,4 +15,24 @@ begin for var i:=Mon to Sat step 2 do ld.Add(i); Assert(ld.SequenceEqual(Arr(Mon,Wed,Fri))); + + var l1 := new List; + for var i:=1 to 0 step 1 do + l1.Add(i); + Assert(l1.Count = 0); + + var l2 := new List; + for var i:=1 to 0 step 2 do + l2.Add(i); + Assert(l2.Count = 0); + + var l3 := new List; + for var i:=0 to 1 step -1 do + l3.Add(i); + Assert(l3.Count = 0); + + var l4 := new List; + for var i:=0 to 1 step -2 do + l4.Add(i); + Assert(l4.Count = 0); end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs index 4727084d8..6a716aafe 100644 --- a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs +++ b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs @@ -174,7 +174,7 @@ namespace PascalABCCompiler.TreeConverter if (context.is_in_cycle() && !SemanticRules.AllowChangeLoopVariable) { var_definition_node toAsVariable = GetLocalVariableFromAdressExpressionIfPossible(to); - if (toAsVariable != null && context.is_loop_variable(toAsVariable)) + if (toAsVariable != null && context.is_loop_variable(toAsVariable) && _assign.source_context != null) // последнее - обрезает проверку для сгенерированного i += 1 в foreach ... index i AddError(to.location, "CANNOT_ASSIGN_TO_LOOP_VARIABLE"); } { diff --git a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Foreach.cs b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Foreach.cs index 1e1864201..9933b20fe 100644 --- a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Foreach.cs +++ b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Foreach.cs @@ -38,6 +38,15 @@ namespace PascalABCCompiler.TreeConverter var_definition_node foreachVariable; ForeachCheckAndConvert(_foreach_stmt, out foreachCollection, out foreachVariable); + definition_node dnind = null; + var_definition_node vdn = null; + if (_foreach_stmt.index != null && _foreach_stmt.index.name.StartsWith("##")) + { + dnind = context.check_name_node_type(_foreach_stmt.index.name.Remove(0, 2), get_location(_foreach_stmt.index), + general_node_type.variable_node); + vdn = (var_definition_node)dnind; + } + // SSM 29.07.16 - если in_what - одномерный массив, то заменить код foreach на for // if (OptimizeForeachInCase1DArray(_foreach_stmt, foreachCollection)) return; @@ -48,9 +57,13 @@ namespace PascalABCCompiler.TreeConverter context.enter_in_cycle(foreachNode); context.loop_var_stack.Push(foreachVariable); + if (vdn != null) + context.loop_var_stack.Push(vdn); context.enter_code_block_with_bind(); statement_node body = convert_strong(_foreach_stmt.stmt); context.leave_code_block(); + if (vdn != null) + context.loop_var_stack.Pop(); context.loop_var_stack.Pop(); context.leave_cycle(); diff --git a/bin/PascalABCNET.chm b/bin/PascalABCNET.chm index fb3fdbe45..b84dca335 100644 Binary files a/bin/PascalABCNET.chm and b/bin/PascalABCNET.chm differ
function Deserialize(fileName: string): object;
        Десериализует объект из файла
procedure Print(a,b,...);
        Выводит значения a,b,... на экран, после каждого значения выводит пробел
procedure Println(f: Text; a,b,...);
        Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел и переходит на новую строку
procedure Serialize(filename: string; obj: object); +
procedure Serialize(fileName: string; obj: object);
        Сериализует объект в файл (объект должен иметь атрибут [Serializable])
procedure Write(a,b,...);
        Выводит значения a,b,... на экран