Class: Ruby::Rego::Builtins::Regex::GlobIntersection::Token
- Inherits:
-
Object
- Object
- Ruby::Rego::Builtins::Regex::GlobIntersection::Token
- Defined in:
- lib/ruby/rego/builtins/regex/glob_intersection.rb
Overview
A glob atom plus its flag. type ∈ :char/:dot/:set; flag ∈ :none/:plus/:star. rune is set for :char, runes for :set.
Instance Attribute Summary collapse
-
#flag ⇒ Object
Returns the value of attribute flag.
-
#rune ⇒ Object
Returns the value of attribute rune.
-
#runes ⇒ Object
Returns the value of attribute runes.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#flagged? ⇒ Boolean
-
#initialize(type, rune, runes, flag) ⇒ Token
constructor
A new instance of Token.
-
#same_atom?(other) ⇒ Boolean
Same atom ignoring flag (used by Simplify).
Constructor Details
#initialize(type, rune, runes, flag) ⇒ Token
Returns a new instance of Token.
77 78 79 80 81 82 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 77 def initialize(type, rune, runes, flag) @type = type @rune = rune @runes = runes @flag = flag end |
Instance Attribute Details
#flag ⇒ Object
Returns the value of attribute flag.
75 76 77 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 75 def flag @flag end |
#rune ⇒ Object
Returns the value of attribute rune.
75 76 77 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 75 def rune @rune end |
#runes ⇒ Object
Returns the value of attribute runes.
75 76 77 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 75 def runes @runes end |
#type ⇒ Object
Returns the value of attribute type.
75 76 77 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 75 def type @type end |
Instance Method Details
#flagged? ⇒ Boolean
84 85 86 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 84 def flagged? flag != :none end |
#same_atom?(other) ⇒ Boolean
Same atom ignoring flag (used by Simplify).
89 90 91 |
# File 'lib/ruby/rego/builtins/regex/glob_intersection.rb', line 89 def same_atom?(other) type == other.type && rune == other.rune && runes == other.runes end |