diff --git a/README.md b/README.md index e31b6a8..0273e3e 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -## Crystal Reader* +## Sapphire Reader* -The parser part of crystal is now a standalone gem. It parses ruby using Parslet and no other dependencies. +The parser part of sapphire is now a standalone gem. It parses ruby using Parslet and no other dependencies. -This is interesing if you want to generate executable code, like crystal, but also for other things, like code analysis. +This is interesing if you want to generate executable code, like sapphire, but also for other things, like code analysis. Also it is very educational, as it is very readable code, and not too much of it. * -It looks into it's crystal ball and all it sees is red. A red crystal . . . ruby, yes. +It looks into it's sapphire ball and all it sees is red. A red sapphire . . . ruby, yes. ### Parser -The main parser per se is in parser/crystal , but it just pulls in all the parts. +The main parser per se is in parser/sapphire , but it just pulls in all the parts. All the other files are ruby modules representing aspects of the parser. Most names are quite self explanitory, but here is a list: @@ -32,7 +32,7 @@ All the other files are ruby modules representing aspects of the parser. Most n The Abtract Syntax Tree (ast) layer puts the parsed code into objects, so they are nice and easy to work with. -The Classes don't really define any functionality, that is done in Crystal, or can be done in any code using this. Crystal just adds a compile function to each class, but a visitor pattern would do just as well. +The Classes don't really define any functionality, that is done in Sapphire, or can be done in any code using this. Sapphire just adds a compile function to each class, but a visitor pattern would do just as well. The functionality that is in there is mainly to do with testing. Equality is defined, but also **inspect** in such a way that it's output (which you get from a failing test) can be pasted straight into the test case as the expected result. diff --git a/Rakefile b/Rakefile index 66e50ca..d8cc9fa 100644 --- a/Rakefile +++ b/Rakefile @@ -14,11 +14,11 @@ require 'rake' require 'jeweler' Jeweler::Tasks.new do |gem| # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options - gem.name = "crystal-reader" - gem.homepage = "http://github.com/crystal-vm/crystal-reader" + gem.name = "sapphire-reader" + gem.homepage = "http://github.com/sapphire-vm/sapphire-reader" gem.license = "GPL3" gem.summary = %Q{Parse ruby in ruby using parslet.} - gem.description = %Q{Crystal reader is part of the crystal vm. The reader reads (parses) ruby and + gem.description = %Q{Sapphire reader is part of the sapphire vm. The reader reads (parses) ruby and creates an ast from it. There are no other dependencies than parslet, which itself has hardly any. The gem may be useful for code analysis tools or for education. Two ways to use it include adding functions to each of the AST classes, or using a visitor patter.} @@ -48,7 +48,7 @@ Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" rdoc.rdoc_dir = 'rdoc' - rdoc.title = "crystal-reader #{version}" + rdoc.title = "sapphire-reader #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end diff --git a/lib/parser.rb b/lib/parser.rb index 1b47efd..4a74012 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -1,3 +1,3 @@ require 'parslet' -require 'parser/crystal' +require 'parser/sapphire' require 'parser/transform' diff --git a/lib/parser/crystal.rb b/lib/parser/sapphire.rb similarity index 97% rename from lib/parser/crystal.rb rename to lib/parser/sapphire.rb index f63010f..8040184 100644 --- a/lib/parser/crystal.rb +++ b/lib/parser/sapphire.rb @@ -19,7 +19,7 @@ module Parser # a maybe removes the 0 a sequence (array) to a single (hash). Thus 2 transformations are needed # More work than the prettiness is worth, so only use .maybe on something that does not need capturing - class Crystal < Parslet::Parser + class Sapphire < Parslet::Parser include BasicTypes include CompoundTypes include Tokens diff --git a/test/parser_helper.rb b/test/parser_helper.rb index 9b5f945..1a7bd50 100644 --- a/test/parser_helper.rb +++ b/test/parser_helper.rb @@ -17,7 +17,7 @@ module ParserHelper module InstanceMethods def setup - @parser = Parser::Crystal.new + @parser = Parser::Sapphire.new @transform = Parser::Transform.new end