Permalink
Browse files

Add a validator utility.

  • Loading branch information...
1 parent b78d8b5 commit e3a251dfa52db3c393abf615e6f66734f51eaac5 @threedaymonk threedaymonk committed Mar 23, 2012
Showing with 10 additions and 9 deletions.
  1. +10 −0 lib/validate.rb
  2. +0 −9 parser.rb
View
@@ -0,0 +1,10 @@
+require "sibyl/graph"
+
+source = File.read(ARGV.first)
+graph = Sibyl::Graph.new(source)
+begin
+ graph.validate!
+rescue Sibyl::RuleError => e
+ $stderr.puts e
+ exit 1
+end
View
@@ -1,9 +0,0 @@
-require "sibyl/parser"
-require "sibyl/sexp_transform"
-require 'pp'
-
-source = File.read(ARGV.first)
-parser = Sibyl::Parser.new
-sexp_transform = Sibyl::SexpTransform.new
-sexp = sexp_transform.apply(parser.parse(source))
-pp sexp

0 comments on commit e3a251d

Please sign in to comment.