bug fix #360
This commit is contained in:
parent
594fe0833c
commit
22e529d3bd
|
|
@ -109,7 +109,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
DomConverter dconv = new DomConverter(this);
|
||||
if (cu != null)
|
||||
|
|
@ -144,7 +146,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
if (cu != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -938,7 +938,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
RestoreCurrentUsedAssemblies();
|
||||
string description = ss.si.description;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
throw e;
|
||||
//System.Diagnostics.Debug.WriteLine(e.StackTrace);
|
||||
}
|
||||
|
|
@ -225,6 +228,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
cnst_val.prim_val = null;
|
||||
ev.eval_stack.Clear();
|
||||
returned_scope = null;
|
||||
|
|
@ -491,7 +497,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2192,7 +2200,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (_program_module.program_block.program_code != null)
|
||||
|
|
@ -2393,6 +2403,8 @@ namespace CodeCompletion
|
|||
if (returned_scope is ProcScope)
|
||||
ts = (returned_scope as ProcScope).return_type;
|
||||
returned_scopes = returned_scope.FindOverloadNamesOnlyInType((_dot_node.right as ident).name);
|
||||
if (ts != null)
|
||||
{
|
||||
List<ProcScope> meths = entry_scope.GetExtensionMethods((_dot_node.right as ident).name, ts);
|
||||
if (meths.Count > 0)
|
||||
{
|
||||
|
|
@ -2401,6 +2413,7 @@ namespace CodeCompletion
|
|||
foreach (ProcScope meth in meths)
|
||||
returned_scopes.Add(meth);
|
||||
}
|
||||
}
|
||||
search_all = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -3687,7 +3700,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3712,6 +3727,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
cur_scope = impl_scope;
|
||||
}
|
||||
}
|
||||
|
|
@ -3887,7 +3905,6 @@ namespace CodeCompletion
|
|||
|
||||
public override void visit(exception_block _exception_block)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
if (_exception_block.handlers != null)
|
||||
_exception_block.handlers.visit(this);
|
||||
if (_exception_block.stmt_list != null)
|
||||
|
|
@ -3903,19 +3920,16 @@ namespace CodeCompletion
|
|||
|
||||
public override void visit(try_handler_finally _try_handler_finally)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
_try_handler_finally.stmt_list.visit(this);
|
||||
}
|
||||
|
||||
public override void visit(try_handler_except _try_handler_except)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
_try_handler_except.except_block.visit(this);
|
||||
}
|
||||
|
||||
public override void visit(try_stmt _try_stmt)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
if (_try_stmt.stmt_list != null)
|
||||
_try_stmt.stmt_list.visit(this);
|
||||
if (_try_stmt.handler != null)
|
||||
|
|
@ -3997,7 +4011,6 @@ namespace CodeCompletion
|
|||
|
||||
public override void visit(template_type_reference _template_type_reference)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
returned_scope = null;
|
||||
converted_template_type = _template_type_reference;
|
||||
_template_type_reference.name.visit(this);
|
||||
|
|
@ -4264,7 +4277,9 @@ namespace CodeCompletion
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4852,6 +4852,7 @@ namespace CodeCompletion
|
|||
if (lst[0].instances != null && lst[0].instances.Count > 0)
|
||||
lst[0] = lst[0].instances[0];
|
||||
sc.instances.Add(this.instances[i].GetInstance(lst));
|
||||
if (i < gen_args.Count)
|
||||
sc.generic_params.Add(gen_args[i].si.name);
|
||||
}
|
||||
else
|
||||
|
|
@ -4861,10 +4862,12 @@ namespace CodeCompletion
|
|||
List<TypeScope> lst = new List<TypeScope>();
|
||||
lst.Add(gen_args[i].elementType);
|
||||
sc.instances.Add(this.instances[i].GetInstance(lst));
|
||||
if (i < gen_args.Count)
|
||||
sc.generic_params.Add(gen_args[i].elementType.si.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i < gen_args.Count)
|
||||
sc.generic_params.Add(gen_args[i].si.name);
|
||||
sc.instances.Add(this.instances[i].GetInstance(gen_args));
|
||||
}
|
||||
|
|
@ -4874,6 +4877,7 @@ namespace CodeCompletion
|
|||
else
|
||||
for (int i = 0; i < gen_args.Count; i++)
|
||||
{
|
||||
if (i < gen_args.Count)
|
||||
sc.generic_params.Add(gen_args[i].si.name);
|
||||
sc.instances.Add(gen_args[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@
|
|||
</Node>
|
||||
<Node Name="Реализуем (var a, var b) := (1,2)" NL="0" NG="0">
|
||||
<Items>
|
||||
<Node ID="visit" Name="visit(SyntaxTree.assign_var_tuple" NL="0,9414063" NG="-1">
|
||||
<Node Name="visit(SyntaxTree.assign_var_tuple" NL="0,9414063" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<Text>public override void visit(SyntaxTree.assign_var_tuple assvartup) // сахарный узел</Text>
|
||||
<OCtx>
|
||||
|
|
@ -367,7 +367,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="visit" Name="for (var i=0; i<_statement_list.subnodes.Count" NL="0,9306641" NG="-1">
|
||||
<Node Name="for (var i=0; i<_statement_list.subnodes.Count" NL="0,9306641" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="Method">public override void visit ( SyntaxTree . statement_list _statement_list )</i>
|
||||
|
|
@ -377,7 +377,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="visit" Name="Проверка на labelled_statement" NL="0,9423828" NG="-1">
|
||||
<Node Name="Проверка на labelled_statement" NL="0,9423828" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="Method">public override void visit ( SyntaxTree . labeled_statement _labeled_statement )</i>
|
||||
|
|
@ -387,7 +387,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="convert_strong" Name="convert_strong" NL="0,8408203" NG="-1">
|
||||
<Node Name="convert_strong" NL="0,8408203" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<Text>internal expression_node convert_strong(SyntaxTree.expression expr)</Text>
|
||||
<OCtx>
|
||||
|
|
@ -398,7 +398,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="visit" Name="LambdaProcessingState.TypeInferencePhase" NL="0,9238281" NG="-1">
|
||||
<Node Name="LambdaProcessingState.TypeInferencePhase" NL="0,9238281" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<Text>case LambdaProcessingState.TypeInferencePhase:</Text>
|
||||
<OCtx>
|
||||
|
|
@ -476,7 +476,7 @@
|
|||
</Node>
|
||||
<Node Name="foreach" NL="0" NG="0">
|
||||
<Items>
|
||||
<Node ID="visit" Name="visit(foreach_stmt" NL="0,9033203" NG="-1">
|
||||
<Node Name="visit(foreach_stmt" NL="0,9033203" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="Method">public override void visit ( SyntaxTree . foreach_stmt _foreach_stmt )</i>
|
||||
|
|
@ -893,7 +893,7 @@
|
|||
</Node>
|
||||
<Node Name="Преобразование синт дерева" NL="0" NG="0">
|
||||
<Items>
|
||||
<Node ID="CompileUnit" Name="Вызов Convert контроллера SyntaxTrees" NL="0,7451172" NG="0,5644531">
|
||||
<Node Name="Вызов Convert контроллера SyntaxTrees" NL="0,7451172" NG="0,5644531">
|
||||
<FileName>\Compiler\Compiler.cs</FileName>
|
||||
<Text>CurrentUnit.SyntaxTree = syntaxTreeConvertersController.Convert(CurrentUnit.SyntaxTree) as SyntaxTree.compilation_unit;</Text>
|
||||
<OCtx>
|
||||
|
|
@ -1274,7 +1274,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="visit" Name="Обработка auto_type в assign_node" NL="0,8925781" NG="-1">
|
||||
<Node Name="Обработка auto_type в assign_node" NL="0,8925781" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<Note>Обработка auto_type в assign_node</Note>
|
||||
<Text>if (to.type is auto_type)</Text>
|
||||
|
|
@ -1286,7 +1286,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="visit" Name="visit(SyntaxTree.yield_unknown_expression_type" NL="0,9160156" NG="-1">
|
||||
<Node Name="visit(SyntaxTree.yield_unknown_expression_type" NL="0,9160156" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<Text>public override void visit(SyntaxTree.yield_unknown_expression_type _unk_expr)</Text>
|
||||
<OCtx>
|
||||
|
|
@ -1364,7 +1364,7 @@
|
|||
</Node>
|
||||
<Node Name="[::]" NL="0" NG="0">
|
||||
<Items>
|
||||
<Node ID="visit" Name="visit(slice_expr" NL="0,9521484" NG="-1">
|
||||
<Node Name="visit(slice_expr" NL="0,9521484" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="Method">public override void visit ( SyntaxTree . slice_expr sl )</i>
|
||||
|
|
@ -1374,7 +1374,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="visit" Name="visit(slice_expr_question" NL="0,9521484" NG="-1">
|
||||
<Node Name="visit(slice_expr_question" NL="0,9521484" NG="-1">
|
||||
<FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="Method">public override void visit ( SyntaxTree . slice_expr_question sl )</i>
|
||||
|
|
@ -1414,7 +1414,7 @@
|
|||
</Node>
|
||||
<Node Name="Ядро преобраз-я синт. деревьев" NL="0" NG="0">
|
||||
<Items>
|
||||
<Node ID="StandardSyntaxTreeConverter" Name="StandardSyntaxTreeConverter" NL="-1" NG="0,2734375">
|
||||
<Node Name="StandardSyntaxTreeConverter" NL="-1" NG="0,2734375">
|
||||
<FileName>\standardsyntaxtreeconverter\standardsyntaxconverter.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="ClassOrNamespace">public class StandardSyntaxTreeConverter : ISyntaxTreeConverter</i>
|
||||
|
|
@ -1439,7 +1439,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="AddConverters" Name="AddConverters() - semantic" NL="0,6904297" NG="-1">
|
||||
<Node Name="AddConverters() - semantic" NL="0,6904297" NG="-1">
|
||||
<FileName>\compiler\semantictreeconverters\semantictreeconverterscontroller.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="Method">private void AddConverters ( string DirectoryName )</i>
|
||||
|
|
@ -1449,7 +1449,7 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node ID="AddConverters" Name="AddConverters() - syntax" NL="0,6904297" NG="-1">
|
||||
<Node Name="AddConverters() - syntax" NL="0,6904297" NG="-1">
|
||||
<FileName>\Compiler\SyntaxTreeConvertersController\SyntaxTreeConvertersController.cs</FileName>
|
||||
<Text>private void AddConverters(string DirectoryName)</Text>
|
||||
<OCtx>
|
||||
|
|
|
|||
|
|
@ -1186,7 +1186,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
//if (si == null)
|
||||
{
|
||||
if (/*si2 == null && */left_type.semantic_node_type == semantic_node_type.delegated_method && right_type.semantic_node_type == semantic_node_type.delegated_method)
|
||||
if (left_type.semantic_node_type == semantic_node_type.delegated_method && right_type.semantic_node_type == semantic_node_type.delegated_method)
|
||||
{
|
||||
SymbolInfo saved_si = si;
|
||||
SymbolInfo saved_si2 = si2;
|
||||
|
|
|
|||
|
|
@ -1003,6 +1003,8 @@ namespace PascalABCCompiler.TreeRealization
|
|||
if (deduced[par_num] == null)
|
||||
{
|
||||
//Этот тип-параметр ещё не был выведен.
|
||||
if (fact_type is delegated_methods && (fact_type as delegated_methods).empty_param_method != null && (fact_type as delegated_methods).empty_param_method.ret_type != null)
|
||||
fact_type = (fact_type as delegated_methods).empty_param_method.ret_type;
|
||||
deduced[par_num] = fact_type;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue