Method: JSON5::Parser#comment

Defined in:
lib/json5/parser.rb

#commentObject



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/json5/parser.rb', line 247

def comment
  # Skip a comment, whether inline or block-level, assuming this is one.
  # Comments always begin with a / @character.

  if (@ch != '/')
    error("Not a comment")
  end

  get_next('/')

  if (@ch == '/')
    inlineComment
  elsif (@ch == '*')
    blockComment
  else
    error("Unrecognized comment")
  end
end