diff --git a/CodeCompletion/DomConverter.cs b/CodeCompletion/DomConverter.cs index d6cc95b38..3486155d2 100644 --- a/CodeCompletion/DomConverter.cs +++ b/CodeCompletion/DomConverter.cs @@ -111,6 +111,12 @@ namespace CodeCompletion if (ext_syms != null) lst.AddRange(ext_syms); RestoreCurrentUsedAssemblies(); + List lst_to_remove = new List(); + foreach (SymInfo si2 in lst) + if (si2.name.StartsWith("operator")) + lst_to_remove.Add(si2); + foreach (SymInfo si2 in lst_to_remove) + lst.Remove(si2); return lst.ToArray(); } else diff --git a/TreeConverter/TreeRealization/types.cs b/TreeConverter/TreeRealization/types.cs index 269211f7e..28e2bcc0b 100644 --- a/TreeConverter/TreeRealization/types.cs +++ b/TreeConverter/TreeRealization/types.cs @@ -2935,9 +2935,12 @@ namespace PascalABCCompiler.TreeRealization basic_function_node _int_and = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.and_name, ctn, SemanticTree.basic_function_type.iand); basic_function_node _int_or = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.or_name, ctn, SemanticTree.basic_function_type.ior); basic_function_node _int_xor = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.xor_name, ctn, SemanticTree.basic_function_type.ixor); - ctn.scope.AddSymbol(compiler_string_consts.and_name, new SymbolInfo(_int_and)); - ctn.scope.AddSymbol(compiler_string_consts.or_name, new SymbolInfo(_int_or)); - ctn.scope.AddSymbol(compiler_string_consts.xor_name, new SymbolInfo(_int_xor)); + if (ctn.scope != null) + { + ctn.scope.AddSymbol(compiler_string_consts.and_name, new SymbolInfo(_int_and)); + ctn.scope.AddSymbol(compiler_string_consts.or_name, new SymbolInfo(_int_or)); + ctn.scope.AddSymbol(compiler_string_consts.xor_name, new SymbolInfo(_int_xor)); + } } public void reinit_scope() @@ -3005,6 +3008,7 @@ namespace PascalABCCompiler.TreeRealization SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.greq_name, ctn, SemanticTree.basic_function_type.enumgreq, SystemLibrary.SystemLibrary.bool_type); SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.sm_name, ctn, SemanticTree.basic_function_type.enumsm, SystemLibrary.SystemLibrary.bool_type); SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.smeq_name, ctn, SemanticTree.basic_function_type.enumsmeq, SystemLibrary.SystemLibrary.bool_type); + InitEnumOperations(ctn); } //ctn.init_scope(); //TODO: Тут надо подумать. Может как-то сделать по другому?