Perform unqualified name lookup by following the chain of scopes up until found.
location to use for error messages
name to look up
if supplied and name is found, set to scope that ident was found in
modify search based on flags
symbol if found, null if not
See Implementation
Perform unqualified name lookup by following the chain of scopes up until found.