Из School убран PrintType - т.к. есть TypeName стандартный

This commit is contained in:
Mikhalkovich Stanislav 2022-04-15 21:20:19 +03:00
parent 4dbbf968c9
commit 674ca7d5cf
9 changed files with 12 additions and 111 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 = "3";
public const string Revision = "3101";
public const string Revision = "3104";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=8
%REVISION%=3101
%COREVERSION%=3
%REVISION%=3104
%MINOR%=8
%MAJOR%=3

View file

@ -1 +1 @@
3.8.3.3101
3.8.3.3104

View file

@ -1 +1 @@
!define VERSION '3.8.3.3101'
!define VERSION '3.8.3.3104'

View file

@ -354,6 +354,8 @@ procedure DrawSector(x, y, r, angle1, angle2: real);
procedure FillSector(x, y, r, angle1, angle2: real);
/// Рисует сектор окружности с центром в точке (x,y) и радиусом r, заключенный между двумя лучами, образующими углы angle1 и angle2 с осью OX, цветом c
procedure Sector(x, y, r, angle1, angle2: real; c: Color);
/// Рисует сектор окружности с центром в точке (x,y) и радиусом r, заключенный между двумя лучами, образующими углы angle1 и angle2 с осью OX, цветом c
procedure Pie(x, y, r, angle1, angle2: real; c: Color);
/// Рисует контур сектора окружности с центром в точке (x,y) и радиусом r, заключенного между двумя лучами, образующими углы angle1 и angle2 с осью OX, цветом c
procedure DrawSector(x, y, r, angle1, angle2: real; c: Color);
/// Рисует внутренность сектора окружности с центром в точке (x,y) и радиусом r, заключенного между двумя лучами, образующими углы angle1 и angle2 с осью OX, цветом c
@ -1391,6 +1393,7 @@ procedure Pie(x, y, r, angle1, angle2: real) := InvokeVisual(SectorP,x, y, r, an
procedure DrawSector(x, y, r, angle1, angle2: real) := InvokeVisual(DrawSectorP,x, y, r, angle1, angle2);
procedure FillSector(x, y, r, angle1, angle2: real) := InvokeVisual(FillSectorP,x, y, r, angle1, angle2);
procedure Sector(x, y, r, angle1, angle2: real; c: GColor) := InvokeVisual(SectorPC,x, y, r, angle1, angle2, c);
procedure Pie(x, y, r, angle1, angle2: real; c: GColor) := InvokeVisual(SectorPC,x, y, r, angle1, angle2, c);
procedure DrawSector(x, y, r, angle1, angle2: real; c: GColor) := InvokeVisual(DrawSectorPC,x, y, r, angle1, angle2, c);
procedure FillSector(x, y, r, angle1, angle2: real; c: GColor) := InvokeVisual(FillSectorPC,x, y, r, angle1, angle2, c);

View file

@ -13169,6 +13169,7 @@ begin
TypeCode.SByte: Result := 'shortint';
TypeCode.Double: Result := 'real';
TypeCode.Single: Result := 'single';
else Result := t.ToString;
end
else if t = typeof(string) then
Result := 'string'

View file

@ -145,12 +145,6 @@ function ReplaceMany(s: string; source, target: IList<string>): string;
/// В строке s меняет местами подстроки ss1 и ss2
procedure SwapSubstr(var s: string; ss1, ss2: string);
/// Выводит тип переменной или выражения
procedure PrintType(o: Object);
/// Выводит тип переменной или выражения, затем переходит к новой строке вывода
procedure PrintlnType(o: Object);
implementation
type
@ -968,53 +962,7 @@ end;
/// В строке s меняет местами подстроки ss1 и ss2
procedure SwapSubstr(var Self: string; ss1, ss2: string);
extensionmethod := SwapSubstr(Self, ss1, ss2);
function InternalConvertTupleString(s: string): string;
begin
var tt := '([\w.`<>\[\],()]+?)';
s := Regex.Replace(s,$'System.Tuple`2\[{tt},{tt}\]','($1,$2)');
s := Regex.Replace(s,$'System.Tuple`3\[{tt},{tt},{tt}\]','($1,$2,$3)');
s := Regex.Replace(s,$'System.Tuple`4\[{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4)');
s := Regex.Replace(s,$'System.Tuple`5\[{tt},{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4,$5)');
s := Regex.Replace(s,$'System.Tuple`6\[{tt},{tt},{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4,$5,$6)');
Result := Regex.Replace(s,$'System.Tuple`7\[{tt},{tt},{tt},{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4,$5,$6,$7)');
end;
function InternalConvertTypeString(s: string): string;
begin
s := s.Replace('System.Int32','integer');
s := s.Replace('System.Int64','int64');
s := s.Replace('System.Double','real');
s := s.Replace('System.String','string');
s := s.Replace('System.Char','char');
s := s.Replace('System.Numerics.BigInteger','BigInteger');
var tt := '([\w.`<>\[\],()]+?)';
s := Regex.Replace(s,$'{tt}\[\]\[\]','array of array of $1');
s := Regex.Replace(s,$'{tt}\[\]','array of $1');
s := Regex.Replace(s,$'{tt}\[,\]','array [,] of $1');
s := Regex.Replace(s,$'System.Collections.Generic.(Dictionary|SortedDictionary)`2\[{tt},{tt}\]','$1<$2,$3>');
s := Regex.Replace(s,$'System.Collections.Generic.(List|Stack|Queue|HashSet|SortedSet)`1\[{tt}\]','$1<$2>');
s := InternalConvertTupleString(s);
s := InternalConvertTupleString(s);
Result := s;
end;
/// Выводит тип переменной или выражения
procedure PrintType(o: Object);
begin
var y := o.GetType.GetInterfaces.Select(i->i.ToString).Where(s->s.StartsWith('System.Collections.Generic.IEnumerable`')).FirstOrDefault;
var s := o.GetType.ToString;
s := InternalConvertTypeString(s);
Print(s);
end;
/// Выводит тип переменной или выражения, затем переходит к новой строке вывода
procedure PrintlnType(o: Object);
begin
PrintType(o);
Println;
end;
extensionmethod := SwapSubstr(Self, ss1, ss2);
/// Возвращает все перестановки букв в строке в виде последовательности строк
function Permutations(Self: string): sequence of string; extensionmethod

View file

@ -13169,6 +13169,7 @@ begin
TypeCode.SByte: Result := 'shortint';
TypeCode.Double: Result := 'real';
TypeCode.Single: Result := 'single';
else Result := t.ToString;
end
else if t = typeof(string) then
Result := 'string'

View file

@ -145,12 +145,6 @@ function ReplaceMany(s: string; source, target: IList<string>): string;
/// В строке s меняет местами подстроки ss1 и ss2
procedure SwapSubstr(var s: string; ss1, ss2: string);
/// Выводит тип переменной или выражения
procedure PrintType(o: Object);
/// Выводит тип переменной или выражения, затем переходит к новой строке вывода
procedure PrintlnType(o: Object);
implementation
type
@ -968,53 +962,7 @@ end;
/// В строке s меняет местами подстроки ss1 и ss2
procedure SwapSubstr(var Self: string; ss1, ss2: string);
extensionmethod := SwapSubstr(Self, ss1, ss2);
function InternalConvertTupleString(s: string): string;
begin
var tt := '([\w.`<>\[\],()]+?)';
s := Regex.Replace(s,$'System.Tuple`2\[{tt},{tt}\]','($1,$2)');
s := Regex.Replace(s,$'System.Tuple`3\[{tt},{tt},{tt}\]','($1,$2,$3)');
s := Regex.Replace(s,$'System.Tuple`4\[{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4)');
s := Regex.Replace(s,$'System.Tuple`5\[{tt},{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4,$5)');
s := Regex.Replace(s,$'System.Tuple`6\[{tt},{tt},{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4,$5,$6)');
Result := Regex.Replace(s,$'System.Tuple`7\[{tt},{tt},{tt},{tt},{tt},{tt},{tt}\]','($1,$2,$3,$4,$5,$6,$7)');
end;
function InternalConvertTypeString(s: string): string;
begin
s := s.Replace('System.Int32','integer');
s := s.Replace('System.Int64','int64');
s := s.Replace('System.Double','real');
s := s.Replace('System.String','string');
s := s.Replace('System.Char','char');
s := s.Replace('System.Numerics.BigInteger','BigInteger');
var tt := '([\w.`<>\[\],()]+?)';
s := Regex.Replace(s,$'{tt}\[\]\[\]','array of array of $1');
s := Regex.Replace(s,$'{tt}\[\]','array of $1');
s := Regex.Replace(s,$'{tt}\[,\]','array [,] of $1');
s := Regex.Replace(s,$'System.Collections.Generic.(Dictionary|SortedDictionary)`2\[{tt},{tt}\]','$1<$2,$3>');
s := Regex.Replace(s,$'System.Collections.Generic.(List|Stack|Queue|HashSet|SortedSet)`1\[{tt}\]','$1<$2>');
s := InternalConvertTupleString(s);
s := InternalConvertTupleString(s);
Result := s;
end;
/// Выводит тип переменной или выражения
procedure PrintType(o: Object);
begin
var y := o.GetType.GetInterfaces.Select(i->i.ToString).Where(s->s.StartsWith('System.Collections.Generic.IEnumerable`')).FirstOrDefault;
var s := o.GetType.ToString;
s := InternalConvertTypeString(s);
Print(s);
end;
/// Выводит тип переменной или выражения, затем переходит к новой строке вывода
procedure PrintlnType(o: Object);
begin
PrintType(o);
Println;
end;
extensionmethod := SwapSubstr(Self, ss1, ss2);
/// Возвращает все перестановки букв в строке в виде последовательности строк
function Permutations(Self: string): sequence of string; extensionmethod