This commit is contained in:
Mikhalkovich Stanislav 2021-05-05 23:31:17 +03:00
parent 39e337d645
commit 2eaaa1f6cd
10 changed files with 63 additions and 16 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 = "2892";
public const string Revision = "2896";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=2892
%REVISION%=2896
%MINOR%=8
%MAJOR%=3

View file

@ -1 +1 @@
3.8.0.2892
3.8.0.2896

View file

@ -1 +1 @@
!define VERSION '3.8.0.2892'
!define VERSION '3.8.0.2896'

View file

@ -1362,26 +1362,26 @@ namespace PascalABCCompiler.SyntaxTree
{
}
public var_statement(ident id, type_definition type, expression iv) : this(new var_def_statement(new ident_list(id), type, iv))
public var_statement(ident id, type_definition type, expression iv) : this(new var_def_statement(new ident_list(id, id.source_context), type, iv))
{
}
public var_statement(ident id, type_definition type) : this(new var_def_statement(new ident_list(id), type))
public var_statement(ident id, type_definition type) : this(new var_def_statement(new ident_list(id, id.source_context), type))
{
}
public var_statement(ident id, type_definition type, SourceContext sc) : this(new var_def_statement(new ident_list(id), type, sc))
public var_statement(ident id, type_definition type, SourceContext sc) : this(new var_def_statement(new ident_list(id, id.source_context), type, sc),sc)
{
}
public var_statement(ident id, string type) : this(new var_def_statement(new ident_list(id), new named_type_reference(type)))
public var_statement(ident id, string type) : this(new var_def_statement(new ident_list(id, id.source_context), new named_type_reference(type)))
{
}
public var_statement(ident id, expression iv) : this(new var_def_statement(new ident_list(id), null, iv))
public var_statement(ident id, expression iv) : this(new var_def_statement(new ident_list(id,id.source_context), null, iv))
{
}
public var_statement(ident id, expression iv, SourceContext sc) : this(new var_def_statement(new ident_list(id), null, iv, sc))
public var_statement(ident id, expression iv, SourceContext sc) : this(new var_def_statement(new ident_list(id,id.source_context), null, iv, sc),sc)
{
}

View file

@ -107,10 +107,12 @@ namespace SyntaxVisitors.SugarVisitors
var n = assvartup.idents.idents.Count();
for (var i = 0; i < n; i++)
{
var sc = assvartup.idents.idents[i].source_context;
var a = new var_statement(assvartup.idents.idents[i],
//new dot_node(new ident(tname), new ident("Item" + (i + 1).ToString())),
new semantic_ith_element_of(new ident(tname, assvartup.expr.source_context), new int32_const(i), assvartup.expr.source_context),
assvartup.idents.idents[i].source_context);
//new dot_node(new ident(tname), new ident("Item" + (i + 1).ToString(),sc)),
new semantic_ith_element_of(new ident(tname, assvartup.expr.source_context), new int32_const(i,sc), assvartup.expr.source_context),
sc);
//a.source_context = assvartup.idents.idents[i].source_context;
sl.Add(a);
}
ReplaceStatementUsingParent(assvartup, sl);

View file

@ -554,7 +554,8 @@ begin
n := Abs(n); // foolproof
var L := new List<integer>;
L.Add(1);
L.Add(n);
if n > 1 then
L.Add(n);
if n > 3 then
begin
var k := 2;

View file

@ -3424,6 +3424,12 @@ procedure SerializeObject3D(filename: string; obj: Object3D);
/// Десериализует трёхмерный объект из файла
function DeserializeObject3D(filename: string): Object3D;
/// Отключить стандартные обработчики событий мыши
procedure SystemMouseEventsOff;
/// Включить стандартные обработчики событий мыши
procedure SystemMouseEventsOn;
var
// -----------------------------------------------------
@ -3435,6 +3441,8 @@ var
OnMouseUp: procedure(x, y: real; mousebutton: integer);
/// Событие перемещения мыши. (x,y) - координаты курсора мыши в момент наступления события, mousebutton = 0, если кнопка мыши не нажата, 1, если нажата левая кнопка мыши, и 2, если нажата правая кнопка мыши
OnMouseMove: procedure(x, y: real; mousebutton: integer);
/// Событие вращения колёсика мыши. (x,y) - координаты курсора мыши в момент наступления события, mousebutton = 0, если кнопка мыши не нажата, 1, если нажата левая кнопка мыши, и 2, если нажата правая кнопка мыши; delta<0 - колесо мыши вниз, delta>0 - колесо мыши вверх
OnMouseWheel: procedure(x, y: real; mousebutton,delta: integer);
/// Событие нажатия клавиши
OnKeyDown: procedure(k: Key);
/// Событие отжатия клавиши
@ -4673,6 +4681,19 @@ begin
OnDrawFrame := nil;
end;
var _SystemMouseEventsEnabled := True;
procedure SystemMouseEventsOff;
begin
_SystemMouseEventsEnabled := False;
end;
procedure SystemMouseEventsOn;
begin
_SystemMouseEventsEnabled := True;
end;
type
Graph3DWindow = class(GMainWindow)
@ -4756,6 +4777,8 @@ type
mb := 2;
if Graph3D.OnMouseDown <> nil then
Graph3D.OnMouseDown(p.x, p.y, mb);
if not _SystemMouseEventsEnabled then
e.Handled := True;
end;
procedure SystemOnMouseUp(sender: Object; e: MouseButtonEventArgs);
@ -4768,6 +4791,8 @@ type
mb := 2;
if Graph3D.OnMouseUp <> nil then
Graph3D.OnMouseUp(p.x, p.y, mb);
if not _SystemMouseEventsEnabled then
e.Handled := True;
end;
procedure SystemOnMouseMove(sender: Object; e: MouseEventArgs);
@ -4780,13 +4805,31 @@ type
mb := 2;
if Graph3D.OnMouseMove <> nil then
Graph3D.OnMouseMove(p.x, p.y, mb);
if not _SystemMouseEventsEnabled then
e.Handled := True;
end;
procedure SystemOnMouseWheel(sender: Object; e: MouseWheelEventArgs);
begin
var mb := 0;
var p := e.GetPosition(hvp);
if e.LeftButton = MouseButtonState.Pressed then
mb := 1
else if e.RightButton = MouseButtonState.Pressed then
mb := 2;
if Graph3D.OnMouseWheel <> nil then
Graph3D.OnMouseWheel(p.x, p.y, mb, e.Delta);
if not _SystemMouseEventsEnabled then
e.Handled := True;
end;
procedure InitHandlers; override;
begin
hvp.PreviewMouseDown += (o, e) -> SystemOnMouseDown(o, e);
hvp.PreviewMouseUp += (o, e) -> SystemOnMouseUp(o, e);
hvp.PreviewMouseMove += (o, e) -> SystemOnMouseMove(o, e);
hvp.PreviewMouseWheel += (o, e) -> SystemOnMouseWheel(o, e);
hvp.PreviewKeyDown += (o, e)-> SystemOnKeyDown(o, e);
hvp.PreviewKeyUp += (o, e)-> SystemOnKeyUp(o, e);

View file

@ -21298,7 +21298,7 @@ namespace PascalABCCompiler.TreeConverter
AddError(sem_ex.location, "TUPLE_OR_SEQUENCE_EXPECTED");
var IsTuple = false;
var IsSequence = false;
if (t.FullName.StartsWith("System.Tuple"))
if (t.FullName.StartsWith("System.Tuple") && !(t.IsArray)) // ошибка - не проходит, когда есть System.Tuple[,][] т.е. массив туплов!!!
IsTuple = true;
if (!IsTuple)
{

View file

@ -554,7 +554,8 @@ begin
n := Abs(n); // foolproof
var L := new List<integer>;
L.Add(1);
L.Add(n);
if n > 1 then
L.Add(n);
if n > 3 then
begin
var k := 2;