loadVariable :: Throws (Located GeneratorError) e => Id -> SymbolTable -> GenerateJvm e ()
loadVariable name table = do
  symbol <- getSymbol name table
  case symbolConstValue symbol of
    Just const -> pushConst const
    Nothing -> if symbolContext symbol == Outside
                 then loadGlobal name (getJvmType $ symbolType symbol)
                 else loadLocal (symbolIndex symbol) (getJvmType $ symbolType symbol)
loadVariable :: Throws (Located GeneratorError) e => Id -> SymbolTable -> GenerateJvm e ()
loadVariable name table = do
  symbol <- getSymbol name table
  case symbolConstValue symbol of
    Just const -> pushConst const
    Nothing -> if symbolContext symbol == Outside
                 then loadGlobal name (getJvmType $ symbolType symbol)
                 else loadLocal (symbolIndex symbol) (getJvmType $ symbolType symbol)
loadVariable name table = do
  symbol <- getSymbol name table
  case symbolConstValue symbol of
    Just const -> pushConst const
    Nothing -> if symbolContext symbol == Outside
                 then loadGlobal name (getJvmType $ symbolType symbol)
                 else loadLocal (symbolIndex symbol) (getJvmType $ symbolType symbol)