          # File lib/rake.rb, line 1843
    1843:     def lookup(task_name, initial_scope=nil)
    1844:       initial_scope ||= @scope
    1845:       task_name = task_name.to_s
    1846:       if task_name =~ /^rake:/
    1847:         scopes = []
    1848:         task_name = task_name.sub(/^rake:/, '')
    1849:       elsif task_name =~ /^(\^+)/
    1850:         scopes = initial_scope[0, initial_scope.size - $1.size]
    1851:         task_name = task_name.sub(/^(\^+)/, '')
    1852:       else
    1853:         scopes = initial_scope
    1854:       end
    1855:       lookup_in_scope(task_name, scopes)
    1856:     end