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, #max, #repeat

Constructor Details

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

Instance Method Details

#charsObject



38
39
40
41
42
43
44
45
# File 'lib/expgen/nodes.rb', line 38

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

#groupsObject



34
35
36
# File 'lib/expgen/nodes.rb', line 34

def groups
  ast[:groups]
end