diff --git a/CodeCompletion/DomConverter.cs b/CodeCompletion/DomConverter.cs index ff3efbfdb..5d9acc408 100644 --- a/CodeCompletion/DomConverter.cs +++ b/CodeCompletion/DomConverter.cs @@ -516,23 +516,6 @@ namespace CodeCompletion string s = CodeCompletionController.CurrentParser.LanguageInformation.GetSimpleDescriptionWithoutNamespace((si as ElementScope).sc as PascalABCCompiler.Parsers.ITypeScope); if (s != out_si.name) out_si.addit_name = s; - // if (((si as ElementScope).sc as TypeScope).TemplateArguments != null) - // { - // SymInfo tmp_si = new SymInfo(null,elems[i].kind,elems[i].describe); - // StringBuilder sb = new StringBuilder(); - // string[] template_args = ((si as ElementScope).sc as TypeScope).TemplateArguments; - // sb.Append(elems[i].name); - // sb.Append('<'); - // for (int j=0; j'); - // elems[i] = tmp_si; - // out_si = tmp_si; - // } } result_names.Add(elems[i]); } diff --git a/CodeCompletion/SymTable.cs b/CodeCompletion/SymTable.cs index 9f518cc76..e8c2b2f05 100644 --- a/CodeCompletion/SymTable.cs +++ b/CodeCompletion/SymTable.cs @@ -1743,7 +1743,7 @@ namespace CodeCompletion this.name = name; this.topScope = topScope; this.si = new SymInfo(name, SymbolKind.Method, name); - this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this); + //this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this); parameters = new List(); members = new List(); //UnitDocCache.AddDescribeToComplete(this); @@ -1755,7 +1755,7 @@ namespace CodeCompletion this.name = name; this.topScope = topScope; this.si = new SymInfo(name, SymbolKind.Method, name); - this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this); + //this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this); parameters = new List(); members = new List(); this.is_constructor = is_constructor; @@ -1935,7 +1935,7 @@ namespace CodeCompletion { if (documentation != null && documentation.Length > 0 && documentation[0] == '-') return; this.si.description = this.ToString(); - this.si.name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this); + this.si.addit_name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this); if (documentation != null) this.si.description += "\n" + this.documentation; } diff --git a/SyntaxTree/tree/SyntaxTemplates/SyntaxWithListMethods.txt b/SyntaxTree/tree/SyntaxTemplates/SyntaxWithListMethods.txt index 54848f6a2..d89c7d1de 100644 --- a/SyntaxTree/tree/SyntaxTemplates/SyntaxWithListMethods.txt +++ b/SyntaxTree/tree/SyntaxTemplates/SyntaxWithListMethods.txt @@ -31,22 +31,22 @@ private int FindIndexInList(<#ListElementType#> el) public void InsertAfter(<#ListElementType#> el, <#ListElementType#> newel) { - <#ListName#>.Insert(FindIndex(el) + 1, newel); + <#ListName#>.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(<#ListElementType#> el, IEnumerable<<#ListElementType#>> newels) { - <#ListName#>.InsertRange(FindIndex(el) + 1, newels); + <#ListName#>.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(<#ListElementType#> el, <#ListElementType#> newel) { - <#ListName#>.Insert(FindIndex(el), newel); + <#ListName#>.Insert(FindIndexInList(el), newel); } public void InsertBefore(<#ListElementType#> el, IEnumerable<<#ListElementType#>> newels) { - <#ListName#>.InsertRange(FindIndex(el), newels); + <#ListName#>.InsertRange(FindIndexInList(el), newels); } public bool Remove(<#ListElementType#> el) diff --git a/SyntaxTree/tree/Tree.cs b/SyntaxTree/tree/Tree.cs index 4c4b8a588..8332d8599 100644 --- a/SyntaxTree/tree/Tree.cs +++ b/SyntaxTree/tree/Tree.cs @@ -433,22 +433,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(statement el, statement newel) { - subnodes.Insert(FindIndex(el) + 1, newel); + subnodes.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(statement el, IEnumerable newels) { - subnodes.InsertRange(FindIndex(el) + 1, newels); + subnodes.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(statement el, statement newel) { - subnodes.Insert(FindIndex(el), newel); + subnodes.Insert(FindIndexInList(el), newel); } public void InsertBefore(statement el, IEnumerable newels) { - subnodes.InsertRange(FindIndex(el), newels); + subnodes.InsertRange(FindIndexInList(el), newels); } public bool Remove(statement el) @@ -2303,22 +2303,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(ident el, ident newel) { - names.Insert(FindIndex(el) + 1, newel); + names.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(ident el, IEnumerable newels) { - names.InsertRange(FindIndex(el) + 1, newels); + names.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(ident el, ident newel) { - names.Insert(FindIndex(el), newel); + names.Insert(FindIndexInList(el), newel); } public void InsertBefore(ident el, IEnumerable newels) { - names.InsertRange(FindIndex(el), newels); + names.InsertRange(FindIndexInList(el), newels); } public bool Remove(ident el) @@ -2552,22 +2552,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(var_def_statement el, var_def_statement newel) { - var_definitions.Insert(FindIndex(el) + 1, newel); + var_definitions.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(var_def_statement el, IEnumerable newels) { - var_definitions.InsertRange(FindIndex(el) + 1, newels); + var_definitions.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(var_def_statement el, var_def_statement newel) { - var_definitions.Insert(FindIndex(el), newel); + var_definitions.Insert(FindIndexInList(el), newel); } public void InsertBefore(var_def_statement el, IEnumerable newels) { - var_definitions.InsertRange(FindIndex(el), newels); + var_definitions.InsertRange(FindIndexInList(el), newels); } public bool Remove(var_def_statement el) @@ -2785,22 +2785,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(ident el, ident newel) { - idents.Insert(FindIndex(el) + 1, newel); + idents.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(ident el, IEnumerable newels) { - idents.InsertRange(FindIndex(el) + 1, newels); + idents.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(ident el, ident newel) { - idents.Insert(FindIndex(el), newel); + idents.Insert(FindIndexInList(el), newel); } public void InsertBefore(ident el, IEnumerable newels) { - idents.InsertRange(FindIndex(el), newels); + idents.InsertRange(FindIndexInList(el), newels); } public bool Remove(ident el) @@ -3375,22 +3375,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(declaration el, declaration newel) { - defs.Insert(FindIndex(el) + 1, newel); + defs.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(declaration el, IEnumerable newels) { - defs.InsertRange(FindIndex(el) + 1, newels); + defs.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(declaration el, declaration newel) { - defs.Insert(FindIndex(el), newel); + defs.Insert(FindIndexInList(el), newel); } public void InsertBefore(declaration el, IEnumerable newels) { - defs.InsertRange(FindIndex(el), newels); + defs.InsertRange(FindIndexInList(el), newels); } public bool Remove(declaration el) @@ -3603,22 +3603,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(compilation_unit el, compilation_unit newel) { - compilation_units.Insert(FindIndex(el) + 1, newel); + compilation_units.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(compilation_unit el, IEnumerable newels) { - compilation_units.InsertRange(FindIndex(el) + 1, newels); + compilation_units.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(compilation_unit el, compilation_unit newel) { - compilation_units.Insert(FindIndex(el), newel); + compilation_units.Insert(FindIndexInList(el), newel); } public void InsertBefore(compilation_unit el, IEnumerable newels) { - compilation_units.InsertRange(FindIndex(el), newels); + compilation_units.InsertRange(FindIndexInList(el), newels); } public bool Remove(compilation_unit el) @@ -4083,22 +4083,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(expression el, expression newel) { - expressions.Insert(FindIndex(el) + 1, newel); + expressions.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(expression el, IEnumerable newels) { - expressions.InsertRange(FindIndex(el) + 1, newels); + expressions.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(expression el, expression newel) { - expressions.Insert(FindIndex(el), newel); + expressions.Insert(FindIndexInList(el), newel); } public void InsertBefore(expression el, IEnumerable newels) { - expressions.InsertRange(FindIndex(el), newels); + expressions.InsertRange(FindIndexInList(el), newels); } public bool Remove(expression el) @@ -5844,22 +5844,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(type_definition el, type_definition newel) { - indexers.Insert(FindIndex(el) + 1, newel); + indexers.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(type_definition el, IEnumerable newels) { - indexers.InsertRange(FindIndex(el) + 1, newels); + indexers.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(type_definition el, type_definition newel) { - indexers.Insert(FindIndex(el), newel); + indexers.Insert(FindIndexInList(el), newel); } public void InsertBefore(type_definition el, IEnumerable newels) { - indexers.InsertRange(FindIndex(el), newels); + indexers.InsertRange(FindIndexInList(el), newels); } public bool Remove(type_definition el) @@ -6776,22 +6776,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(typed_parameters el, typed_parameters newel) { - params_list.Insert(FindIndex(el) + 1, newel); + params_list.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(typed_parameters el, IEnumerable newels) { - params_list.InsertRange(FindIndex(el) + 1, newels); + params_list.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(typed_parameters el, typed_parameters newel) { - params_list.Insert(FindIndex(el), newel); + params_list.Insert(FindIndexInList(el), newel); } public void InsertBefore(typed_parameters el, IEnumerable newels) { - params_list.InsertRange(FindIndex(el), newels); + params_list.InsertRange(FindIndexInList(el), newels); } public bool Remove(typed_parameters el) @@ -7004,22 +7004,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(procedure_attribute el, procedure_attribute newel) { - proc_attributes.Insert(FindIndex(el) + 1, newel); + proc_attributes.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(procedure_attribute el, IEnumerable newels) { - proc_attributes.InsertRange(FindIndex(el) + 1, newels); + proc_attributes.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(procedure_attribute el, procedure_attribute newel) { - proc_attributes.Insert(FindIndex(el), newel); + proc_attributes.Insert(FindIndexInList(el), newel); } public void InsertBefore(procedure_attribute el, IEnumerable newels) { - proc_attributes.InsertRange(FindIndex(el), newels); + proc_attributes.InsertRange(FindIndexInList(el), newels); } public bool Remove(procedure_attribute el) @@ -8137,22 +8137,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(type_declaration el, type_declaration newel) { - types_decl.Insert(FindIndex(el) + 1, newel); + types_decl.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(type_declaration el, IEnumerable newels) { - types_decl.InsertRange(FindIndex(el) + 1, newels); + types_decl.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(type_declaration el, type_declaration newel) { - types_decl.Insert(FindIndex(el), newel); + types_decl.Insert(FindIndexInList(el), newel); } public void InsertBefore(type_declaration el, IEnumerable newels) { - types_decl.InsertRange(FindIndex(el), newels); + types_decl.InsertRange(FindIndexInList(el), newels); } public bool Remove(type_declaration el) @@ -8842,22 +8842,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(const_definition el, const_definition newel) { - const_defs.Insert(FindIndex(el) + 1, newel); + const_defs.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(const_definition el, IEnumerable newels) { - const_defs.InsertRange(FindIndex(el) + 1, newels); + const_defs.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(const_definition el, const_definition newel) { - const_defs.Insert(FindIndex(el), newel); + const_defs.Insert(FindIndexInList(el), newel); } public void InsertBefore(const_definition el, IEnumerable newels) { - const_defs.InsertRange(FindIndex(el), newels); + const_defs.InsertRange(FindIndexInList(el), newels); } public bool Remove(const_definition el) @@ -9516,22 +9516,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(unit_or_namespace el, unit_or_namespace newel) { - units.Insert(FindIndex(el) + 1, newel); + units.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(unit_or_namespace el, IEnumerable newels) { - units.InsertRange(FindIndex(el) + 1, newels); + units.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(unit_or_namespace el, unit_or_namespace newel) { - units.Insert(FindIndex(el), newel); + units.Insert(FindIndexInList(el), newel); } public void InsertBefore(unit_or_namespace el, IEnumerable newels) { - units.InsertRange(FindIndex(el), newels); + units.InsertRange(FindIndexInList(el), newels); } public bool Remove(unit_or_namespace el) @@ -9995,22 +9995,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(compiler_directive el, compiler_directive newel) { - compiler_directives.Insert(FindIndex(el) + 1, newel); + compiler_directives.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(compiler_directive el, IEnumerable newels) { - compiler_directives.InsertRange(FindIndex(el) + 1, newels); + compiler_directives.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(compiler_directive el, compiler_directive newel) { - compiler_directives.Insert(FindIndex(el), newel); + compiler_directives.Insert(FindIndexInList(el), newel); } public void InsertBefore(compiler_directive el, IEnumerable newels) { - compiler_directives.InsertRange(FindIndex(el), newels); + compiler_directives.InsertRange(FindIndexInList(el), newels); } public bool Remove(compiler_directive el) @@ -11487,22 +11487,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(ident el, ident newel) { - ln.Insert(FindIndex(el) + 1, newel); + ln.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(ident el, IEnumerable newels) { - ln.InsertRange(FindIndex(el) + 1, newels); + ln.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(ident el, ident newel) { - ln.Insert(FindIndex(el), newel); + ln.Insert(FindIndexInList(el), newel); } public void InsertBefore(ident el, IEnumerable newels) { - ln.InsertRange(FindIndex(el), newels); + ln.InsertRange(FindIndexInList(el), newels); } public bool Remove(ident el) @@ -13894,22 +13894,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(declaration el, declaration newel) { - members.Insert(FindIndex(el) + 1, newel); + members.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(declaration el, IEnumerable newels) { - members.InsertRange(FindIndex(el) + 1, newels); + members.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(declaration el, declaration newel) { - members.Insert(FindIndex(el), newel); + members.Insert(FindIndexInList(el), newel); } public void InsertBefore(declaration el, IEnumerable newels) { - members.InsertRange(FindIndex(el), newels); + members.InsertRange(FindIndexInList(el), newels); } public bool Remove(declaration el) @@ -14254,22 +14254,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(class_members el, class_members newel) { - class_def_blocks.Insert(FindIndex(el) + 1, newel); + class_def_blocks.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(class_members el, IEnumerable newels) { - class_def_blocks.InsertRange(FindIndex(el) + 1, newels); + class_def_blocks.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(class_members el, class_members newel) { - class_def_blocks.Insert(FindIndex(el), newel); + class_def_blocks.Insert(FindIndexInList(el), newel); } public void InsertBefore(class_members el, IEnumerable newels) { - class_def_blocks.InsertRange(FindIndex(el), newels); + class_def_blocks.InsertRange(FindIndexInList(el), newels); } public bool Remove(class_members el) @@ -15396,22 +15396,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(record_const_definition el, record_const_definition newel) { - rec_consts.Insert(FindIndex(el) + 1, newel); + rec_consts.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(record_const_definition el, IEnumerable newels) { - rec_consts.InsertRange(FindIndex(el) + 1, newels); + rec_consts.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(record_const_definition el, record_const_definition newel) { - rec_consts.Insert(FindIndex(el), newel); + rec_consts.Insert(FindIndexInList(el), newel); } public void InsertBefore(record_const_definition el, IEnumerable newels) { - rec_consts.InsertRange(FindIndex(el), newels); + rec_consts.InsertRange(FindIndexInList(el), newels); } public bool Remove(record_const_definition el) @@ -16367,22 +16367,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(literal el, literal newel) { - literals.Insert(FindIndex(el) + 1, newel); + literals.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(literal el, IEnumerable newels) { - literals.InsertRange(FindIndex(el) + 1, newels); + literals.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(literal el, literal newel) { - literals.Insert(FindIndex(el), newel); + literals.Insert(FindIndexInList(el), newel); } public void InsertBefore(literal el, IEnumerable newels) { - literals.InsertRange(FindIndex(el), newels); + literals.InsertRange(FindIndexInList(el), newels); } public bool Remove(literal el) @@ -16954,22 +16954,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(variant el, variant newel) { - vars.Insert(FindIndex(el) + 1, newel); + vars.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(variant el, IEnumerable newels) { - vars.InsertRange(FindIndex(el) + 1, newels); + vars.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(variant el, variant newel) { - vars.Insert(FindIndex(el), newel); + vars.Insert(FindIndexInList(el), newel); } public void InsertBefore(variant el, IEnumerable newels) { - vars.InsertRange(FindIndex(el), newels); + vars.InsertRange(FindIndexInList(el), newels); } public bool Remove(variant el) @@ -17341,22 +17341,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(variant_type el, variant_type newel) { - vars.Insert(FindIndex(el) + 1, newel); + vars.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(variant_type el, IEnumerable newels) { - vars.InsertRange(FindIndex(el) + 1, newels); + vars.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(variant_type el, variant_type newel) { - vars.Insert(FindIndex(el), newel); + vars.Insert(FindIndexInList(el), newel); } public void InsertBefore(variant_type el, IEnumerable newels) { - vars.InsertRange(FindIndex(el), newels); + vars.InsertRange(FindIndexInList(el), newels); } public bool Remove(variant_type el) @@ -20185,22 +20185,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(case_variant el, case_variant newel) { - variants.Insert(FindIndex(el) + 1, newel); + variants.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(case_variant el, IEnumerable newels) { - variants.InsertRange(FindIndex(el) + 1, newels); + variants.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(case_variant el, case_variant newel) { - variants.Insert(FindIndex(el), newel); + variants.Insert(FindIndexInList(el), newel); } public void InsertBefore(case_variant el, IEnumerable newels) { - variants.InsertRange(FindIndex(el), newels); + variants.InsertRange(FindIndexInList(el), newels); } public bool Remove(case_variant el) @@ -20577,22 +20577,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(var_def_statement el, var_def_statement newel) { - vars.Insert(FindIndex(el) + 1, newel); + vars.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(var_def_statement el, IEnumerable newels) { - vars.InsertRange(FindIndex(el) + 1, newels); + vars.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(var_def_statement el, var_def_statement newel) { - vars.Insert(FindIndex(el), newel); + vars.Insert(FindIndexInList(el), newel); } public void InsertBefore(var_def_statement el, IEnumerable newels) { - vars.InsertRange(FindIndex(el), newels); + vars.InsertRange(FindIndexInList(el), newels); } public bool Remove(var_def_statement el) @@ -21391,22 +21391,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(property_parameter el, property_parameter newel) { - parameters.Insert(FindIndex(el) + 1, newel); + parameters.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(property_parameter el, IEnumerable newels) { - parameters.InsertRange(FindIndex(el) + 1, newels); + parameters.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(property_parameter el, property_parameter newel) { - parameters.Insert(FindIndex(el), newel); + parameters.Insert(FindIndexInList(el), newel); } public void InsertBefore(property_parameter el, IEnumerable newels) { - parameters.InsertRange(FindIndex(el), newels); + parameters.InsertRange(FindIndexInList(el), newels); } public bool Remove(property_parameter el) @@ -23142,22 +23142,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(exception_handler el, exception_handler newel) { - handlers.Insert(FindIndex(el) + 1, newel); + handlers.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(exception_handler el, IEnumerable newels) { - handlers.InsertRange(FindIndex(el) + 1, newels); + handlers.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(exception_handler el, exception_handler newel) { - handlers.Insert(FindIndex(el), newel); + handlers.Insert(FindIndexInList(el), newel); } public void InsertBefore(exception_handler el, IEnumerable newels) { - handlers.InsertRange(FindIndex(el), newels); + handlers.InsertRange(FindIndexInList(el), newels); } public bool Remove(exception_handler el) @@ -24309,22 +24309,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(unit_or_namespace el, unit_or_namespace newel) { - namespaces.Insert(FindIndex(el) + 1, newel); + namespaces.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(unit_or_namespace el, IEnumerable newels) { - namespaces.InsertRange(FindIndex(el) + 1, newels); + namespaces.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(unit_or_namespace el, unit_or_namespace newel) { - namespaces.Insert(FindIndex(el), newel); + namespaces.Insert(FindIndexInList(el), newel); } public void InsertBefore(unit_or_namespace el, IEnumerable newels) { - namespaces.InsertRange(FindIndex(el), newels); + namespaces.InsertRange(FindIndexInList(el), newels); } public bool Remove(unit_or_namespace el) @@ -25134,22 +25134,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(named_type_reference el, named_type_reference newel) { - types.Insert(FindIndex(el) + 1, newel); + types.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(named_type_reference el, IEnumerable newels) { - types.InsertRange(FindIndex(el) + 1, newels); + types.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(named_type_reference el, named_type_reference newel) { - types.Insert(FindIndex(el), newel); + types.Insert(FindIndexInList(el), newel); } public void InsertBefore(named_type_reference el, IEnumerable newels) { - types.InsertRange(FindIndex(el), newels); + types.InsertRange(FindIndexInList(el), newels); } public bool Remove(named_type_reference el) @@ -25381,22 +25381,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(type_definition el, type_definition newel) { - params_list.Insert(FindIndex(el) + 1, newel); + params_list.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(type_definition el, IEnumerable newels) { - params_list.InsertRange(FindIndex(el) + 1, newels); + params_list.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(type_definition el, type_definition newel) { - params_list.Insert(FindIndex(el), newel); + params_list.Insert(FindIndexInList(el), newel); } public void InsertBefore(type_definition el, IEnumerable newels) { - params_list.InsertRange(FindIndex(el), newels); + params_list.InsertRange(FindIndexInList(el), newels); } public bool Remove(type_definition el) @@ -26310,22 +26310,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(type_definition el, type_definition newel) { - defs.Insert(FindIndex(el) + 1, newel); + defs.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(type_definition el, IEnumerable newels) { - defs.InsertRange(FindIndex(el) + 1, newels); + defs.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(type_definition el, type_definition newel) { - defs.Insert(FindIndex(el), newel); + defs.Insert(FindIndexInList(el), newel); } public void InsertBefore(type_definition el, IEnumerable newels) { - defs.InsertRange(FindIndex(el), newels); + defs.InsertRange(FindIndexInList(el), newels); } public bool Remove(type_definition el) @@ -26697,22 +26697,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(where_definition el, where_definition newel) { - defs.Insert(FindIndex(el) + 1, newel); + defs.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(where_definition el, IEnumerable newels) { - defs.InsertRange(FindIndex(el) + 1, newels); + defs.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(where_definition el, where_definition newel) { - defs.Insert(FindIndex(el), newel); + defs.Insert(FindIndexInList(el), newel); } public void InsertBefore(where_definition el, IEnumerable newels) { - defs.InsertRange(FindIndex(el), newels); + defs.InsertRange(FindIndexInList(el), newels); } public bool Remove(where_definition el) @@ -28842,22 +28842,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(enumerator el, enumerator newel) { - enumerators.Insert(FindIndex(el) + 1, newel); + enumerators.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(enumerator el, IEnumerable newels) { - enumerators.InsertRange(FindIndex(el) + 1, newels); + enumerators.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(enumerator el, enumerator newel) { - enumerators.Insert(FindIndex(el), newel); + enumerators.Insert(FindIndexInList(el), newel); } public void InsertBefore(enumerator el, IEnumerable newels) { - enumerators.InsertRange(FindIndex(el), newels); + enumerators.InsertRange(FindIndexInList(el), newels); } public bool Remove(enumerator el) @@ -29473,22 +29473,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(type_definition_attr el, type_definition_attr newel) { - attributes.Insert(FindIndex(el) + 1, newel); + attributes.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(type_definition_attr el, IEnumerable newels) { - attributes.InsertRange(FindIndex(el) + 1, newels); + attributes.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(type_definition_attr el, type_definition_attr newel) { - attributes.Insert(FindIndex(el), newel); + attributes.Insert(FindIndexInList(el), newel); } public void InsertBefore(type_definition_attr el, IEnumerable newels) { - attributes.InsertRange(FindIndex(el), newels); + attributes.InsertRange(FindIndexInList(el), newels); } public bool Remove(type_definition_attr el) @@ -30042,22 +30042,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(compiler_directive el, compiler_directive newel) { - directives.Insert(FindIndex(el) + 1, newel); + directives.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(compiler_directive el, IEnumerable newels) { - directives.InsertRange(FindIndex(el) + 1, newels); + directives.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(compiler_directive el, compiler_directive newel) { - directives.Insert(FindIndex(el), newel); + directives.Insert(FindIndexInList(el), newel); } public void InsertBefore(compiler_directive el, IEnumerable newels) { - directives.InsertRange(FindIndex(el), newels); + directives.InsertRange(FindIndexInList(el), newels); } public bool Remove(compiler_directive el) @@ -30498,22 +30498,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(documentation_comment_section el, documentation_comment_section newel) { - sections.Insert(FindIndex(el) + 1, newel); + sections.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(documentation_comment_section el, IEnumerable newels) { - sections.InsertRange(FindIndex(el) + 1, newels); + sections.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(documentation_comment_section el, documentation_comment_section newel) { - sections.Insert(FindIndex(el), newel); + sections.Insert(FindIndexInList(el), newel); } public void InsertBefore(documentation_comment_section el, IEnumerable newels) { - sections.InsertRange(FindIndex(el), newels); + sections.InsertRange(FindIndexInList(el), newels); } public bool Remove(documentation_comment_section el) @@ -30762,22 +30762,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(documentation_comment_tag_param el, documentation_comment_tag_param newel) { - parameters.Insert(FindIndex(el) + 1, newel); + parameters.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(documentation_comment_tag_param el, IEnumerable newels) { - parameters.InsertRange(FindIndex(el) + 1, newels); + parameters.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(documentation_comment_tag_param el, documentation_comment_tag_param newel) { - parameters.Insert(FindIndex(el), newel); + parameters.Insert(FindIndexInList(el), newel); } public void InsertBefore(documentation_comment_tag_param el, IEnumerable newels) { - parameters.InsertRange(FindIndex(el), newels); + parameters.InsertRange(FindIndexInList(el), newels); } public bool Remove(documentation_comment_tag_param el) @@ -31145,22 +31145,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(documentation_comment_tag el, documentation_comment_tag newel) { - tags.Insert(FindIndex(el) + 1, newel); + tags.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(documentation_comment_tag el, IEnumerable newels) { - tags.InsertRange(FindIndex(el) + 1, newels); + tags.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(documentation_comment_tag el, documentation_comment_tag newel) { - tags.Insert(FindIndex(el), newel); + tags.Insert(FindIndexInList(el), newel); } public void InsertBefore(documentation_comment_tag el, IEnumerable newels) { - tags.InsertRange(FindIndex(el), newels); + tags.InsertRange(FindIndexInList(el), newels); } public bool Remove(documentation_comment_tag el) @@ -32466,22 +32466,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(attribute el, attribute newel) { - attributes.Insert(FindIndex(el) + 1, newel); + attributes.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(attribute el, IEnumerable newels) { - attributes.InsertRange(FindIndex(el) + 1, newels); + attributes.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(attribute el, attribute newel) { - attributes.Insert(FindIndex(el), newel); + attributes.Insert(FindIndexInList(el), newel); } public void InsertBefore(attribute el, IEnumerable newels) { - attributes.InsertRange(FindIndex(el), newels); + attributes.InsertRange(FindIndexInList(el), newels); } public bool Remove(attribute el) @@ -32694,22 +32694,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(simple_attribute_list el, simple_attribute_list newel) { - attributes.Insert(FindIndex(el) + 1, newel); + attributes.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(simple_attribute_list el, IEnumerable newels) { - attributes.InsertRange(FindIndex(el) + 1, newels); + attributes.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(simple_attribute_list el, simple_attribute_list newel) { - attributes.Insert(FindIndex(el), newel); + attributes.Insert(FindIndexInList(el), newel); } public void InsertBefore(simple_attribute_list el, IEnumerable newels) { - attributes.InsertRange(FindIndex(el), newels); + attributes.InsertRange(FindIndexInList(el), newels); } public bool Remove(simple_attribute_list el) @@ -33102,22 +33102,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(declaration el, declaration newel) { - defs.Insert(FindIndex(el) + 1, newel); + defs.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(declaration el, IEnumerable newels) { - defs.InsertRange(FindIndex(el) + 1, newels); + defs.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(declaration el, declaration newel) { - defs.Insert(FindIndex(el), newel); + defs.Insert(FindIndexInList(el), newel); } public void InsertBefore(declaration el, IEnumerable newels) { - defs.InsertRange(FindIndex(el), newels); + defs.InsertRange(FindIndexInList(el), newels); } public bool Remove(declaration el) @@ -33614,22 +33614,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(syntax_tree_node el, syntax_tree_node newel) { - param.Insert(FindIndex(el) + 1, newel); + param.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(syntax_tree_node el, IEnumerable newels) { - param.InsertRange(FindIndex(el) + 1, newels); + param.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(syntax_tree_node el, syntax_tree_node newel) { - param.Insert(FindIndex(el), newel); + param.Insert(FindIndexInList(el), newel); } public void InsertBefore(syntax_tree_node el, IEnumerable newels) { - param.InsertRange(FindIndex(el), newels); + param.InsertRange(FindIndexInList(el), newels); } public bool Remove(syntax_tree_node el) @@ -34329,22 +34329,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(name_assign_expr el, name_assign_expr newel) { - name_expr.Insert(FindIndex(el) + 1, newel); + name_expr.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(name_assign_expr el, IEnumerable newels) { - name_expr.InsertRange(FindIndex(el) + 1, newels); + name_expr.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(name_assign_expr el, name_assign_expr newel) { - name_expr.Insert(FindIndex(el), newel); + name_expr.Insert(FindIndexInList(el), newel); } public void InsertBefore(name_assign_expr el, IEnumerable newels) { - name_expr.InsertRange(FindIndex(el), newels); + name_expr.InsertRange(FindIndexInList(el), newels); } public bool Remove(name_assign_expr el) @@ -36655,22 +36655,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(addressed_value el, addressed_value newel) { - variables.Insert(FindIndex(el) + 1, newel); + variables.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(addressed_value el, IEnumerable newels) { - variables.InsertRange(FindIndex(el) + 1, newels); + variables.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(addressed_value el, addressed_value newel) { - variables.Insert(FindIndex(el), newel); + variables.Insert(FindIndexInList(el), newel); } public void InsertBefore(addressed_value el, IEnumerable newels) { - variables.InsertRange(FindIndex(el), newels); + variables.InsertRange(FindIndexInList(el), newels); } public bool Remove(addressed_value el) @@ -37038,22 +37038,22 @@ namespace PascalABCCompiler.SyntaxTree public void InsertAfter(uses_list el, uses_list newel) { - listunitsections.Insert(FindIndex(el) + 1, newel); + listunitsections.Insert(FindIndexInList(el) + 1, newel); } public void InsertAfter(uses_list el, IEnumerable newels) { - listunitsections.InsertRange(FindIndex(el) + 1, newels); + listunitsections.InsertRange(FindIndexInList(el) + 1, newels); } public void InsertBefore(uses_list el, uses_list newel) { - listunitsections.Insert(FindIndex(el), newel); + listunitsections.Insert(FindIndexInList(el), newel); } public void InsertBefore(uses_list el, IEnumerable newels) { - listunitsections.InsertRange(FindIndex(el), newels); + listunitsections.InsertRange(FindIndexInList(el), newels); } public bool Remove(uses_list el) diff --git a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs index 0628c746a..7610afb87 100644 --- a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs +++ b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs @@ -332,6 +332,8 @@ namespace TreeConverter.LambdaExpressions.Closure else { var si = forScope.SymbolInfoLoopVar; + if (!_capturedVarsTreeNodesDictionary.ContainsKey(si.scope.ScopeNum)) + return; var scopeWhereVarDefined = _capturedVarsTreeNodesDictionary[si.scope.ScopeNum]; var idRef = scopeWhereVarDefined .VariablesDefinedInScope diff --git a/VisualPascalABCNET/AboutBox.Designer.cs b/VisualPascalABCNET/AboutBox.Designer.cs index 854c8184f..44cb07c0e 100644 --- a/VisualPascalABCNET/AboutBox.Designer.cs +++ b/VisualPascalABCNET/AboutBox.Designer.cs @@ -168,7 +168,7 @@ this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(311, 13); this.label12.TabIndex = 17; - this.label12.Text = "Copyright (c) 2005, 2016 Ivan Bondarev, Stanislav Mihalkovich"; + this.label12.Text = "Copyright (c) 2005, 2017 Ivan Bondarev, Stanislav Mihalkovich"; this.label12.Click += new System.EventHandler(this.label12_Click); // // label9 diff --git a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHelpers.cs b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHelpers.cs index 231fc55bc..8196e9a49 100644 --- a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHelpers.cs +++ b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHelpers.cs @@ -68,16 +68,19 @@ namespace VisualPascalABC public class DefaultDispatcher : CodeCompletion.AbstractDispatcher { private Dictionary dict = new Dictionary(); - + private Dictionary dict2 = new Dictionary(); public void Reset() { dict.Clear(); + dict2.Clear(); } public void Add(PascalABCCompiler.Parsers.SymInfo si, ICompletionData data) { if (!dict.ContainsKey(si)) - dict[si] = data; + dict[si] = data; + if (!dict2.ContainsKey(si.description)) + dict2[si.description] = data; } public override void Update(PascalABCCompiler.Parsers.SymInfo si) @@ -87,6 +90,10 @@ namespace VisualPascalABC { val.Description = si.description; } + else if (si.description != null && dict2.TryGetValue(si.description.Split('\n')[0], out val)) + { + val.Description = si.description; + } } } }