lib/sexpr/grammar.rb in sexpr-0.3.0 vs lib/sexpr/grammar.rb in sexpr-0.4.0
- old
+ new
@@ -4,23 +4,24 @@
require_relative 'grammar/tagging'
module Sexpr
module Grammar
include Options
include Matching
- include Parsing
include Tagging
+ include Parsing
- def self.new(options = {})
- unless options.is_a?(Hash)
- raise ArgumentError, "Invalid grammar definition: #{options.inspect}"
- end
+ def self.new(input = {}, options = {})
Module.new.tap{|g|
g.instance_eval{
include(Grammar)
extend(self)
- install_options(options)
+ install_options(input.merge(options))
}
}
+ end
+
+ def tagging_reference
+ self
end
end # module Grammar
end # module Sexpr
\ No newline at end of file