class RubyLsp::Scope

def add(name, type)

: ((String | Symbol) name, Symbol type) -> void
Add a new local to this scope. The types should only be `:parameter` or `:variable`
def add(name, type)
  @locals[name.to_sym] = Local.new(type)
end

def initialize(parent = nil)

: (?Scope? parent) -> void
def initialize(parent = nil)
  @parent = parent
  # A hash of name => type
  @locals = {} #: Hash[Symbol, Local]
end

def lookup(name)

: ((String | Symbol) name) -> Local?
def lookup(name)
  sym = name.to_sym
  entry = @locals[sym]
  return entry if entry
  return unless @parent
  @parent.lookup(sym)
end