From 6400880643aed55b223c187d55645c678d29897a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Thu, 8 Mar 2018 20:32:11 +0100 Subject: [PATCH] bug fix #710 --- CodeCompletion/DomSyntaxTreeVisitor.cs | 41 +++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/CodeCompletion/DomSyntaxTreeVisitor.cs b/CodeCompletion/DomSyntaxTreeVisitor.cs index 7f5462631..c22d0208e 100644 --- a/CodeCompletion/DomSyntaxTreeVisitor.cs +++ b/CodeCompletion/DomSyntaxTreeVisitor.cs @@ -4097,26 +4097,27 @@ namespace CodeCompletion public override void visit(exception_handler _exception_handler) { SymScope tmp = cur_scope; - SymScope stmt_scope = new BlockScope(cur_scope); - cur_scope.AddName("$block_scope",stmt_scope); - stmt_scope.loc = get_location(_exception_handler); - stmt_scope.loc = new location(stmt_scope.loc.begin_line_num,stmt_scope.loc.begin_column_num, - _exception_handler.statements.source_context.end_position.line_num, - _exception_handler.statements.source_context.end_position.column_num,stmt_scope.loc.doc); - returned_scope = null; - if (_exception_handler.variable == null) return; - if (_exception_handler.type_name != null) - _exception_handler.type_name.visit(this); - else returned_scope = cur_scope.FindName(_exception_handler.variable.name); - if (returned_scope != null) - { - cur_scope = stmt_scope; - ElementScope es = new ElementScope(new SymInfo(_exception_handler.variable.name, SymbolKind.Variable,_exception_handler.variable.name),returned_scope,cur_scope); - es.loc = get_location(_exception_handler.variable); - stmt_scope.AddName(_exception_handler.variable.name,es); - } - _exception_handler.statements.visit(this); - cur_scope = tmp; + SymScope stmt_scope = new BlockScope(cur_scope); + cur_scope.AddName("$block_scope", stmt_scope); + stmt_scope.loc = get_location(_exception_handler); + if (_exception_handler.statements.source_context != null) + stmt_scope.loc = new location(stmt_scope.loc.begin_line_num, stmt_scope.loc.begin_column_num, + _exception_handler.statements.source_context.end_position.line_num, + _exception_handler.statements.source_context.end_position.column_num, stmt_scope.loc.doc); + returned_scope = null; + if (_exception_handler.variable == null) return; + if (_exception_handler.type_name != null) + _exception_handler.type_name.visit(this); + else returned_scope = cur_scope.FindName(_exception_handler.variable.name); + if (returned_scope != null) + { + cur_scope = stmt_scope; + ElementScope es = new ElementScope(new SymInfo(_exception_handler.variable.name, SymbolKind.Variable, _exception_handler.variable.name), returned_scope, cur_scope); + es.loc = get_location(_exception_handler.variable); + stmt_scope.AddName(_exception_handler.variable.name, es); + } + _exception_handler.statements.visit(this); + cur_scope = tmp; } public override void visit(exception_ident _exception_ident)