Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for JSON#parse #95

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ext/json/lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class MissingUnicodeSupport < JSONError; end
module_function

# Parse the JSON document _source_ into a Ruby data structure and return it.
# It raises JSON::ParserError if it fails to parse.
#
# _opts_ can have the following
# keys:
Expand All @@ -158,6 +159,7 @@ def parse(source, opts = {})
# Parse the JSON document _source_ into a Ruby data structure and return it.
# The bang version of the parse method defaults to the more dangerous values
# for the _opts_ hash, so be sure only to parse trusted _source_ documents.
# It raises JSON::ParserError if it fails to parse.
#
# _opts_ can have the following keys:
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
Expand Down
1 change: 1 addition & 0 deletions ext/json/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,7 @@ case 9:
*
* Parses the current JSON text _source_ and returns the complete data
* structure as a result.
* It raises JSON::ParseError if fail to parse.
*/
static VALUE cParser_parse(VALUE self)
{
Expand Down
1 change: 1 addition & 0 deletions ext/json/parser/parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ static VALUE cParser_parse_quirks_mode(VALUE self)
*
* Parses the current JSON text _source_ and returns the complete data
* structure as a result.
* It raises JSON::ParseError if fail to parse.
*/
static VALUE cParser_parse(VALUE self)
{
Expand Down