FIXME the way the subclasses of Token are private with static isFoo and accessors is kind of ridiculous.
# File lib/hocon/impl/tokens.rb, line 345 def self.comment?(t) t.is_a?(Comment) end
# File lib/hocon/impl/tokens.rb, line 349 def self.comment_text(token) if comment?(token) token.text else raise ConfigBugOrBrokenError, "tried to get comment text from #{token}" end end
# File lib/hocon/impl/tokens.rb, line 337 def self.get_problem_cause(token) if token.is_a?(Problem) token.cause else raise ConfigBugOrBrokenError.new("tried to get problem cause from #{token}") end end
# File lib/hocon/impl/tokens.rb, line 321 def self.get_problem_message(token) if token.is_a?(Problem) token.message else raise ConfigBugOrBrokenError.new("tried to get problem message from #{token}") end end
# File lib/hocon/impl/tokens.rb, line 329 def self.get_problem_suggest_quotes(token) if token.is_a?(Problem) token.suggest_quotes else raise ConfigBugOrBrokenError.new("tried to get problem suggest_quotes from #{token}") end end
# File lib/hocon/impl/tokens.rb, line 313 def self.get_problem_what(token) if token.is_a?(Problem) token.what else raise ConfigBugOrBrokenError, "tried to get problem what from #{token}" end end
# File lib/hocon/impl/tokens.rb, line 385 def self.get_substitution_optional(token) if token.is_a?(Substitution) token.optional? else raise ConfigBugOrBrokenError, "tried to get substitution optionality from #{token}" end end
# File lib/hocon/impl/tokens.rb, line 377 def self.get_substitution_path_expression(token) if token.is_a?(Substitution) token.value else raise ConfigBugOrBrokenError, "tried to get substitution from #{token}" end end
# File lib/hocon/impl/tokens.rb, line 369 def self.ignored_whitespace?(token) token.is_a?(IgnoredWhitespace) end
# File lib/hocon/impl/tokens.rb, line 456 def self.new_boolean(origin, value) new_value(ConfigBoolean.new(origin, value), value.to_s) end
# File lib/hocon/impl/tokens.rb, line 412 def self.new_comment_double_slash(origin, text) Comment::DoubleSlashComment.new(origin, text) end
# File lib/hocon/impl/tokens.rb, line 416 def self.new_comment_hash(origin, text) Comment::HashComment.new(origin, text) end
# File lib/hocon/impl/tokens.rb, line 444 def self.new_double(origin, value, orig_text) new_value(ConfigNumber.new_number(origin, value, orig_text), orig_text) end
# File lib/hocon/impl/tokens.rb, line 424 def self.new_ignored_whitespace(origin, s) IgnoredWhitespace.new(origin, s) end
# File lib/hocon/impl/tokens.rb, line 440 def self.new_int(origin, value, orig_text) new_value(ConfigNumber.new_number(origin, value, orig_text), orig_text) end
# File lib/hocon/impl/tokens.rb, line 404 def self.new_line(origin) Line.new(origin) end
# File lib/hocon/impl/tokens.rb, line 448 def self.new_long(origin, value, orig_text) new_value(ConfigNumber.new_number(origin, value, orig_text), orig_text) end
# File lib/hocon/impl/tokens.rb, line 452 def self.new_null(origin) new_value(ConfigNull.new(origin), "null") end
# File lib/hocon/impl/tokens.rb, line 408 def self.new_problem(origin, what, message, suggest_quotes, cause) Problem.new(origin, what, message, suggest_quotes, cause) end
# File lib/hocon/impl/tokens.rb, line 436 def self.new_string(origin, value, orig_text) new_value(ConfigString::Quoted.new(origin, value), orig_text) end
# File lib/hocon/impl/tokens.rb, line 428 def self.new_substitution(origin, optional, expression) Substitution.new(origin, optional, expression) end
# File lib/hocon/impl/tokens.rb, line 420 def self.new_unquoted_text(origin, s) UnquotedText.new(origin, s) end
# File lib/hocon/impl/tokens.rb, line 432 def self.new_value(value, orig_text = nil) Value.new(value, orig_text) end
# File lib/hocon/impl/tokens.rb, line 305 def self.newline?(t) t.is_a?(Line) end
# File lib/hocon/impl/tokens.rb, line 309 def self.problem?(t) t.is_a?(Problem) end
# File lib/hocon/impl/tokens.rb, line 373 def self.substitution?(token) token.is_a?(Substitution) end
# File lib/hocon/impl/tokens.rb, line 361 def self.unquoted_text(token) if unquoted_text?(token) token.value else raise ConfigBugOrBrokenError, "tried to get unquoted text from #{token}" end end
# File lib/hocon/impl/tokens.rb, line 357 def self.unquoted_text?(token) token.is_a?(UnquotedText) end
# File lib/hocon/impl/tokens.rb, line 293 def self.value(token) if token.is_a?(Value) token.value else raise ConfigBugOrBrokenError, "tried to get value of non-value token #{token}" end end
# File lib/hocon/impl/tokens.rb, line 289 def self.value?(token) token.is_a?(Value) end
# File lib/hocon/impl/tokens.rb, line 301 def self.value_with_type?(t, value_type) value?(t) && (value(t).value_type == value_type) end