public Variable getVariable(string name, int pos) { Variable rst = null; foreach (Variable v in m_variables) { if (v.Name != name) { continue; } if (v.StartPos > pos) { continue; } rst = v; } if (rst != null) { return(rst); } if (m_parent != null) { return(m_parent.getVariable(name, pos)); } return(null); }
public Variable getVariable(string name, int pos) { if (m_scope != null) { Scope s = m_scope.getScope(pos); Variable rst = s.getVariable(name, pos); if (rst != null) { return(rst); } } foreach (AutoCompleteData ac in Requires) { var rst = ac.Variables.getVariable(name, -1); if (rst != null && !rst.isPrivate()) { return(rst); } } return(getVariable(name)); }