class JSON::TruffleRuby::Generator::State

def check_max_nesting # :nodoc:

:nodoc:
def check_max_nesting # :nodoc:
  return if @max_nesting.zero?
  current_nesting = depth + 1
  current_nesting > @max_nesting and
    raise NestingError, "nesting of #{current_nesting} is too deep"
end