Skip to content

Commit

Permalink
unexport
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Mar 13, 2024
1 parent 42491f9 commit 92f63e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ast/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,11 @@ func skipArray(src string, pos int) (ret int, start int) {
}
}

// DecoderString decodes a JSON string from pos and return golang string.
// DecodeString decodes a JSON string from pos and return golang string.
// - needEsc indicates if to unescaped escaping chars
// - hasEsc tells if the returned string has escaping chars
// - validStr enables validating UTF8 charset
//
func _DecodeString(src string, pos int, needEsc bool, validStr bool) (v string, ret int, hasEsc bool) {
p := NewParserObj(src)
p.p = pos
Expand Down
8 changes: 5 additions & 3 deletions ast/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (self *Searcher) getByPath(copystring bool, validate bool, path ...interfac
return newRawNode(raw, t), nil
}

// EXPORT
// GetByPath searches a path and returns relaction and types of target
func _GetByPath(src string, path ...interface{}) (start int, end int, typ int, err error) {
p := NewParserObj(src)
s, e := p.getByPath(false, path...)
Expand All @@ -104,7 +104,8 @@ func _GetByPath(src string, path ...interface{}) (start int, end int, typ int, e
return s, p.p, int(t), nil
}

// EXPORT
// ValidSyntax check if a json has a valid JSON syntax,
// while not validate UTF-8 charset
func _ValidSyntax(json string) bool {
p := NewParserObj(json)
_, e := p.skip()
Expand All @@ -117,7 +118,8 @@ func _ValidSyntax(json string) bool {
return true
}

// EXPORT
// SkipFast skip a json value in fast-skip algs,
// while not strictly validate JSON syntax and UTF-8 charset.
func _SkipFast(src string, i int) (int, int, error) {
p := NewParserObj(src)
p.p = i
Expand Down
3 changes: 2 additions & 1 deletion unquote/unquote.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func IntoBytes(s string, m *[]byte) types.ParsingError {
}
}

// EXPORT
// String unescapes a escaped string (not including `"` at begining and end)
// - replace enables replacing invalid utf8 escaped char with `\uffd`
func _String(s string, replace bool) (ret string, err error) {
mm := make([]byte, 0, len(s))
err = intoBytesUnsafe(s, &mm, replace)
Expand Down

0 comments on commit 92f63e6

Please sign in to comment.