Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ibond84 committed Dec 22, 2016
1 parent eccf368 commit 5de8f16
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ParserTools/ParserTools/DefaultLanguageInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ protected virtual string GetDescriptionForCompiledMethod(ICompiledMethodScope sc
if (!class_generic_table.ContainsKey(class_generic_args[i].Name))
class_generic_table.Add(class_generic_args[i].Name, j);
if (scope.GenericArgs != null && scope.GenericArgs.Count > j)
generic_param_args.Add(class_generic_args[i].Name, scope.GenericArgs[j]);
generic_param_args.Add(class_generic_args[i].Name, GetSimpleDescription(scope.DeclaringType.GenericInstances[0]));
else if (scope.DeclaringType.TemplateArguments != null && scope.DeclaringType.TemplateArguments.Length > j)
generic_param_args.Add(class_generic_args[i].Name, scope.DeclaringType.TemplateArguments[j]);
}
Expand All @@ -1754,9 +1754,9 @@ protected virtual string GetDescriptionForCompiledMethod(ICompiledMethodScope sc
int ind = class_generic_table[tt[i].Name];
if (scope.GenericArgs != null && scope.GenericArgs.Count > ind)
{
sb.Append(scope.GenericArgs[ind]);
sb.Append(GetSimpleDescription(scope.DeclaringType.GenericInstances[ind]));
if (!generic_param_args.ContainsKey(tt[i].Name))
generic_param_args.Add(tt[i].Name, scope.GenericArgs[ind]);
generic_param_args.Add(tt[i].Name, GetSimpleDescription(scope.DeclaringType.GenericInstances[ind]));
}
}
else
Expand Down Expand Up @@ -1868,7 +1868,7 @@ protected virtual string GetDescriptionForProcedure(IProcScope scope)
{
if (extensionType != null)
{
sb.Append(extensionType);
sb.Append(extensionType+".");
sb.Append(scope.Name);
}
else
Expand Down
9 changes: 9 additions & 0 deletions TestSuite/extensionoperators1.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
begin
var seq1 := Range(1, 3)+2;
var arr := seq1.ToArray;
assert(arr[3] = 2);
seq1 := 2+Range(1, 3);
assert(seq1.First = 2);
seq1 := Range(1, 3)+Range(4, 6);
assert(seq1.Last = 6);
end.
6 changes: 4 additions & 2 deletions TreeConverter/TreeConversion/syntax_tree_visitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,9 +1101,11 @@ public expression_node find_operator(string name, expression_node left, expressi
#endif

function_node fn = ((function_node)(sic.sym_info));
if (convertion_data_and_alghoritms.is_exist_eq_method_in_list(fn, funcs) != null)
if (convertion_data_and_alghoritms.is_exist_eq_method_in_list(fn, funcs) == null)
{
break;
//break;
funcs.AddElement(fn);

}
funcs.AddElement(fn);
sic_last = sic;
Expand Down

0 comments on commit 5de8f16

Please sign in to comment.