From 3d58e804069e5acc282dad6a00ec0cebbc32267d Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Mon, 6 Jul 2020 23:31:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeCompletion/CodeFormatter.cs | 8 +++++++ CodeCompletion/ExpressionVisitor.cs | 33 +++++++++++++++++------------ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CodeCompletion/CodeFormatter.cs b/CodeCompletion/CodeFormatter.cs index c1e3720fb..6f65575cc 100644 --- a/CodeCompletion/CodeFormatter.cs +++ b/CodeCompletion/CodeFormatter.cs @@ -3411,6 +3411,14 @@ namespace CodeFormatters visit_node(_if_expr_new.if_false); } } + + public override void visit(array_const_new acn) + { + sb.Append("|"); + visit_node(acn.elements); + //sb.Append("|"); + } + #endregion } } \ No newline at end of file diff --git a/CodeCompletion/ExpressionVisitor.cs b/CodeCompletion/ExpressionVisitor.cs index d5091a0ab..870370938 100644 --- a/CodeCompletion/ExpressionVisitor.cs +++ b/CodeCompletion/ExpressionVisitor.cs @@ -180,7 +180,7 @@ namespace CodeCompletion { TypeSynonim ts = (returned_scopes[i] as ElementScope).sc as TypeSynonim; TypeScope act_ts = ts.GetLeafActType(); - ProcType procType =act_ts as ProcType; + ProcType procType = act_ts as ProcType; if (procType != null) { ProcScope tmp = procType.target; @@ -346,7 +346,7 @@ namespace CodeCompletion { returned_scope = entry_scope; return; - } + } if (returned_scope is ProcScope && (returned_scope as ProcScope).parameters.Count != 0) { returned_scopes = entry_scope.FindOverloadNames(_ident.name); @@ -827,7 +827,7 @@ namespace CodeCompletion _dot_node.left.visit(this); search_all = tmp2; by_dot = tmp; - + if (returned_scope != null && returned_scope is ElementScope && (returned_scope as ElementScope).sc is ProcScope) { if (((returned_scope as ElementScope).sc as ProcScope).return_type != null) @@ -837,7 +837,7 @@ namespace CodeCompletion } else if (returned_scope != null && returned_scope is ProcScope) { - + ProcScope ps = returned_scope as ProcScope; if (ps.return_type == null) { @@ -854,7 +854,7 @@ namespace CodeCompletion TypeScope ts = ((returned_scope as ElementScope).sc as ProcType).target.return_type; if (ts != null) returned_scope = new ElementScope(ts); - + } else if ((returned_scope != null && returned_scope is ElementScope && (returned_scope as ElementScope).sc is CompiledScope && ((returned_scope as ElementScope).sc as CompiledScope).IsDelegate) && _dot_node.left is method_call) { @@ -1659,14 +1659,14 @@ namespace CodeCompletion returned_scope = returned_scope.FindNameOnlyInType(_template_type_reference.name.names[i].name + suffix); if (returned_scope == null) returned_scope = entry_scope.FindNameOnlyInType(_template_type_reference.name.names[i].name + suffix); - } + } else { returned_scope = returned_scope.FindName(_template_type_reference.name.names[i].name + suffix); if (returned_scope == null) returned_scope = entry_scope.FindName(_template_type_reference.name.names[i].name); } - + if (returned_scope == null) return; } @@ -1766,7 +1766,7 @@ namespace CodeCompletion public override void visit(var_statement _var_statement) { - + } public override void visit(question_colon_expression _question_colon_expression) @@ -1952,7 +1952,7 @@ namespace CodeCompletion _function_lambda_definition.proc_body.visit(this); if (returned_scope is ElementScope) returned_scope = (returned_scope as ElementScope).sc; - ps.return_type = new UnknownScope(new SymInfo("",SymbolKind.Class,""));// returned_scope as TypeScope; + ps.return_type = new UnknownScope(new SymInfo("", SymbolKind.Class, ""));// returned_scope as TypeScope; returned_scope = new ProcType(ps); } public override void visit(function_lambda_call _function_lambda_call) @@ -1980,11 +1980,11 @@ namespace CodeCompletion public override void visit(semantic_type_node stn) // SSM { } - + public override void visit(slice_expr _slice_expr) - { - _slice_expr.v.visit(this); - } + { + _slice_expr.v.visit(this); + } public override void visit(slice_expr_question _slice_expr_question) { @@ -2010,9 +2010,14 @@ namespace CodeCompletion returned_scope = new ElementScope(ts);*/ method_call mc = new method_call(); - mc.parameters = new expression_list(new List { _diapason_expr_new.left, _diapason_expr_new.right}); + mc.parameters = new expression_list(new List { _diapason_expr_new.left, _diapason_expr_new.right }); mc.dereferencing_value = new dot_node(new ident("PABCSystem"), new ident("InternalRange")); mc.visit(this); } + + public override void visit(array_const_new acn) + { + + } } }