parent
c4bd28366a
commit
fd2571ba2d
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "4";
|
||||
public const string Build = "2";
|
||||
public const string Revision = "1903";
|
||||
public const string Revision = "1904";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=2
|
||||
%REVISION%=1903
|
||||
%MINOR%=4
|
||||
%REVISION%=1904
|
||||
%COREVERSION%=2
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.4.2.1903'
|
||||
!define VERSION '3.4.2.1904'
|
||||
|
|
|
|||
|
|
@ -1588,6 +1588,11 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
this._IsYieldInStaticMethod = isYieldInStaticMethod;
|
||||
source_context = sc;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return /*""+this.ClassName+" "+this.name+" "+*/this.UnknownID.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public partial class yield_unknown_foreach_type : type_definition
|
||||
|
|
@ -1679,14 +1684,6 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
}
|
||||
|
||||
public partial class yield_unknown_ident
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return this.UnknownID.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public partial class statement
|
||||
{
|
||||
public statement_list ToStatementList()
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
|||
{
|
||||
|
||||
System.IO.File.AppendAllText(@"d:\\zzz4.txt",e.Message);
|
||||
}*/
|
||||
} */
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ namespace SyntaxVisitors
|
|||
Print(""+st);
|
||||
}
|
||||
|
||||
public override void visit(assign ass)
|
||||
{
|
||||
DefaultVisit(ass);
|
||||
}
|
||||
public virtual void Enter(syntax_tree_node st)
|
||||
{
|
||||
if (st is statement_list)
|
||||
|
|
|
|||
|
|
@ -1527,7 +1527,7 @@ public
|
|||
MouseMove += SystemOnMouseMove;
|
||||
KeyDown += SystemOnKeyDown;
|
||||
KeyUp += SystemOnKeyUp;
|
||||
Self.TextInput += SystemOnKeyPress;
|
||||
TextInput += SystemOnKeyPress;
|
||||
SizeChanged += SystemOnResize;
|
||||
|
||||
CompositionTarget.Rendering += RenderFrame;
|
||||
|
|
|
|||
|
|
@ -1241,6 +1241,12 @@ procedure SystemOnKeyUp(sender: Object; e: KeyEventArgs) :=
|
|||
if OnKeyUp<>nil then
|
||||
OnKeyUp(e.Key);
|
||||
|
||||
procedure SystemOnKeyPress(sender: Object; e: TextCompositionEventArgs) :=
|
||||
begin
|
||||
if (OnKeyPress<>nil) and (e.Text<>nil) and (e.Text.Length>0) then
|
||||
OnKeyPress(e.Text[1]);
|
||||
end;
|
||||
|
||||
procedure SystemOnResize(sender: Object; e: SizeChangedEventArgs) :=
|
||||
if OnResize<>nil then
|
||||
OnResize();
|
||||
|
|
@ -1288,6 +1294,7 @@ public
|
|||
MouseMove += SystemOnMouseMove;
|
||||
KeyDown += SystemOnKeyDown;
|
||||
KeyUp += SystemOnKeyUp;
|
||||
TextInput += SystemOnKeyPress;
|
||||
SizeChanged += SystemOnResize;
|
||||
|
||||
Loaded += (o,e) -> mre.Set();
|
||||
|
|
|
|||
|
|
@ -2520,6 +2520,8 @@ var
|
|||
OnKeyDown: procedure(k: Key);
|
||||
/// Событие отжатия клавиши
|
||||
OnKeyUp: procedure(k: Key);
|
||||
/// Событие нажатия символьной клавиши
|
||||
OnKeyPress: procedure(ch: char);
|
||||
|
||||
var
|
||||
// -----------------------------------------------------
|
||||
|
|
@ -3640,13 +3642,20 @@ type
|
|||
e.Handled := True;
|
||||
end;
|
||||
|
||||
procedure SystemOnKeyUp(sender: Object; e: System.Windows.Input.KeyEventArgs) :=
|
||||
procedure SystemOnKeyUp(sender: Object; e: System.Windows.Input.KeyEventArgs);
|
||||
begin
|
||||
if Graph3D.OnKeyUp <> nil then
|
||||
Graph3D.OnKeyUp(e.Key);
|
||||
e.Handled := True;
|
||||
end;
|
||||
|
||||
procedure SystemOnKeyPress(sender: Object; e: TextCompositionEventArgs);
|
||||
begin
|
||||
if (OnKeyPress<>nil) and (e.Text<>nil) and (e.Text.Length>0) then
|
||||
OnKeyPress(e.Text[1]);
|
||||
e.Handled := True;
|
||||
end;
|
||||
|
||||
/// --- SystemMouseEvents
|
||||
procedure SystemOnMouseDown(sender: Object; e: System.Windows.Input.MouseButtonEventArgs);
|
||||
begin
|
||||
|
|
@ -3692,6 +3701,7 @@ type
|
|||
|
||||
hvp.PreviewKeyDown += (o, e)-> SystemOnKeyDown(o, e);
|
||||
hvp.PreviewKeyUp += (o, e)-> SystemOnKeyUp(o, e);
|
||||
hvp.PreviewTextInput += SystemOnKeyPress; // не работает
|
||||
|
||||
hvp.Focus();
|
||||
Closed += procedure(sender, e) -> begin Halt; end;
|
||||
|
|
|
|||
12
TestSuite/yield_proc_1439.pas
Normal file
12
TestSuite/yield_proc_1439.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
procedure p0 := Print(1);
|
||||
|
||||
function f1: sequence of integer->integer;
|
||||
begin
|
||||
var ff: integer->integer := x->x*x;
|
||||
yield ff;
|
||||
end;
|
||||
|
||||
begin
|
||||
var a := f1.First;
|
||||
Assert(a(2)=4);
|
||||
end.
|
||||
|
|
@ -195,10 +195,33 @@ namespace PascalABCCompiler.TreeConverter
|
|||
if (to is class_field_reference)
|
||||
{
|
||||
var cfr = to as class_field_reference;
|
||||
|
||||
if (from is typed_expression) // SSM 22.12.18 syntax_tree_visitor.cs 16066 - взял оттуда
|
||||
{
|
||||
base_function_call bfc = ((from as typed_expression).type as delegated_methods).proper_methods[0];
|
||||
/*if (bfc.function.is_generic_function && _var_def_statement.vars_type == null)
|
||||
{
|
||||
AddError(inital_value.location, "CAN_NOT_DEDUCE_TYPE_{0}", null);
|
||||
}
|
||||
foreach (parameter p in bfc.simple_function_node.parameters)
|
||||
{
|
||||
if (p.type.is_generic_parameter)
|
||||
AddError(inital_value.location, "USE_ANONYMOUS_FUNCTION_TYPE_WITH_GENERICS");
|
||||
} */
|
||||
common_type_node del =
|
||||
convertion_data_and_alghoritms.type_constructor.create_delegate(context.get_delegate_type_name(), bfc.simple_function_node.return_value_type, bfc.simple_function_node.parameters, context.converted_namespace, null);
|
||||
context.converted_namespace.types.AddElement(del); //- сомневаюсь - контекст уже поменялся!
|
||||
//tn = del;
|
||||
from = convertion_data_and_alghoritms.explicit_convert_type(from, del);
|
||||
from.type = del;
|
||||
}
|
||||
|
||||
cfr.field.type = from.type;
|
||||
cfr.type = from.type; // Это неверно работает когда yieldится процедура #1439
|
||||
// SSM 1.11.18 попытка правки возвращения процедуры в yield
|
||||
//if (from.type.semantic_node_type == semantic_node_type.delegated_method)
|
||||
// SSM 1.11.18 попытка правки возвращения процедуры в yield
|
||||
//if (from.type.semantic_node_type == semantic_node_type.delegated_method)
|
||||
//cfr.type.semantic_node_type = semantic_node_type.delegated_method;
|
||||
|
||||
|
||||
cfr.field.inital_value = context.GetInitalValueForVariable(cfr.field, cfr.field.inital_value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,11 @@ namespace PascalABCCompiler.TreeRealization
|
|||
private local_variable _var;
|
||||
private int _static_depth;
|
||||
|
||||
public local_variable_reference(local_variable var,int static_depth,location loc) : base(var.type,loc)
|
||||
public override string ToString()
|
||||
{
|
||||
return this.var.name;
|
||||
}
|
||||
public local_variable_reference(local_variable var,int static_depth,location loc) : base(var.type,loc)
|
||||
{
|
||||
_var=var;
|
||||
this.static_depth=static_depth;
|
||||
|
|
|
|||
|
|
@ -2520,6 +2520,8 @@ var
|
|||
OnKeyDown: procedure(k: Key);
|
||||
/// Событие отжатия клавиши
|
||||
OnKeyUp: procedure(k: Key);
|
||||
/// Событие нажатия символьной клавиши
|
||||
OnKeyPress: procedure(ch: char);
|
||||
|
||||
var
|
||||
// -----------------------------------------------------
|
||||
|
|
@ -3640,13 +3642,20 @@ type
|
|||
e.Handled := True;
|
||||
end;
|
||||
|
||||
procedure SystemOnKeyUp(sender: Object; e: System.Windows.Input.KeyEventArgs) :=
|
||||
procedure SystemOnKeyUp(sender: Object; e: System.Windows.Input.KeyEventArgs);
|
||||
begin
|
||||
if Graph3D.OnKeyUp <> nil then
|
||||
Graph3D.OnKeyUp(e.Key);
|
||||
e.Handled := True;
|
||||
end;
|
||||
|
||||
procedure SystemOnKeyPress(sender: Object; e: TextCompositionEventArgs);
|
||||
begin
|
||||
if (OnKeyPress<>nil) and (e.Text<>nil) and (e.Text.Length>0) then
|
||||
OnKeyPress(e.Text[1]);
|
||||
e.Handled := True;
|
||||
end;
|
||||
|
||||
/// --- SystemMouseEvents
|
||||
procedure SystemOnMouseDown(sender: Object; e: System.Windows.Input.MouseButtonEventArgs);
|
||||
begin
|
||||
|
|
@ -3692,6 +3701,7 @@ type
|
|||
|
||||
hvp.PreviewKeyDown += (o, e)-> SystemOnKeyDown(o, e);
|
||||
hvp.PreviewKeyUp += (o, e)-> SystemOnKeyUp(o, e);
|
||||
hvp.PreviewTextInput += SystemOnKeyPress; // не работает
|
||||
|
||||
hvp.Focus();
|
||||
Closed += procedure(sender, e) -> begin Halt; end;
|
||||
|
|
|
|||
|
|
@ -1527,7 +1527,7 @@ public
|
|||
MouseMove += SystemOnMouseMove;
|
||||
KeyDown += SystemOnKeyDown;
|
||||
KeyUp += SystemOnKeyUp;
|
||||
Self.TextInput += SystemOnKeyPress;
|
||||
TextInput += SystemOnKeyPress;
|
||||
SizeChanged += SystemOnResize;
|
||||
|
||||
CompositionTarget.Rendering += RenderFrame;
|
||||
|
|
|
|||
|
|
@ -1241,6 +1241,12 @@ procedure SystemOnKeyUp(sender: Object; e: KeyEventArgs) :=
|
|||
if OnKeyUp<>nil then
|
||||
OnKeyUp(e.Key);
|
||||
|
||||
procedure SystemOnKeyPress(sender: Object; e: TextCompositionEventArgs) :=
|
||||
begin
|
||||
if (OnKeyPress<>nil) and (e.Text<>nil) and (e.Text.Length>0) then
|
||||
OnKeyPress(e.Text[1]);
|
||||
end;
|
||||
|
||||
procedure SystemOnResize(sender: Object; e: SizeChangedEventArgs) :=
|
||||
if OnResize<>nil then
|
||||
OnResize();
|
||||
|
|
@ -1288,6 +1294,7 @@ public
|
|||
MouseMove += SystemOnMouseMove;
|
||||
KeyDown += SystemOnKeyDown;
|
||||
KeyUp += SystemOnKeyUp;
|
||||
TextInput += SystemOnKeyPress;
|
||||
SizeChanged += SystemOnResize;
|
||||
|
||||
Loaded += (o,e) -> mre.Set();
|
||||
|
|
|
|||
Loading…
Reference in a new issue