bug fix #641
This commit is contained in:
parent
4f1c261f81
commit
a08322e1c1
|
|
@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
|
||||||
[assembly: AssemblyDelaySign(false)]
|
[assembly: AssemblyDelaySign(false)]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("PascalABC.NET Compiler")]
|
[assembly: AssemblyProduct("PascalABC.NET Compiler")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2005-2018 by Ivan Bondarev, Stanislav Mihalkovich")]
|
[assembly: AssemblyCopyright("Copyright © 2005-2017 by Ivan Bondarev, Stanislav Mihalkovich")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
[assembly: AssemblyVersion(RevisionClass.FullVersion)]
|
[assembly: AssemblyVersion(RevisionClass.FullVersion)]
|
||||||
|
|
@ -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 = "1608";
|
public const string Revision = "1610";
|
||||||
|
|
||||||
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 @@
|
||||||
%MINOR%=3
|
%MINOR%=3
|
||||||
%REVISION%=1608
|
%REVISION%=1610
|
||||||
%COREVERSION%=0
|
%COREVERSION%=0
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
//
|
//
|
||||||
// This CSharp output file generated by Gardens Point LEX
|
// This CSharp output file generated by Gardens Point LEX
|
||||||
// Version: 1.1.3.301
|
// Version: 1.1.3.301
|
||||||
// Machine: IVAN-PC
|
// Machine: DESKTOP-A6LT9RI
|
||||||
// DateTime: 29.12.2017 22:14:05
|
// DateTime: 06.01.2018 0:16:05
|
||||||
// UserName: Ivan
|
// UserName: ?????????
|
||||||
// GPLEX input file <ABCPascal.lex>
|
// GPLEX input file <ABCPascal.lex>
|
||||||
// GPLEX frame file <embedded resource>
|
// GPLEX frame file <embedded resource>
|
||||||
//
|
//
|
||||||
|
|
@ -2145,6 +2145,11 @@ if (parsertools.build_tree_for_formatter)
|
||||||
{
|
{
|
||||||
if (!Defines.Contains(directiveparam))
|
if (!Defines.Contains(directiveparam))
|
||||||
Defines.Add(directiveparam);
|
Defines.Add(directiveparam);
|
||||||
|
}
|
||||||
|
else if (directivename == "UNDEF")
|
||||||
|
{
|
||||||
|
if (Defines.Contains(directiveparam))
|
||||||
|
Defines.Remove(directiveparam);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 54:
|
case 54:
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,11 @@ UNICODEARROW \x890
|
||||||
if (!Defines.Contains(directiveparam))
|
if (!Defines.Contains(directiveparam))
|
||||||
Defines.Add(directiveparam);
|
Defines.Add(directiveparam);
|
||||||
}
|
}
|
||||||
|
else if (directivename == "UNDEF")
|
||||||
|
{
|
||||||
|
if (Defines.Contains(directiveparam))
|
||||||
|
Defines.Remove(directiveparam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<EXCLUDETEXT>{OneLineCmnt} {
|
<EXCLUDETEXT>{OneLineCmnt} {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
// (see accompanying GPPGcopyright.rtf)
|
// (see accompanying GPPGcopyright.rtf)
|
||||||
|
|
||||||
// GPPG version 1.3.6
|
// GPPG version 1.3.6
|
||||||
// Machine: IVAN-PC
|
// Machine: DESKTOP-A6LT9RI
|
||||||
// DateTime: 29.12.2017 22:14:07
|
// DateTime: 06.01.2018 0:16:05
|
||||||
// UserName: Ivan
|
// UserName: ?????????
|
||||||
// Input file <ABCPascal.y>
|
// Input file <ABCPascal.y>
|
||||||
|
|
||||||
// options: no-lines gplex
|
// options: no-lines gplex
|
||||||
|
|
@ -4035,8 +4035,8 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
||||||
case 390: // typed_var_init_expression -> identifier, tkArrow, lambda_function_body
|
case 390: // typed_var_init_expression -> identifier, tkArrow, lambda_function_body
|
||||||
{
|
{
|
||||||
var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]);
|
var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]);
|
||||||
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
|
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
|
||||||
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
|
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 391: // typed_var_init_expression -> tkRoundOpen, tkRoundClose, lambda_type_ref,
|
case 391: // typed_var_init_expression -> tkRoundOpen, tkRoundClose, lambda_type_ref,
|
||||||
|
|
@ -4061,7 +4061,7 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
||||||
idList.idents.Add(el.expressions[j] as ident);
|
idList.idents.Add(el.expressions[j] as ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
var any = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null);
|
var any = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-4]);
|
||||||
|
|
||||||
var formalPars = new formal_parameters(new typed_parameters(idList, any, parametr_kind.none, null, LocationStack[LocationStack.Depth-4]), LocationStack[LocationStack.Depth-4]);
|
var formalPars = new formal_parameters(new typed_parameters(idList, any, parametr_kind.none, null, LocationStack[LocationStack.Depth-4]), LocationStack[LocationStack.Depth-4]);
|
||||||
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, any, ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
|
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, any, ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
|
||||||
|
|
@ -5770,8 +5770,8 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
||||||
case 800: // func_decl_lambda -> identifier, tkArrow, lambda_function_body
|
case 800: // func_decl_lambda -> identifier, tkArrow, lambda_function_body
|
||||||
{
|
{
|
||||||
var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]);
|
var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]);
|
||||||
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
|
var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]);
|
||||||
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
|
CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 801: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype,
|
case 801: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype,
|
||||||
|
|
|
||||||
|
|
@ -184,5 +184,6 @@ script=
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.3.0.1608'
|
!define VERSION '3.3.0.1610'
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ type
|
||||||
procedure SetText(t: string) := b.Text := t;
|
procedure SetText(t: string) := b.Text := t;
|
||||||
public
|
public
|
||||||
event Click: procedure;
|
event Click: procedure;
|
||||||
constructor Create(text: string);
|
constructor Create(text: string := '');
|
||||||
property Width: integer read GetW write SetW;
|
property Width: integer read GetW write SetW;
|
||||||
property Text: string read GetText write SetText;
|
property Text: string read GetText write SetText;
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
|
|
@ -1617,22 +1617,67 @@ type
|
||||||
function Clone := (inherited Clone) as RectangleT;
|
function Clone := (inherited Clone) as RectangleT;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FileModelT = class(Object3D)
|
FileModelT = class(ObjectWithChildren3D)
|
||||||
private
|
private
|
||||||
|
fn: string;
|
||||||
|
procedure SetMP(mat: GMaterial) := (model as MeshVisual3D).FaceMaterial := mat;
|
||||||
|
procedure SetMaterial(mat: GMaterial) := Invoke(SetMP, mat);
|
||||||
|
function GetMaterial: GMaterial := Invoke&<GMaterial>(()->(model as MeshVisual3D).FaceMaterial);
|
||||||
|
public
|
||||||
|
//property Color: GColor write SetColor;
|
||||||
|
property Material: GMaterial read GetMaterial write SetMaterial; // не работает почему-то на запись
|
||||||
|
|
||||||
{procedure SetVP(v: boolean) := (model as FileModelVisual3D).Visibility := v;
|
{procedure SetVP(v: boolean) := (model as FileModelVisual3D).Visibility := v;
|
||||||
procedure SetV(v: boolean) := Invoke(SetVP, v);
|
procedure SetV(v: boolean) := Invoke(SetVP, v);
|
||||||
function GetV: boolean := Invoke&<boolean>(()->(model as FileModelVisual3D).Visibility);}
|
function GetV: boolean := Invoke&<boolean>(()->(model as FileModelVisual3D).Visibility);}
|
||||||
protected
|
protected
|
||||||
function CreateObject: Object3D; override := new FileModelT(X, Y, Z, (model as FileModelVisual3D).Source);
|
function CreateObject: Object3D; override := new FileModelT(X, Y, Z, fn, Material.Clone);
|
||||||
public
|
public
|
||||||
constructor(x, y, z: real; fname: string);
|
constructor(x, y, z: real; fname: string; mat: GMaterial);
|
||||||
begin
|
begin
|
||||||
var a := new FileModelVisual3D;
|
model := new MeshVisual3D();
|
||||||
a.Source := fname;
|
|
||||||
CreateBase0(a, x, y, z);
|
var fs := System.IO.File.OpenRead(fname);
|
||||||
|
fn := fname;
|
||||||
|
|
||||||
|
var ext := System.IO.Path.GetExtension(fname);
|
||||||
|
ext := ext?.ToLower;
|
||||||
|
|
||||||
|
var r: ModelReader;
|
||||||
|
|
||||||
|
case ext of
|
||||||
|
'.off': begin
|
||||||
|
r := new offreader(nil);
|
||||||
|
(model as MeshVisual3D).FaceMaterial := mat;
|
||||||
|
(model as MeshVisual3D).EdgeDiameter := 0;
|
||||||
|
(model as MeshVisual3D).VertexRadius := 0;
|
||||||
|
end;
|
||||||
|
'.3ds': r := new studioreader(nil);
|
||||||
|
'.lwo': r := new lworeader(nil);
|
||||||
|
'.stl': r := new stlreader(nil);
|
||||||
|
'.obj','.objx': r := new objreader(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
r.DefaultMaterial := mat;
|
||||||
|
//r.DefaultMaterial := Colors.Gray;
|
||||||
|
if ext = '.off' then
|
||||||
|
begin
|
||||||
|
(r as offreader).Load(fs);
|
||||||
|
(model as MeshVisual3D).Mesh := (r as offreader).CreateMesh;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
var md := r.Read(fs);
|
||||||
|
(model as MeshVisual3D).Content := md;
|
||||||
|
end;
|
||||||
|
|
||||||
|
fs.Close;
|
||||||
|
|
||||||
|
{var a := new FileModelVisual3D;
|
||||||
|
a.Source := fname;}
|
||||||
|
CreateBase0(model, x, y, z);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//property Visible: boolean read GetV write SetV;
|
|
||||||
function Clone := (inherited Clone) as FileModelT;
|
function Clone := (inherited Clone) as FileModelT;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
@ -2430,16 +2475,16 @@ function Text3D(p: Point3D; text: string; height: real; c: Color) := Text3D(p.x,
|
||||||
function Text3D(x, y, z: real; text: string; height: real) := Text3D(x, y, z, text, height, 'Arial', Colors.Black);
|
function Text3D(x, y, z: real; text: string; height: real) := Text3D(x, y, z, text, height, 'Arial', Colors.Black);
|
||||||
function Text3D(p: Point3D; text: string; height: real) := Text3D(p.x, p.y, p.z, text, height, 'Arial', Colors.Black);
|
function Text3D(p: Point3D; text: string; height: real) := Text3D(p.x, p.y, p.z, text, height, 'Arial', Colors.Black);
|
||||||
|
|
||||||
function Rectangle3D(x, y, z, l, w: real; normal, lendirection: Vector3D; c: Material) := Invoke&<RectangleT>(()->RectangleT.Create(x, y, z, l, w, normal, lendirection, c));
|
function Rectangle3D(x, y, z, l, w: real; normal, lendirection: Vector3D; c: Material): RectangleT := Invoke&<RectangleT>(()->RectangleT.Create(x, y, z, l, w, normal, lendirection, c));
|
||||||
function Rectangle3D(p: Point3D; l, w: real; normal, lendirection: Vector3D; c: Material) := Rectangle3D(p.x, p.y, p.z, l, w, normal, lendirection, c);
|
function Rectangle3D(p: Point3D; l, w: real; normal, lendirection: Vector3D; c: Material): RectangleT := Rectangle3D(p.x, p.y, p.z, l, w, normal, lendirection, c);
|
||||||
function Rectangle3D(x, y, z, l, w: real; normal: Vector3D; c: Material) := Rectangle3D(x, y, z, l, w, normal, OrtX, c);
|
function Rectangle3D(x, y, z, l, w: real; normal: Vector3D; c: Material): RectangleT := Rectangle3D(x, y, z, l, w, normal, OrtX, c);
|
||||||
function Rectangle3D(x, y, z, l, w: real; c: Material) := Rectangle3D(x, y, z, l, w, OrtZ, OrtX, c);
|
function Rectangle3D(x, y, z, l, w: real; c: Material): RectangleT := Rectangle3D(x, y, z, l, w, OrtZ, OrtX, c);
|
||||||
function Rectangle3D(p: Point3D; l, w: real; normal: Vector3D; c: Material) := Rectangle3D(p.x, p.y, p.z, l, w, normal, OrtX, c);
|
function Rectangle3D(p: Point3D; l, w: real; normal: Vector3D; c: Material): RectangleT := Rectangle3D(p.x, p.y, p.z, l, w, normal, OrtX, c);
|
||||||
function Rectangle3D(p: Point3D; l, w: real; c: Material) := Rectangle3D(p.x, p.y, p.z, l, w, OrtZ, OrtX, c);
|
function Rectangle3D(p: Point3D; l, w: real; c: Material): RectangleT := Rectangle3D(p.x, p.y, p.z, l, w, OrtZ, OrtX, c);
|
||||||
|
|
||||||
/// Загружает модель из файла .obj, .3ds, .lwo, .objz, .stl, .off
|
/// Загружает модель из файла .obj, .3ds, .lwo, .objz, .stl, .off
|
||||||
function FileModel3D(x, y, z: real; fname: string) := Invoke&<FileModelT>(()->FileModelT.Create(x, y, z, fname));
|
function FileModel3D(x, y, z: real; fname: string; c: Material): FileModelT := Invoke&<FileModelT>(()->FileModelT.Create(x, y, z, fname, c));
|
||||||
function FileModel3D(p: Point3D; fname: string) := FileModel3D(p.x, p.y, p.z, fname);
|
function FileModel3D(p: Point3D; fname: string; c: Material): FileModelT := FileModel3D(p.x, p.y, p.z, fname, c);
|
||||||
|
|
||||||
function Prism(x, y, z: real; Sides: integer; Radius, Height: real; c: Material): PrismT := Invoke&<PrismT>(()->PrismT.Create(x, y, z, Sides, Radius, Height, c));
|
function Prism(x, y, z: real; Sides: integer; Radius, Height: real; c: Material): PrismT := Invoke&<PrismT>(()->PrismT.Create(x, y, z, Sides, Radius, Height, c));
|
||||||
function Prism(p: Point3D; Sides: integer; Radius, Height: real; c: Material): PrismT := Prism(p.X, p.Y, p.Z, Sides, Radius, Height, c);
|
function Prism(p: Point3D; Sides: integer; Radius, Height: real; c: Material): PrismT := Prism(p.X, p.Y, p.Z, Sides, Radius, Height, c);
|
||||||
|
|
@ -2525,9 +2570,6 @@ begin
|
||||||
var s := System.IO.File.OpenRead('boxcube.off');
|
var s := System.IO.File.OpenRead('boxcube.off');
|
||||||
off.Load(s);
|
off.Load(s);
|
||||||
|
|
||||||
//var mmm := new ModelVisual3D;
|
|
||||||
//mmm.Model := off.CreateMeshGeometry3D;
|
|
||||||
|
|
||||||
var m1 := new MeshVisual3D();
|
var m1 := new MeshVisual3D();
|
||||||
m1.FaceMaterial := Colors.Green;
|
m1.FaceMaterial := Colors.Green;
|
||||||
m1.EdgeDiameter := 0;
|
m1.EdgeDiameter := 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue