Class: Expgen::Nodes::CharacterClass

Inherits:
Character show all
Defined in:
lib/expgen/nodes.rb

Instance Attribute Summary

Attributes inherited from Node

#ast

Instance Method Summary collapse

Methods inherited from Node

#initialize, #repeat

Constructor Details

This class inherits a constructor from Expgen::Nodes::Node

Instance Method Details

#charsObject



34
35
36
37
38
39
40
41
# File 'lib/expgen/nodes.rb', line 34

def chars
  chars = groups.map(&:chars).flatten
  val = if ast[:negative]
    ASCII - chars
  else
    chars
  end
end

#groupsObject



30
31
32
# File 'lib/expgen/nodes.rb', line 30

def groups
  ast[:groups]
end