Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
OpenGL.pas
  • Loading branch information
ibond84 committed Jun 7, 2016
1 parent 0805946 commit 17f7bf3
Show file tree
Hide file tree
Showing 6 changed files with 3,712 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ReleaseGenerators/RebuildStandartModules.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DrawManField, Events, FilesOperations, GraphABC,
GraphABCHelper, IniFile, PointerTools, PointRect, PT4, Robot, RobotField,
RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4Exam, PT4TaskMakerNET, RBDMUtils,
Collections, Arrays, Core, FormsABC, MPI, ClientServer;
Collections, Arrays, Core, FormsABC, MPI, ClientServer, OpenGL;

begin
writeln(cos(pi));
Expand Down
4 changes: 4 additions & 0 deletions ReleaseGenerators/sect_Core.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
File ..\bin\Lib\Core.pcu
File ..\bin\Lib\MPI.pcu
File ..\bin\Lib\ClientServer.pcu
File ..\bin\Lib\OpenGL.pcu
File ..\bin\Lib\PABCRtl.dll
File ..\bin\Lib\PABCRtl32.dll

Expand Down Expand Up @@ -143,6 +144,7 @@
${AddFile} "Core.pcu"
${AddFile} "MPI.pcu"
${AddFile} "ClientServer.pcu"
${AddFile} "OpenGL.pcu"
${AddFile} "PABCRtl.dll"
${AddFile} "PABCRtl.pdb"
Push "Lib\PABCRtl.dll"
Expand Down Expand Up @@ -188,6 +190,7 @@
File ..\bin\Lib\Core.pas
File ..\bin\Lib\MPI.pas
File ..\bin\Lib\ClientServer.pas
File ..\bin\Lib\OpenGL.pas
File ..\bin\Lib\__RedirectIOMode.vb
File ..\bin\Lib\VBSystem.vb

Expand Down Expand Up @@ -231,6 +234,7 @@
${AddFile} "Core.pas"
${AddFile} "MPI.pas"
${AddFile} "ClientServer.pas"
${AddFile} "OpenGL.pas"
${AddFile} "__RedirectIOMode.vb"
${AddFile} "VBSystem.vb"

Expand Down
15 changes: 15 additions & 0 deletions TestSuite/generics9.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function f<T>(t1: T): array of T;
where T: System.IComparable<T>; forward;

function f<T>(t1: T): array of T;
begin
var t2: T;
t2 := t1;
Result := new T[1];
Result[0] := t1;
end;

begin
var arr := f(2);
assert(arr[0] = 2);
end.
11 changes: 9 additions & 2 deletions TreeConverter/TreeConversion/compilation_context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3169,18 +3169,21 @@ private bool check_unique_or_predefined(common_function_node fn)
{
for (int i = 0; i < fn.generic_params.Count; ++i)
{
fn.generic_params[i] = compar.generic_params[i] as common_type_node;
common_type_node t_fn = fn.generic_params[i] as common_type_node;
common_type_node t_compar = compar.generic_params[i] as common_type_node;
t_fn.is_class = t_compar.is_class;
/*t_fn.is_class = t_compar.is_class;
t_fn.internal_is_value = t_compar.internal_is_value;
t_fn.SetImplementingInterfaces(t_compar.ImplementingInterfaces);
(t_fn.Scope as SymbolTable.IInterfaceScope).TopInterfaceScopeArray =
(t_compar.Scope as SymbolTable.IInterfaceScope).TopInterfaceScopeArray;
t_fn.SetBaseType(t_compar.base_type);
t_fn.SetBaseType(t_compar.base_type);*/
if (t_compar.has_default_constructor)
{
generic_parameter_eliminations.add_default_ctor(t_fn);
}
SymbolInfo par_sim_info = fn.scope.FindOnlyInScope(fn.generic_params[i].name);
par_sim_info.sym_info = fn.generic_params[i] as common_type_node;
//t_fn.generic_function_container = compar;
}
//конверитируем параметры предописания в параметры описания.
Expand All @@ -3196,6 +3199,10 @@ private bool check_unique_or_predefined(common_function_node fn)
{
compar.return_variable.type = compar.return_value_type;
}
}
foreach (generic_parameter_eliminations gpe in compar.parameters_eliminations)
{

}
compar.generic_params = fn.generic_params;
foreach (common_type_node tn in compar.generic_params)
Expand Down
4 changes: 3 additions & 1 deletion TreeConverter/TreeConversion/syntax_tree_visitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13420,7 +13420,8 @@ public override void visit(SyntaxTree.ref_type _ref_type)
context.CurrentScope.Find((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name) == null)
{
//это указатель на тип который еще не описан
if (!is_direct_type_decl) AddError(new UndefinedNameReference((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name,get_location(_ref_type.pointed_to)));
if (!is_direct_type_decl)
AddError(new UndefinedNameReference((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name,get_location(_ref_type.pointed_to)));
return_value(GetWaitedRefType((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name, get_location(_ref_type.pointed_to)));
}
else
Expand Down Expand Up @@ -17725,6 +17726,7 @@ internal void LeaveTypeDeclarationsSection()
foreach (ref_type_node rtn in WaitedRefTypes.Values)
CheckForCircularityInPointers(rtn, rtn.pointed_type,rtn.loc);
ProcessRefTypesForCheckPointersTypeForDotNetFramework();
WaitedRefTypes.Clear();
}

internal void ProcessCheckPointersInRecord()
Expand Down
Loading

0 comments on commit 17f7bf3

Please sign in to comment.