lib/raabro.rb in raabro-1.0.1 vs lib/raabro.rb in raabro-1.0.2
- old
+ new
@@ -24,11 +24,11 @@
#++
module Raabro
- VERSION = '1.0.1'
+ VERSION = '1.0.2'
class Input
attr_accessor :string, :offset
attr_reader :options
@@ -408,15 +408,15 @@
_parse(root, Raabro::Input.new(input, opts))
else
all(nil, Raabro::Input.new(input, opts), root)
end
- return nil if t.result != 1
+ return nil if opts[:prune] != false && t.result != 1
t = t.children.first if t.parter == :all
- t = opts[:shrink] == false ? t : t.shrink!
+ t = (opts[:prune] == false) || (opts[:shrink] == false) ? t : t.shrink!
- return rewrite(t) if respond_to?(:rewrite)
+ return rewrite(t) if opts[:rewrite] != false && respond_to?(:rewrite)
t
end
attr_accessor :last