This is not a Value, because it requires special processing
# File lib/hocon/impl/tokens.rb, line 250 def initialize(origin, optional, expression) super(TokenType::SUBSTITUTION, origin) @optional = optional @value = expression end
# File lib/hocon/impl/tokens.rb, line 280 def ==(other) super(other) && other.value == @value end
# File lib/hocon/impl/tokens.rb, line 276 def can_equal(other) other.is_a?(Substitution) end
# File lib/hocon/impl/tokens.rb, line 284 def hash 41 * (41 + super + @value.hash) end
# File lib/hocon/impl/tokens.rb, line 256 def optional? @optional end
# File lib/hocon/impl/tokens.rb, line 268 def to_s sb = StringIO.new value.each do |t| sb << t.to_s end "'${#{sb.to_s}}'" end
# File lib/hocon/impl/tokens.rb, line 262 def token_text sub_text = "" @value.each { |t| sub_text << t.token_text } "${" + (@optional ? "?" : "") + sub_text + "}" end