class Hjson::AST::String

Constants

ESCAPEE

Private Instance Methods

read_escapee() click to toggle source
# File lib/hjson/ast/nodes/string.rb, line 44
def read_escapee
  ESCAPEE[char]
end
read_unicode() click to toggle source
# File lib/hjson/ast/nodes/string.rb, line 48
def read_unicode
  uffff = 4.times.reduce(0) do |i, _|
    read
    fail SyntaxError unless hex?
    hex = char.to_i(16)
    break if hex.infinite?
    i * 16 + hex
  end
  uffff.chr(Encoding::UTF_8)
end