This commit is contained in:
Бондарев Иван 2016-05-29 11:27:25 +02:00
parent f8c68eeb56
commit c4b314821f
4 changed files with 36 additions and 11 deletions

View file

@ -11,8 +11,6 @@ end;
begin begin
//var a := Arr(1,2,3);
//System.Linq.Enumerable.Select(a,x->x); - жаль - пока не работает. Закомментил чтобы тесты не падали
var a := Arr(1,2,3); var a := Arr(1,2,3);
var seq := System.Linq.Enumerable.Select(a,x->x*2); var seq := System.Linq.Enumerable.Select(a,x->x*2);
//a.Reverse.Print; //a.Reverse.Print;

View file

@ -0,0 +1,7 @@
begin
var s := '1234';
var fnc: char->boolean := char.IsDigit;
assert(s.All(fnc) = true);
assert(s.All&<char>(char.IsDigit) = true);
assert(s.All&<char>(char.IsControl) = false);
end.

17
TestSuite/with1.pas Normal file
View file

@ -0,0 +1,17 @@
type TClass = class
a: integer;
end;
begin
var obj := new TClass;
with obj do
begin
a := 2;
assert(a = 2);
end;
var lst := Lst(1,2,3);
with lst do
begin
assert(Count = 3);
end;
end.

View file

@ -8538,22 +8538,25 @@ namespace PascalABCCompiler.TreeConverter
} }
case general_node_type.function_node: case general_node_type.function_node:
{ {
//TODO: Передается пустой список выражений.
/*
function_node fn=convertion_data_and_alghoritms.select_function(new expressions_list(),
si_right,get_location(id_right));
return create_static_method_call(fn,get_location(id_right),tn,false);
*/
//if (!(si_right.sym_info is common_in_function_function_node))
if (dn is compiled_function_node) if (dn is compiled_function_node)
{ {
if ((dn as compiled_function_node).ConnectedToType == tn) if ((dn as compiled_function_node).ConnectedToType == tn)
AddError(new UndefinedNameReference(id_right.name, get_location(id_right))); {
if (si_right.Next != null)
return create_static_expression(tn, id_right, si_right.Next);
else
AddError(new UndefinedNameReference(id_right.name, get_location(id_right)));
}
} }
else if (dn is common_namespace_function_node) else if (dn is common_namespace_function_node)
{ {
if ((dn as common_namespace_function_node).ConnectedToType == tn) if ((dn as common_namespace_function_node).ConnectedToType == tn)
AddError(new UndefinedNameReference(id_right.name, get_location(id_right))); {
if (si_right.Next != null)
return create_static_expression(tn, id_right, si_right.Next);
else
AddError(new UndefinedNameReference(id_right.name, get_location(id_right)));
}
} }
if (dn.semantic_node_type == semantic_node_type.indefinite_definition_node) if (dn.semantic_node_type == semantic_node_type.indefinite_definition_node)
{ {