diff --git a/lib/kpeg/grammar.rb b/lib/kpeg/grammar.rb index fab8ad2..9038b7a 100644 --- a/lib/kpeg/grammar.rb +++ b/lib/kpeg/grammar.rb @@ -106,20 +106,10 @@ def initialize(reg, opts=nil) if reg.kind_of? String flags = 0 - lang = nil if opts opts.split("").each do |o| case o - when "n", "N", "e", "E", "s", "S" - lang = o.downcase - when "u", "U" - if RUBY_VERSION > "1.8.7" - # Ruby 1.9 defaults to UTF-8 for string matching - lang = "" - else - lang = "u" - end when "m" flags |= Regexp::MULTILINE when "x" @@ -130,7 +120,7 @@ def initialize(reg, opts=nil) end end - @regexp = Regexp.new(reg, flags, lang) + @regexp = Regexp.new(reg, flags) else @regexp = reg end