Skip to content
New issue

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

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

Already on GitHub? # to your account

Document that Parse/ParseND is for objects/arrays #60

Merged
merged 1 commit into from
Mar 4, 2022
Merged
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
4 changes: 2 additions & 2 deletions simdjson_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func newInternalParsedJson(reuse *ParsedJson, opts []ParserOption) (*internalPar
return pj, nil
}

// Parse a block of data and return the parsed JSON.
// Parse an object or array from a block of data and return the parsed JSON.
// An optional block of previously parsed json can be supplied to reduce allocations.
func Parse(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) {
pj, err := newInternalParsedJson(reuse, opts)
Expand All @@ -75,7 +75,7 @@ func Parse(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, erro
return parsed, nil
}

// ParseND will parse newline delimited JSON.
// ParseND will parse newline delimited JSON objects or arrays.
// An optional block of previously parsed json can be supplied to reduce allocations.
func ParseND(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) {
pj, err := newInternalParsedJson(reuse, opts)
Expand Down
4 changes: 2 additions & 2 deletions simdjson_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func SupportedCPU() bool {
return false
}

// Parse a block of data and return the parsed JSON.
// Parse an object or array from a block of data and return the parsed JSON.
// An optional block of previously parsed json can be supplied to reduce allocations.
func Parse(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) {
return nil, errors.New("Unsupported platform")
}

// ParseND will parse newline delimited JSON.
// ParseND will parse newline delimited JSON objects or arrays.
// An optional block of previously parsed json can be supplied to reduce allocations.
func ParseND(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) {
return nil, errors.New("Unsupported platform")
Expand Down