update parser to use 2.6

was choking on &. syntax
improved error reporting slightly
This commit is contained in:
Torsten Ruger 2019-03-04 19:00:47 +02:00
parent fb89c01681
commit 8d4eab72bf
4 changed files with 16 additions and 7 deletions

View File

@ -8,7 +8,7 @@ PATH
remote: .
specs:
rubyx (0.6.0)
parser (~> 2.4.0)
parser (~> 2.6.0)
rx-file (~> 0.3)
GEM
@ -60,8 +60,8 @@ GEM
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
parser (2.4.0.2)
ast (~> 2.3)
parser (2.6.0.0)
ast (~> 2.4.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)

View File

@ -1,4 +1,4 @@
require "parser/ruby22"
require "parser/current"
require "ast"
AST::Node.class_eval do

View File

@ -29,8 +29,17 @@ module Ruby
include AST::Sexp
def self.compile(input)
ast = Parser::Ruby22.parse( input )
self.new.process(ast)
begin
ast = Parser::CurrentRuby.parse( input )
rescue => e
puts "Error parsing #{input}"
end
begin
self.new.process(ast)
rescue => e
puts "Error processing #{ast}"
raise e
end
end
# raise a ProcessError. This means ruby-x doesn't know how to handle it.

View File

@ -13,6 +13,6 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.summary = 'RubyX is a native object vm without any c, one day possibly a ruby vm'
s.add_dependency "parser" , "~> 2.4.0"
s.add_dependency "parser" , "~> 2.6.0"
s.add_dependency "rx-file" , "~> 0.3"
end