This commit is contained in:
Бондарев Иван 2017-10-12 20:52:33 +02:00
parent c22e32b299
commit d0900679e3
3 changed files with 18 additions and 3 deletions

View file

@ -70,7 +70,8 @@ namespace CodeCompletion
foreach (statement stmt in _statement_list.subnodes)
{
IBaseScope tmp2 = cur_scope;
cur_scope = cur_scope.FindScopeByLocation(stmt.source_context.begin_position.line_num, stmt.source_context.begin_position.column_num);
if (stmt.source_context != null)
cur_scope = cur_scope.FindScopeByLocation(stmt.source_context.begin_position.line_num, stmt.source_context.begin_position.column_num);
if (cur_scope == null)
cur_scope = tmp2;
stmt.visit(this);

View file

@ -1511,11 +1511,12 @@ namespace CodeCompletion
public override SymScope FindName(string name)
{
//SymScope sc = ht[name] as SymScope;
SymScope sc = def_proc.FindNameOnlyInType(name);
/*SymScope sc = def_proc.FindNameOnlyInType(name);
if (sc != null) return sc;
if (top_mod_scope != null)
return top_mod_scope.FindName(name);
return null;
return null;*/
return def_proc.FindName(name);
}
public override SymScope FindNameOnlyInType(string name)

View file

@ -0,0 +1,13 @@
type
t1=class
i:integer;
procedure p1;
end;
procedure t1.p1 := writeln(i{@var t1.i: integer;@});
begin
end.