Skip to content

Commit

Permalink
err 0540 0541 поправил
Browse files Browse the repository at this point in the history
  • Loading branch information
miks1965 committed Jul 8, 2024
1 parent acfce9b commit b086568
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "9";
public const string Build = "0";
public const string Revision = "3500";
public const string Revision = "3502";

public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=3500
%REVISION%=3502
%MINOR%=9
%MAJOR%=3
Binary file modified Localization/DefaultLang.resources
Binary file not shown.
2 changes: 1 addition & 1 deletion Release/pabcversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.0.3500
3.9.0.3502
2 changes: 1 addition & 1 deletion ReleaseGenerators/PascalABCNET_version.nsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!define VERSION '3.9.0.3500'
!define VERSION '3.9.0.3502'
29 changes: 12 additions & 17 deletions TestSuite/CompilationSamples/LightPT.pas
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,21 @@ function ToObjArray(a: sequence of boolean): array of object;
{ Основные процедуры для проверки правильности ввода-вывода }
{=========================================================================}

// Самые часто используемые: CheckInput, CheckOutput, CheckOutputSeq
// Самые часто используемые: CheckOutput
// CheckInput заменено на CheckData

/// Проверить типы вводимых данных
/// Проверить типы вводимых данных. Пользуйтесь CheckData(Input := cInt * 2)
procedure CheckInput(a: array of System.Type);
/// Проверить значения при выводе
/// Проверить значения при выводе. Основной способ проверки
procedure CheckOutput(params arr: array of object);
/// Проверить значения при выводе. Сообщения ColoredMessage гасить. Нужно для повторных вызовов CheckOutput
procedure CheckOutputSilent(params arr: array of object);
/// Проверить значения при выводе
/// Проверить значения при выводе. Основной способ проверки
procedure CheckOutput(a: ObjectList);
/// Проверить значения при выводе. Сообщения ColoredMessage гасить. Нужно для повторных вызовов CheckOutput
procedure CheckOutputSilent(a: ObjectList);

/// Проверить, что данные не вводились
/// Проверить, что данные не вводились. Пользуйтесь CheckData(Empty)
procedure CheckInputIsEmpty;

/// Проверить, что помимо начального ввода других данных не вводилось
Expand Down Expand Up @@ -253,9 +254,11 @@ procedure CheckOutputSeqSilent(a: sequence of boolean);
procedure CheckOutputSeqSilent(a: sequence of object);
/// Проверить последовательность значений при выводе. Не выводить сообщения ColoredMessages
procedure CheckOutputSeqSilent(a: sequence of word);

/// Проверить последовательность значений при выводе. Не выводить сообщения ColoredMessages
procedure CheckOutputSeqSilent(a: ObjectList);


/// Проверить вывод в виде строки
procedure CheckOutputString(str: string);

Expand All @@ -271,17 +274,6 @@ function CompareArrValues(a,lst: array of object): boolean;
/// Сравнить значения с выводом
function CompareValuesWithOutput(params a: array of object): boolean;

// Для совместимости
procedure CheckOutputNew(params arr: array of object);
procedure CheckOutputSeqNew(a: sequence of integer);
procedure CheckOutputSeqNew(a: sequence of real);
procedure CheckOutputSeqNew(a: sequence of string);
procedure CheckOutputSeqNew(a: sequence of char);
procedure CheckOutputSeqNew(a: sequence of boolean);
procedure CheckOutputSeqNew(a: sequence of object);
procedure CheckOutputSeqNew(a: sequence of word);
procedure CheckOutputSeqNew(a: ObjectList);

{============================================================================================}
{ Подпрограммы для проверки начального ввода-вывода, представленного в заготовке задания }
{============================================================================================}
Expand Down Expand Up @@ -559,7 +551,7 @@ procedure GenerateTests<T1,T2,T3>(params a: array of (T1,T2,T3));
procedure ConvertStringsToNumbersInOutputList;
/// Если в OutputList массивы, вытянуть их в единый список
procedure FlattenOutput;
/// Очистить выходной список от пробелов
/// Очистить выходной список от пробелов, возникающих в методах расширения типа a.Print. Очень редко очищать не надо при решении задач на символы с пробелами
procedure ClearOutputListFromSpaces;
/// Отфильтровать в выходном списке только числа
procedure FilterOnlyNumbers;
Expand Down Expand Up @@ -2220,11 +2212,14 @@ procedure CheckOutputAfterInitialSeqSilent(seq: sequence of char); begin Silent
procedure CheckOutputAfterInitialSeqSilent(seq: sequence of object); begin Silent := True; CheckOutputAfterInitialSeq(seq); Silent := False; end;
procedure CheckOutputAfterInitialSeqSilent(seq: ObjectList); begin Silent := True; CheckOutputAfterInitialSeq(seq); Silent := False; end;

var OutputListIsClearedFromSpaces := False;

procedure ClearOutputListFromSpaces;
begin
if OutputListIsClearedFromSpaces then exit;
OutputList := OutputList.Where(s -> (not (s is string)) or ((s as string) <> ' ')).ToList;
OutputList := OutputList.Where(s -> (not (s is char)) or ((char(s)) <> ' ')).ToList;
OutputListIsClearedFromSpaces := True;
end;

procedure FilterOnlyNumbers;
Expand Down
6 changes: 5 additions & 1 deletion TestSuite/CompilationSamples/TasksArr.pas
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,11 @@ procedure CheckTaskT(name: string);
CheckData(Input := Empty);
CheckOutput(ArrGen(10,1,i->i*2).Sum);
end;

'ЗаполнениеСумма3_add': begin
CheckData(Input := |cInt|*1);
var n := Int;
CheckOutput(ArrGen(n,i -> (i+1)*(i+1)).Sum);
end;
// 'Arr_Transf1' 'Arr_Transf1a' 'Arr_Transf2' 'Arr_Transf3' 'Arr_Transf4' 'Arr_Transf5' 'Arr_Transf7' 'Arr_Transf8' 'Arr_Transf9'- задачник
'Arr_Transf6': begin
FilterOnlyNumbersAndBools;
Expand Down
14 changes: 11 additions & 3 deletions TestSuite/CompilationSamples/TasksStr.pas
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ procedure CheckTaskT(name: string);
end;
'CharRange1': begin
CheckData(Input := Empty);
CheckOutput('0'..'9', 'a'..'z', 'а'..'я');
CheckOutput('0'..'9', 'a'..'z', 'А'..'Я');
end;
'CharRange2': begin
CheckData(Input := |cChar|);
Expand Down Expand Up @@ -283,7 +283,7 @@ procedure CheckTaskT(name: string);
end;
'StrSlice2': begin
CheckData(Input := Empty);
CheckOutputSeq(Arr('клад зарыт на юго западе', 'зашифрованное сообщение'));
CheckOutput('клад зарыт на юго западе', 'зашифрованное сообщение');
end;
'StrSlice4': begin
CheckData(Input := Empty);
Expand All @@ -293,6 +293,14 @@ procedure CheckTaskT(name: string);
CheckData(Input := Empty);
CheckOutput('оценка1', 'балл2', 'окно3');
end;
'Str_Number01': begin
CheckData(Input := Empty);
CheckOutput('25', '476', '2296');
end;
'Str_Number02': begin
CheckData(Input := Empty);
CheckOutput(25,476,3.1415,2.8);
end;
'Str_Number03': begin
CheckData(Input := Empty);
CheckOutput(386);
Expand Down Expand Up @@ -326,6 +334,6 @@ initialization
'Pos1','Pos2','Delete1','Delete2','Delete3','Insert1','Insert2',
'StrChange1','StrChange2','StrBorder0','StrBorder1',
'StrSlice1','StrSlice2','StrSlice4',
'Str_Number0','Str_Number03','Str_Number04','Str_Number05','Str_Number06' );
'Str_Number0','Str_Number01','Str_Number02','Str_Number03','Str_Number04','Str_Number05','Str_Number06' );
finalization
end.
18 changes: 9 additions & 9 deletions TestSuite/CompilationSamples/WPF.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
type
TControl = Control;

Panel = Panel;
Grid = Grid;
Panel = System.Windows.Controls.Panel;
Grid = System.Windows.Controls.Grid;
Canvas = System.Windows.Controls.Canvas;
StackPanel = StackPanel;
DockPanel = DockPanel;
WrapPanel = WrapPanel;
StackPanel = System.Windows.Controls.StackPanel;
DockPanel = System.Windows.Controls.DockPanel;
WrapPanel = System.Windows.Controls.WrapPanel;

TPanel = Panel;
TGrid = Grid;
Expand All @@ -39,7 +39,7 @@
TextBox = TextBox;
Slider = Slider;
ComboBox = ComboBox;
TextBlock = TextBlock;
TextBlock = System.Windows.Controls.TextBlock;
Border = System.Windows.Controls.Border;
Rectangle = Rectangle;

Expand Down Expand Up @@ -111,6 +111,8 @@ function EmptyColor: Color := ARGB(0,0,0,0);
function Pnt(x,y: real) := new Point(x,y);
function Rect(x,y,w,h: real) := new System.Windows.Rect(x,y,w,h);

function MainPanel: Panel := MainWindow.Content as Panel;

function CreateDrawing := Drawing.Create;

function operator implicit(n: integer): Thickness; extensionmethod;
Expand Down Expand Up @@ -148,7 +150,6 @@ function operator implicit(name: string): FontFamily; extensionmethod;
Result := new FontFamily(name);
end;


procedure SetPosition(Self: Control; Left,Top: real); extensionmethod;
begin
Canvas.SetLeft(Self,Left);
Expand Down Expand Up @@ -494,8 +495,7 @@ initialization
MainWindow.Left := w/2;
MainWindow.Top := h/2;

var gr := new Grid;
MainWindow.Content := gr;
MainWindow.Content := new WrapPanel;
CurrentParent := MainWindow;
finalization
Application.Run(MainWindow);
Expand Down
2 changes: 1 addition & 1 deletion TestSuite/errors/err0540.pas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//!Только динамический массив может описываться с ключевым словом params
//!Только одномерный динамический массив может описываться с ключевым словом params
procedure pr1(params par1: array[,] of integer);
begin end;

Expand Down
2 changes: 1 addition & 1 deletion TestSuite/errors/err0541.pas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//!Только динамический массив может описываться с ключевым словом params
//!Только одномерный динамический массив может описываться с ключевым словом params
type TClass = class

end;
Expand Down
18 changes: 9 additions & 9 deletions bin/Lib/WPF.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
type
TControl = Control;

Panel = Panel;
Grid = Grid;
Panel = System.Windows.Controls.Panel;
Grid = System.Windows.Controls.Grid;
Canvas = System.Windows.Controls.Canvas;
StackPanel = StackPanel;
DockPanel = DockPanel;
WrapPanel = WrapPanel;
StackPanel = System.Windows.Controls.StackPanel;
DockPanel = System.Windows.Controls.DockPanel;
WrapPanel = System.Windows.Controls.WrapPanel;

TPanel = Panel;
TGrid = Grid;
Expand All @@ -39,7 +39,7 @@
TextBox = TextBox;
Slider = Slider;
ComboBox = ComboBox;
TextBlock = TextBlock;
TextBlock = System.Windows.Controls.TextBlock;
Border = System.Windows.Controls.Border;
Rectangle = Rectangle;

Expand Down Expand Up @@ -111,6 +111,8 @@ function EmptyColor: Color := ARGB(0,0,0,0);
function Pnt(x,y: real) := new Point(x,y);
function Rect(x,y,w,h: real) := new System.Windows.Rect(x,y,w,h);

function MainPanel: Panel := MainWindow.Content as Panel;

function CreateDrawing := Drawing.Create;

function operator implicit(n: integer): Thickness; extensionmethod;
Expand Down Expand Up @@ -148,7 +150,6 @@ function operator implicit(name: string): FontFamily; extensionmethod;
Result := new FontFamily(name);
end;


procedure SetPosition(Self: Control; Left,Top: real); extensionmethod;
begin
Canvas.SetLeft(Self,Left);
Expand Down Expand Up @@ -494,8 +495,7 @@ initialization
MainWindow.Left := w/2;
MainWindow.Top := h/2;

var gr := new Grid;
MainWindow.Content := gr;
MainWindow.Content := new WrapPanel;
CurrentParent := MainWindow;
finalization
Application.Run(MainWindow);
Expand Down

0 comments on commit b086568

Please sign in to comment.