Permalink
Browse files

Rename transform.

  • Loading branch information...
1 parent ed2b1d1 commit 8cdc053d29f93ee7a8c797e5726bf7de3f23eacc @threedaymonk threedaymonk committed Mar 20, 2012
Showing with 10 additions and 6 deletions.
  1. +1 −1 lib/sibyl/{transform.rb → sexp_transform.rb}
  2. +7 −3 parser.rb
  3. +2 −2 test/parsing_test.rb
@@ -1,7 +1,7 @@
require "parslet"
module Sibyl
- class Transform < Parslet::Transform
+ class SexpTransform < Parslet::Transform
rule(text: simple(:x)) { x.to_s }
rule(numeric: simple(:x)) { x.to_i }
rule(code: simple(:x)) { x.to_s.strip }
View
@@ -1,5 +1,9 @@
-require "sibyl"
+require "sibyl/parser"
+require "sibyl/sexp_transform"
require 'pp'
-s = File.read(ARGV.first)
-pp Sibyl.parse(s)
+source = File.read(ARGV.first)
+parser = Sibyl::Parser.new
+sexp_transform = Sibyl::SexpTransform.new
+sexp = sexp_transform.apply(parser.parse(source))
+pp sexp
@@ -1,11 +1,11 @@
require "common"
require "sibyl/parser"
-require "sibyl/transform"
+require "sibyl/sexp_transform"
describe "Parser" do
def sexp(source)
parser = Sibyl::Parser.new
- transform = Sibyl::Transform.new
+ transform = Sibyl::SexpTransform.new
transform.apply(parser.parse(source))
end

0 comments on commit 8cdc053

Please sign in to comment.