lib/hocon/impl/parser.rb
# merge a bunch of adjacent values into one
# value; change unquoted text into a string
# value.
merge a bunch of adjacent values into one
value; change unquoted text into a string
value.
merge a bunch of adjacent values into one value ; change unquoted text into a string value .
def consolidate_value_tokens
      return if @flavor == ConfigSyntax::JSON
      values = nil
      t = next_token_ignoring_newline
      while true
        v = nil
        if (Tokens.value?(t.token)) || (Tokens.unquoted_text?(t.token)) ||
            (Tokens.substitution?(t.token)) || (t.token == Tokens::OPEN_CURLY) ||
            (t.token == Tokens::OPEN_SQUARE)
          v = parse_value(t)
        else
          break
        end
        if v.nil?
          raise ConfigBugError("no value")
        end
        if values.nil?
          values = []
        end
        values.push(v)
        t = next_token 
      end
      put_back(t)
      return if values.nil?
      consolidated = ConfigConcatenation.concatenate(values)
      put_back(TokenWithComments.new(Tokens.new_value(consolidated)))
    end
def consolidate_value_tokens return if @flavor == ConfigSyntax :: JSON values = nil t = next_token_ignoring_newline while true v = nil if ( Tokens . value? ( t . token ) ) || ( Tokens . unquoted_text? ( t . token ) ) || ( Tokens . substitution? ( t . token ) ) || ( t . token == Tokens :: OPEN_CURLY ) || ( t . token == Tokens :: OPEN_SQUARE ) v = parse_value ( t ) else break end if v . nil? raise ConfigBugError ( "no value" ) end if values . nil? values = [ ] end values . push ( v ) t = next_token end put_back ( t ) return if values . nil? consolidated = ConfigConcatenation . concatenate ( values ) put_back ( TokenWithComments . new ( Tokens . new_value ( consolidated ) ) ) end
merge a bunch of adjacent values into one
value; change unquoted text into a string
value.
merge a bunch of adjacent values into one value ; change unquoted text into a string value .
# this trick is not done in JSON # create only if we have value tokens # ignore a newline up front # there may be newlines _within_ the objects and arrays # but don't consolidate across a newline # the last one wasn't a value token