Class: Regexp::Syntax::Any

Inherits:
Base
  • Object
show all
Defined in:
lib/regexp_parser/syntax/any.rb

Overview

A syntax that always returns true, passing all tokens as implemented. This is useful during development, testing, and should be useful for some types of transformations as well.

Constant Summary

Constants included from Token

Token::All, Token::Map, Token::Types

Instance Method Summary collapse

Methods inherited from Base

#excludes, #features, #implementations, #implements, inspect, #normalize, #normalize_backref, #normalize_group

Constructor Details

#initializeAny

Returns a new instance of Any.



7
8
9
# File 'lib/regexp_parser/syntax/any.rb', line 7

def initialize
  @implements = { :* => [:*] }
end

Instance Method Details

#implements!(_type, _token) ⇒ Object



12
# File 'lib/regexp_parser/syntax/any.rb', line 12

def implements!(_type, _token) true end

#implements?(_type, _token) ⇒ Boolean

Returns:

  • (Boolean)


11
# File 'lib/regexp_parser/syntax/any.rb', line 11

def implements?(_type, _token) true end