lib/regexp_parser/syntax/base.rb in regexp_parser-2.2.0 vs lib/regexp_parser/syntax/base.rb in regexp_parser-2.2.1
- old
+ new
@@ -1,7 +1,5 @@
-require 'set'
-
module Regexp::Syntax
class NotImplementedError < Regexp::Syntax::SyntaxError
def initialize(syntax, type, token)
super "#{syntax.class.name} does not implement: [#{type}:#{token}]"
end
@@ -21,18 +19,18 @@
def features
@implements
end
def implementations(type)
- @implements[type] ||= Set.new
+ @implements[type] ||= []
end
def implements(type, tokens)
- implementations(type).merge(Array(tokens))
+ implementations(type).concat(Array(tokens))
end
def excludes(type, tokens)
- implementations(type).subtract(Array(tokens))
+ Array(tokens).each { |tok| implementations(type).delete(tok) }
end
def implements?(type, token)
implementations(type).include?(token)
end