~tim/scheme-vm

0e21d1dbe5a77665859416866bf8bc6ab0f9e7a9 — Tim Morgan 2 years ago b4dade1
Eliminate some variables we aren't using
1 files changed, 5 insertions(+), 8 deletions(-)

M compiler.rb
M compiler.rb => compiler.rb +5 -8
@@ 14,24 14,21 @@ class Compiler
  include Compiler::Lib::Scheme::ProcessContext
  include Compiler::Lib::Scheme::Write

  def initialize(ast = nil, filename:, arguments: {}, program:)
    @program = program
    @variables = {}
  def initialize(ast = nil, filename:, program:)
    @ast = ast
    @filename = filename
    @arguments = arguments
    @program = program
    @syntax = {}              # macro transformers
    @locals = {}              # top-level locals (globals)
    @libs = {}                # loaded libraries
    @mangled_identifiers = {} # used for macro hygiene
    @sexps = []
    @sexps += ast if ast
  end

  attr_reader :variables, :arguments, :syntax, :libs
  attr_reader :syntax, :libs
  attr_accessor :filename

  def compile
    compile_sexps(@sexps, options: { syntax: @syntax, locals: @locals }) + [VM::HALT]
    compile_sexps(@ast, options: { syntax: @syntax, locals: @locals }) + [VM::HALT]
  end

  def mangle_identifier(name)