bug fix #536
This commit is contained in:
parent
2c44f13b7e
commit
a33768fb4e
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "3";
|
public const string Minor = "3";
|
||||||
public const string Build = "0";
|
public const string Build = "0";
|
||||||
public const string Revision = "1555";
|
public const string Revision = "1556";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%COREVERSION%=0
|
|
||||||
%REVISION%=1555
|
|
||||||
%MINOR%=3
|
%MINOR%=3
|
||||||
|
%REVISION%=1556
|
||||||
|
%COREVERSION%=0
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.3.0.1555'
|
!define VERSION '3.3.0.1556'
|
||||||
|
|
|
||||||
|
|
@ -3972,7 +3972,7 @@ begin
|
||||||
|
|
||||||
gr := Graphics.FromHwnd(f.Handle);
|
gr := Graphics.FromHwnd(f.Handle);
|
||||||
|
|
||||||
if (System.Environment.OSVersion.Version.Major >= 6) then SetProcessDPIAware();
|
//if (System.Environment.OSVersion.Version.Major >= 6) then SetProcessDPIAware();
|
||||||
InitBMP;
|
InitBMP;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
11
TestSuite/CompilationSamples/Lambda_global1.pas
Normal file
11
TestSuite/CompilationSamples/Lambda_global1.pas
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
var glob1: real -> real := x->x*x;
|
||||||
|
var a := ArrGen(10,x->x);
|
||||||
|
|
||||||
|
var y := 222;
|
||||||
|
var glob2: real -> real := x->x+y;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Print(glob1(2));
|
||||||
|
Print(glob2(2));
|
||||||
|
end.
|
||||||
|
|
@ -209,8 +209,8 @@ type
|
||||||
function GetUD: Vector3D := Invoke&<Vector3D>(()->Cam.UpDirection);
|
function GetUD: Vector3D := Invoke&<Vector3D>(()->Cam.UpDirection);
|
||||||
procedure SetDP(d: real);
|
procedure SetDP(d: real);
|
||||||
begin
|
begin
|
||||||
var dist := Position.DistanceTo(P3D(0,0,0));
|
var dist := Cam.Position.DistanceTo(P3D(0,0,0));
|
||||||
Position := Position.Multiply(d/dist);
|
Cam.Position := Cam.Position.Multiply(d/dist);
|
||||||
end;
|
end;
|
||||||
procedure SetD(d: real) := Invoke(SetDP,d);
|
procedure SetD(d: real) := Invoke(SetDP,d);
|
||||||
function GetD: real := Invoke&<real>(()->Cam.Position.DistanceTo(P3D(0,0,0)));
|
function GetD: real := Invoke&<real>(()->Cam.Position.DistanceTo(P3D(0,0,0)));
|
||||||
|
|
|
||||||
|
|
@ -2503,6 +2503,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
|
|
||||||
public override void visit(SyntaxTree.block _block)
|
public override void visit(SyntaxTree.block _block)
|
||||||
{
|
{
|
||||||
|
var tt = context.converting_block();
|
||||||
List<declaration> declarations_with_lambdas = new List<declaration>();
|
List<declaration> declarations_with_lambdas = new List<declaration>();
|
||||||
if (/*context.converting_block() != block_type.namespace_block && */_block.defs != null && _block.defs.defs != null)
|
if (/*context.converting_block() != block_type.namespace_block && */_block.defs != null && _block.defs.defs != null)
|
||||||
{
|
{
|
||||||
|
|
@ -2526,9 +2527,11 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
foreach (var_def_statement vds in vd.list)
|
foreach (var_def_statement vds in vd.list)
|
||||||
{
|
{
|
||||||
var lambdaSearcher = new LambdaSearcher(vds);
|
var lambdaSearcher = new LambdaSearcher(vds);
|
||||||
if (lambdaSearcher.CheckIfContainsLambdas())
|
if (lambdaSearcher.CheckIfContainsLambdas() && !(vds.inital_value is function_lambda_definition)) // SSM 27/10/17
|
||||||
{
|
{
|
||||||
procedure_definition func = new short_func_definition(SyntaxTreeBuilder.BuildShortFuncDefinition(new formal_parameters(), new procedure_attributes_list(), new method_name("<>lambda_initializer" + lambda_init_index), null, vds.inital_value, null));
|
procedure_definition func =
|
||||||
|
new short_func_definition(
|
||||||
|
SyntaxTreeBuilder.BuildShortFuncDefinition(new formal_parameters(), new procedure_attributes_list(), new method_name("<>lambda_initializer" + lambda_init_index), null, vds.inital_value, null));
|
||||||
|
|
||||||
vds.inital_value = new method_call(new ident("<>lambda_initializer"+lambda_init_index), new expression_list());
|
vds.inital_value = new method_call(new ident("<>lambda_initializer"+lambda_init_index), new expression_list());
|
||||||
_block.defs.InsertBefore(vd, func);
|
_block.defs.InsertBefore(vd, func);
|
||||||
|
|
|
||||||
|
|
@ -1138,6 +1138,12 @@ namespace VisualPascalABCPlugins
|
||||||
prepare_node(node.left, "left");
|
prepare_node(node.left, "left");
|
||||||
prepare_node(node.right, "right");
|
prepare_node(node.right, "right");
|
||||||
}
|
}
|
||||||
|
public override void visit(short_func_definition node)
|
||||||
|
{
|
||||||
|
prepare_node(node.proc_header, "proc_header");
|
||||||
|
prepare_node(node.proc_body, "proc_body");
|
||||||
|
prepare_node(node.procdef, "procdef");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue