lib/hocon/impl/parser.rb
# In arrays and objects, comma can be omitted
# as long as there's at least one newline instead.
# this skips any newlines in front of a comma,
# skips the comma, and returns true if it found
# either a newline or a comma. The iterator
# is left just after the comma or the newline.
In arrays and objects, comma can be omitted
as long as there's at least one newline instead.
this skips any newlines in front of a comma,
skips the comma, and returns true if it found
either a newline or a comma. The iterator
is left just after the comma or the newline.
In arrays and objects comma can be omitted as long as there ' s at least one newline instead . this skips any newlines in front of a comma skips the comma and returns true if it found either a newline or a comma . The iterator is left just after the comma or the newline .
def check_element_separator
      if @flavor == ConfigSyntax::JSON
        t = next_token_ignoring_newline
        if (t.token == Tokens::COMMA)
          true
        else
          put_back(t)
          false
        end
      else
        saw_separator_or_newline = false
        t = next_token
        while true
          if Tokens.newline?(t.token)
            @line_number = t.token.line_number + 1
            saw_separator_or_newline = true
          elsif t.token == Tokens::COMMA
            return true
          else
            put_back(t)
            return saw_separator_or_newline
          end
          t = next_token
        end
      end
    end
def check_element_separator if @flavor == ConfigSyntax :: JSON t = next_token_ignoring_newline if ( t . token == Tokens :: COMMA ) true else put_back ( t ) false end else saw_separator_or_newline = false t = next_token while true if Tokens . newline? ( t . token ) @line_number = t . token . line_number + 1 saw_separator_or_newline = true elsif t . token == Tokens :: COMMA return true else put_back ( t ) return saw_separator_or_newline end t = next_token end end end
In arrays and objects, comma can be omitted
as long as there's at least one newline instead.
In arrays and objects comma can be omitted as long as there ' s at least one newline instead .
# newline number is the line just ended, so add one # we want to continue to also eat a comma if there is one # non-newline-or-comma