Permalink
Browse files

Make it work with latest RBX

  • Loading branch information...
1 parent f4cb391 commit 5ebb1714087f346ddfc6528da12b82def85dbeac @txus committed Feb 11, 2014
View
@@ -1,3 +1,2 @@
-# https://github.com/travis-ci/travis-ci/wiki/.travis.yml-options
rvm:
- - rbx-19mode
+ - rbx
View
@@ -9,9 +9,9 @@ Gem::Specification.new do |s|
s.authors = ["Josep M. Bach"]
s.email = ["josep.m.bach@gmail.com"]
s.homepage = "https://github.com/txus/lambra"
- s.summary = %q{An exploratory implementation of Clojure on the Rubinius VM}
+ s.summary = %q{An exploratory implementation of a functional, distributed Lisp on the Rubinius VM}
s.description =<<-EOD
-Lambra is an experiment to implement Clojure (http://clojure.org) on the
+Lambra is an experiment to implement a functional, distributed Lisp on the
Rubinius VM (http://rubini.us).
EOD
View
@@ -1,3 +1,5 @@
+RBX = Rubinius::ToolSet.current::TS
+
require 'lambra/version'
require 'lambra/syntax'
require 'lambra/parser'
@@ -7,7 +7,7 @@ class BytecodeCompiler
PRIMITIVE_FORMS = %w(println + - / *)
def initialize(generator=nil)
- @generator = generator || Rubinius::Generator.new
+ @generator = generator || RBX::Generator.new
end
def compile(ast, debugging=false)
@@ -25,7 +25,7 @@ def compile(ast, debugging=false)
line = ast.line || 1
g.set_line line
- g.push_state Rubinius::AST::ClosedScope.new(line)
+ g.push_state RBX::AST::ClosedScope.new(line)
ast.accept(self)
@@ -256,7 +256,7 @@ def debug(gen = self.g)
p '*****'
ip = 0
while instruction = gen.stream[ip]
- instruct = Rubinius::InstructionSet[instruction]
+ instruct = RBX::InstructionSet[instruction]
ip += instruct.size
puts instruct.name
end
@@ -9,7 +9,7 @@ def self.execute(ast)
visitor = BytecodeCompiler.new
gen = visitor.compile(ast)
gen.encode
- cm = gen.package Rubinius::CompiledMethod
+ cm = gen.package Rubinius::CompiledCode
require_relative '../bootstrap'
@@ -24,9 +24,9 @@ def self.execute(ast)
line, binding, instance = ast.line, env.send(:binding), env
# cm = Noscript::Compiler.compile_eval(code, binding.variables, file, line)
- cm.scope = Rubinius::StaticScope.new(GlobalScope)
+ cm.scope = Rubinius::ConstantScope.new(GlobalScope)
cm.name = :__lambra__
- script = Rubinius::CompiledMethod::Script.new(cm, file, true)
+ script = Rubinius::CompiledCode::Script.new(cm, file, true)
be = Rubinius::BlockEnvironment.new
cm.scope.script = script
@@ -4,7 +4,7 @@ module Scope
attr_accessor :parent
def self.included(base)
- base.send :include, Rubinius::Compiler::LocalVariables
+ base.send :include, RBX::Compiler::LocalVariables
end
def nest_scope(scope)
@@ -33,7 +33,7 @@ def block_local?(name)
end
def new_local(name)
- variable = Rubinius::Compiler::LocalVariable.new allocate_slot
+ variable = RBX::Compiler::LocalVariable.new allocate_slot
variables[name] = variable
end
@@ -73,7 +73,7 @@ def compile(*plugins, &block)
ruby = @ruby
it "is compiled from #{format ruby}" do
- generator = Rubinius::Generator.new
+ generator = RBX::Generator.new
generator.instance_eval(&block)
ruby.should compile_as(generator, *plugins)

0 comments on commit 5ebb171

Please sign in to comment.