Class: Expgen::Nodes::BracketExpression

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/expgen/nodes.rb', line 72

def chars
  case ast[:name].to_s
    when "alnum" then ALPHA + DIGIT
    when "alpha" then ALPHA
    when "blank" then " "
    when "cntrl" then CONTROL_CHARS
    when "digit" then DIGIT
    when "graph" then NON_SPACE
    when "lower" then LOWER
    when "print" then ASCII
    when "punct" then PUNCT
    when "space" then SPACE
    when "upper" then UPPER
    when "xdigit" then HEX_DIGIT
    when "word" then WORD + ["_"]
    when "ascii" then ASCII
  end
end