Sha256: 08789bb50896522af186511b9bcb828d956c5a92884a1843a5795c925ff418d8
Contents?: true
Size: 674 Bytes
Versions: 2
Compression:
Stored size: 674 Bytes
Contents
module RubyAST class SyntaxException < Exception; end module JRubyParserWrapper extend self def parse file_name, source, line_number, ruby_version version = J::CompatVersion.getVersionFromString(ruby_version) config = J::ParserConfiguration.new(line_number, version) reader = J::StringReader.new(source) J::Parser.new.parse(file_name, reader, config) rescue ::SyntaxException => e raise SyntaxException, e.message end def to_source ast, original_source writer = J::StringWriter.new visitor = J::ReWriteVisitor.new(writer, original_source) ast.accept(visitor) writer.toString end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubyast-0.0.2 | lib/rubyast/jruby_parser_wrapper.rb |
rubyast-0.0.1 | lib/rubyast/jruby_parser_wrapper.rb |