diff --git a/Compiler/PCU/PCUWriter.cs b/Compiler/PCU/PCUWriter.cs index 4fb5d3ac5..f5d8e373f 100644 --- a/Compiler/PCU/PCUWriter.cs +++ b/Compiler/PCU/PCUWriter.cs @@ -3050,7 +3050,7 @@ namespace PascalABCCompiler.PCU //else //{ // bw.Write((byte)1); - if (meth.function_code == null) + if (meth.function_code == null || meth.name.IndexOf("") != -1) { VisitStatement(new empty_statement(null)); } @@ -3071,7 +3071,10 @@ namespace PascalABCCompiler.PCU //(ssyy) метки VisitLabelDeclarations(func.label_nodes_list); FixupCode(func); - VisitStatement(func.function_code); + if (func.name.IndexOf("") != -1) + VisitStatement(new empty_statement(null)); + else + VisitStatement(func.function_code); } private void VisitNestedFunctionImplementation(common_in_function_function_node func) diff --git a/NETGenerator/NETGenerator.cs b/NETGenerator/NETGenerator.cs index 6979cdd95..618f1c7a0 100644 --- a/NETGenerator/NETGenerator.cs +++ b/NETGenerator/NETGenerator.cs @@ -2569,8 +2569,6 @@ namespace PascalABCCompiler.NETGenerator return false; } - - //Ета штуковина все жутко тормозит. особенно генерацию EXE private void AddSpecialDebugVariables() { if (this.add_special_debug_variables) @@ -2610,7 +2608,10 @@ namespace PascalABCCompiler.NETGenerator foreach (ICommonNestedInFunctionFunctionNode f in func.functions_nodes) ConvertFunctionBody(f); //перевод тела - ConvertBody(func.function_code); + if (func.name.IndexOf("") == -1) + ConvertBody(func.function_code); + else + il.Emit(OpCodes.Ret); //ivan for debug if (save_debug_info) { @@ -6100,7 +6101,8 @@ namespace PascalABCCompiler.NETGenerator } else { - ConvertFunctionBody(value, copy_mi, true); + if (value.name.IndexOf("") == -1) + ConvertFunctionBody(value, copy_mi, true); //вызов статического метода-клона //при этом явно передается this il = methb.GetILGenerator(); diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index e8aab695f..0c522fd33 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -4158,8 +4158,7 @@ namespace PascalABCCompiler.TreeConverter { throw new NotSupportedError(get_location(_index_property)); } - - //TODO: Если одного из акцессоров нет? + public override void visit(SyntaxTree.simple_property _simple_property) { if (_simple_property.accessors == null)