#343 bug fix
This commit is contained in:
parent
ea1be89a80
commit
58f342fdb2
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "2";
|
public const string Minor = "2";
|
||||||
public const string Build = "0";
|
public const string Build = "0";
|
||||||
public const string Revision = "1385";
|
public const string Revision = "1386";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%COREVERSION%=0
|
|
||||||
%REVISION%=1385
|
|
||||||
%MINOR%=2
|
%MINOR%=2
|
||||||
|
%REVISION%=1386
|
||||||
|
%COREVERSION%=0
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.2.0.1385'
|
!define VERSION '3.2.0.1386'
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,18 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
||||||
MarkMethodHasYieldAndCheckSomeErrorsVisitor.New.ProcessNode(root);
|
MarkMethodHasYieldAndCheckSomeErrorsVisitor.New.ProcessNode(root);
|
||||||
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
|
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
|
||||||
|
|
||||||
|
/*#if DEBUG
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz1.txt"));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif*/
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ namespace SyntaxVisitors
|
||||||
if (
|
if (
|
||||||
(object)upperNode != null && (object)(upperNode as dot_node) == null)
|
(object)upperNode != null && (object)(upperNode as dot_node) == null)
|
||||||
{
|
{
|
||||||
Replace(id, _newName);
|
//Replace(id, _newName);
|
||||||
|
// заменяются только строки, а сами идентификаторы как объекты не меняются!
|
||||||
|
id.name = _newName.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -471,6 +471,8 @@ type
|
||||||
///- f.Write(a,b,...)
|
///- f.Write(a,b,...)
|
||||||
/// Выводит значения a,b,... в двоичный файл
|
/// Выводит значения a,b,... в двоичный файл
|
||||||
procedure Write(params vals: array of object);
|
procedure Write(params vals: array of object);
|
||||||
|
/// Устанавливает файловый указатель на начало файла
|
||||||
|
procedure Reset;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Class for typed files
|
// Class for typed files
|
||||||
|
|
@ -1523,7 +1525,11 @@ procedure Sort<T>(l: List<T>; less: (T,T)->boolean);
|
||||||
/// Изменяет порядок элементов в динамическом массиве на противоположный
|
/// Изменяет порядок элементов в динамическом массиве на противоположный
|
||||||
procedure Reverse<T>(a: array of T);
|
procedure Reverse<T>(a: array of T);
|
||||||
/// Изменяет порядок элементов на противоположный в диапазоне динамического массива длины length начиная с индекса index
|
/// Изменяет порядок элементов на противоположный в диапазоне динамического массива длины length начиная с индекса index
|
||||||
procedure Reverse<T>(a: array of T; index,length: integer);
|
procedure Reverse<T>(a: array of T; index,count: integer);
|
||||||
|
/// Изменяет порядок элементов в списке на противоположный
|
||||||
|
procedure Reverse<T>(a: List<T>);
|
||||||
|
/// Изменяет порядок элементов на противоположный в диапазоне списка длины length начиная с индекса index
|
||||||
|
procedure Reverse<T>(a: List<T>; index,count: integer);
|
||||||
/// Перемешивает динамический массив случайным образом
|
/// Перемешивает динамический массив случайным образом
|
||||||
procedure Shuffle<T>(a: array of T);
|
procedure Shuffle<T>(a: array of T);
|
||||||
/// Перемешивает список случайным образом
|
/// Перемешивает список случайным образом
|
||||||
|
|
@ -3247,18 +3253,21 @@ end;
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Операции для List<T>
|
// Операции для List<T>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
///--
|
||||||
function operator+=<T>(a, b: List<T>): List<T>; extensionmethod;
|
function operator+=<T>(a, b: List<T>): List<T>; extensionmethod;
|
||||||
begin
|
begin
|
||||||
a.AddRange(b);
|
a.AddRange(b);
|
||||||
Result := a;
|
Result := a;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
///--
|
||||||
function operator+<T>(a, b: List<T>): List<T>; extensionmethod;
|
function operator+<T>(a, b: List<T>): List<T>; extensionmethod;
|
||||||
begin
|
begin
|
||||||
Result := new List<T>(a);
|
Result := new List<T>(a);
|
||||||
Result.AddRange(b);
|
Result.AddRange(b);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
///--
|
||||||
function operator+=<T>(a: List<T>; x: T): List<T>; extensionmethod;
|
function operator+=<T>(a: List<T>; x: T): List<T>; extensionmethod;
|
||||||
begin
|
begin
|
||||||
a.Add(x);
|
a.Add(x);
|
||||||
|
|
@ -3271,6 +3280,40 @@ begin
|
||||||
Result := Self.Contains(x);
|
Result := Self.Contains(x);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
///--
|
||||||
|
function operator*<T>(a: List<T>; n: integer): List<T>; extensionmethod;
|
||||||
|
begin
|
||||||
|
Result := new List<T>();
|
||||||
|
for var i := 1 to n do
|
||||||
|
Result.AddRange(a);
|
||||||
|
end;
|
||||||
|
|
||||||
|
///--
|
||||||
|
function operator*<T>(n: integer; a: List<T>): List<T>; extensionmethod;
|
||||||
|
begin
|
||||||
|
Result := a*n;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Операции для Stack<T>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
///--
|
||||||
|
function operator+=<T>(s: Stack<T>; x: T): Stack<T>; extensionmethod;
|
||||||
|
begin
|
||||||
|
s.Push(x);
|
||||||
|
Result := s;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Операции для Queue<T>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
///--
|
||||||
|
function operator+=<T>(q: Queue<T>; x: T): Queue<T>; extensionmethod;
|
||||||
|
begin
|
||||||
|
q.Enqueue(x);
|
||||||
|
Result := q;
|
||||||
|
end;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Операции для HashSet<T>
|
// Операции для HashSet<T>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
@ -5197,6 +5240,11 @@ begin
|
||||||
PABCSystem.Write(Self, vals);
|
PABCSystem.Write(Self, vals);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure AbstractBinaryFile.Reset;
|
||||||
|
begin
|
||||||
|
PABCSystem.Reset(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// TypedFile & BinaryFile methods
|
// TypedFile & BinaryFile methods
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
|
|
@ -7072,11 +7120,22 @@ begin
|
||||||
System.Array.Reverse(a);
|
System.Array.Reverse(a);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Reverse<T>(a: array of T; index,length: integer);
|
procedure Reverse<T>(a: array of T; index,count: integer);
|
||||||
begin
|
begin
|
||||||
System.Array.Reverse(a,index,length);
|
System.Array.Reverse(a,index,count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure Reverse<T>(a: List<T>);
|
||||||
|
begin
|
||||||
|
a.Reverse
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure Reverse<T>(a: List<T>; index,count: integer);
|
||||||
|
begin
|
||||||
|
a.Reverse(index,count)
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure Shuffle<T>(a: array of T);
|
procedure Shuffle<T>(a: array of T);
|
||||||
begin
|
begin
|
||||||
var n := a.Length;
|
var n := a.Length;
|
||||||
|
|
|
||||||
16
TestSuite/CompilationSamples/YieldForVar_i_i.pas
Normal file
16
TestSuite/CompilationSamples/YieldForVar_i_i.pas
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
function MatrMainDiag(a: array[,]of integer):sequence of integer;
|
||||||
|
begin
|
||||||
|
for var i:=0 to 10 do
|
||||||
|
yield a[i,i]
|
||||||
|
end;
|
||||||
|
|
||||||
|
function MatrMainDiag1(a: array[,]of integer):sequence of integer;
|
||||||
|
begin
|
||||||
|
for var i:=0 to 10 do
|
||||||
|
yield min(i,i)
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue