ErrOutput

write(output,1)
This commit is contained in:
Mikhalkovich Stanislav 2021-07-10 10:45:02 +03:00
parent d61b231059
commit f733799b1f
7 changed files with 56 additions and 32 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "8";
public const string Build = "0";
public const string Revision = "2926";
public const string Revision = "2931";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=2926
%MINOR%=8
%REVISION%=2931
%COREVERSION%=0
%MAJOR%=3

View file

@ -1 +1 @@
3.8.0.2926
3.8.0.2931

View file

@ -1 +1 @@
!define VERSION '3.8.0.2926'
!define VERSION '3.8.0.2931'

View file

@ -370,7 +370,7 @@ type
private
fi: FileInfo;
sr: StreamReader;
sw: StreamWriter;
sw: TextWriter;
public
/// Возвращает значение типа integer, введенное из текстового файла
function ReadInteger: integer;
@ -2502,6 +2502,8 @@ var
output: TextFile;
/// Стандартный текстовый файл для ввода. Связывается процедурой Assign с файлом на диске, после чего весь ввод с консоли перенаправляется из этого файла
input: TextFile;
/// Стандартный текстовый файл ошибок. Связывается процедурой Assign с файлом на диске, после чего весь вывод с использованием ErrOutput перенаправляется в этот файл
ErrOutput: TextFile;
/// Определяет текущую систему ввода-вывода
CurrentIOSystem: IOSystem;
/// Принимает значение True, если приложение имеет консольное окно
@ -6807,7 +6809,7 @@ end;
procedure Write(obj: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
write_in_output(obj)
else CurrentIOSystem.Write(obj);
end;
@ -6819,7 +6821,7 @@ end;
procedure Write(obj1, obj2: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
write_in_output(obj1);
write_in_output(obj2);
@ -6834,7 +6836,7 @@ end;
procedure Write(params args: array of object);
begin
for var i := 0 to args.length - 1 do
if output.sw <> nil then
if output.sw is StreamWriter then
write_in_output(args[i])
else
CurrentIOSystem.Write(args[i]);
@ -6842,7 +6844,7 @@ end;
procedure Writeln(obj: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
write_in_output(obj);
writeln_in_output;
@ -6862,7 +6864,7 @@ end;
procedure Writeln(obj1, obj2: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
write_in_output(obj1);
write_in_output(obj2);
@ -6878,14 +6880,14 @@ end;
procedure Writeln;
begin
if output.sw <> nil then
if output.sw is StreamWriter then
writeln_in_output
else CurrentIOSystem.Writeln;
end;
procedure Writeln(params args: array of object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
for var i := 0 to args.length - 1 do
write_in_output(args[i]);
@ -6905,7 +6907,7 @@ end;
procedure Write(f: Text; val: object);
begin
if f.fi = nil then
if (f.fi = nil) and (f<>output) and (f<>ErrOutput) then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if f.sw = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
@ -6934,7 +6936,7 @@ end;
procedure Writeln(f: Text);
begin
if f.fi = nil then
if (f.fi = nil) and (f<>output) and (f<>ErrOutput) then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if f.sw = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
@ -7154,7 +7156,8 @@ begin
end
else
begin
f.sw.BaseStream.Position := 0;
if f.sw is StreamWriter then
(f.sw as StreamWriter).BaseStream.Position := 0;
end;
end;
@ -13982,8 +13985,11 @@ begin
// SSM 10/11/18 восстановил эту строку чтобы в главном потоке в вещественных была точка
System.Threading.Thread.CurrentThread.CurrentCulture := new System.Globalization.CultureInfo('en-US');
output := new TextFile();
input := new TextFile();
output := new TextFile();
output.sw := Console.Out;
ErrOutput := new TextFile();
ErrOutput.sw := Console.Error;
{if (Environment.OSVersion.Platform = PlatformID.Unix) or (Environment.OSVersion.Platform = PlatformID.MacOSX) then
foreach var listener in System.Diagnostics.Trace.Listeners do
@ -14010,7 +14016,7 @@ end;
procedure __FinalizeModule__;
begin
if (output.sw <> nil) and (output.sw.BaseStream <> nil) then
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
output.sw.Close;
if (input.sr <> nil) and (input.sr.BaseStream <> nil) then
input.sr.Close;

View file

@ -901,6 +901,15 @@ namespace PascalABCCompiler.TreeRealization
.Select(t => t.Index)
.ToArray();
// SSM 08/07/21 попытаться вывести нефункциональные параметры первыми
/*for (int i = 0; i < count_params_to_see; ++i)
if (!(fact[i].type is delegated_methods))
{
bool b = DeduceInstanceTypes(formal[i].type, fact[i].type, deduced, nils, generic_params);
b = b;
}*/
for (int i = 0; i < count_params_to_see; ++i)
{
if (alone && fact[i].type is delegated_methods && (fact[i].type as delegated_methods).empty_param_method != null && DeduceInstanceTypes(formal[i].type, (fact[i].type as delegated_methods).empty_param_method.type, deduced, nils, generic_params))
@ -1213,6 +1222,8 @@ namespace PascalABCCompiler.TreeRealization
}
}
// SSM 09.07 - My(f: T->T1) при наличии двух f - следующие 2 else дают пропуск этой ошибки!! Она внесена 10.01 в 20:54 при исправлении 1093
// Видимо, это улучшило ситуацию - просто надо точнее отбрасывать часть fact_funcs
else if (dm != null && dm.proper_methods.Count > 1 && formal_type.original_generic is compiled_type_node && (formal_type.original_generic as compiled_type_node).compiled_type.FullName.StartsWith("System.Func`"))
{
var ctn = formal_type.original_generic as compiled_type_node;
@ -1234,7 +1245,8 @@ namespace PascalABCCompiler.TreeRealization
fact_funcs.Add(fc.simple_function_node);
}
}
}
}
// end SSM 09.07 - конец кода, который был написан раньше IB. Здесь поясняется его влияние на ошибки
for (int j = 0; j < fact_funcs.Count; j++)
{
fact_func = fact_funcs[j];

View file

@ -370,7 +370,7 @@ type
private
fi: FileInfo;
sr: StreamReader;
sw: StreamWriter;
sw: TextWriter;
public
/// Возвращает значение типа integer, введенное из текстового файла
function ReadInteger: integer;
@ -2502,6 +2502,8 @@ var
output: TextFile;
/// Стандартный текстовый файл для ввода. Связывается процедурой Assign с файлом на диске, после чего весь ввод с консоли перенаправляется из этого файла
input: TextFile;
/// Стандартный текстовый файл ошибок. Связывается процедурой Assign с файлом на диске, после чего весь вывод с использованием ErrOutput перенаправляется в этот файл
ErrOutput: TextFile;
/// Определяет текущую систему ввода-вывода
CurrentIOSystem: IOSystem;
/// Принимает значение True, если приложение имеет консольное окно
@ -6807,7 +6809,7 @@ end;
procedure Write(obj: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
write_in_output(obj)
else CurrentIOSystem.Write(obj);
end;
@ -6819,7 +6821,7 @@ end;
procedure Write(obj1, obj2: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
write_in_output(obj1);
write_in_output(obj2);
@ -6834,7 +6836,7 @@ end;
procedure Write(params args: array of object);
begin
for var i := 0 to args.length - 1 do
if output.sw <> nil then
if output.sw is StreamWriter then
write_in_output(args[i])
else
CurrentIOSystem.Write(args[i]);
@ -6842,7 +6844,7 @@ end;
procedure Writeln(obj: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
write_in_output(obj);
writeln_in_output;
@ -6862,7 +6864,7 @@ end;
procedure Writeln(obj1, obj2: object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
write_in_output(obj1);
write_in_output(obj2);
@ -6878,14 +6880,14 @@ end;
procedure Writeln;
begin
if output.sw <> nil then
if output.sw is StreamWriter then
writeln_in_output
else CurrentIOSystem.Writeln;
end;
procedure Writeln(params args: array of object);
begin
if output.sw <> nil then
if output.sw is StreamWriter then
begin
for var i := 0 to args.length - 1 do
write_in_output(args[i]);
@ -6905,7 +6907,7 @@ end;
procedure Write(f: Text; val: object);
begin
if f.fi = nil then
if (f.fi = nil) and (f<>output) and (f<>ErrOutput) then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if f.sw = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
@ -6934,7 +6936,7 @@ end;
procedure Writeln(f: Text);
begin
if f.fi = nil then
if (f.fi = nil) and (f<>output) and (f<>ErrOutput) then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if f.sw = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
@ -7154,7 +7156,8 @@ begin
end
else
begin
f.sw.BaseStream.Position := 0;
if f.sw is StreamWriter then
(f.sw as StreamWriter).BaseStream.Position := 0;
end;
end;
@ -13982,8 +13985,11 @@ begin
// SSM 10/11/18 восстановил эту строку чтобы в главном потоке в вещественных была точка
System.Threading.Thread.CurrentThread.CurrentCulture := new System.Globalization.CultureInfo('en-US');
output := new TextFile();
input := new TextFile();
output := new TextFile();
output.sw := Console.Out;
ErrOutput := new TextFile();
ErrOutput.sw := Console.Error;
{if (Environment.OSVersion.Platform = PlatformID.Unix) or (Environment.OSVersion.Platform = PlatformID.MacOSX) then
foreach var listener in System.Diagnostics.Trace.Listeners do
@ -14010,7 +14016,7 @@ end;
procedure __FinalizeModule__;
begin
if (output.sw <> nil) and (output.sw.BaseStream <> nil) then
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
output.sw.Close;
if (input.sr <> nil) and (input.sr.BaseStream <> nil) then
input.sr.Close;