rename 'sloppy_existing_atom' to 'attempt_atom'

This commit is contained in:
alisdair sullivan 2013-07-05 03:11:01 +00:00
parent 5dd62e27b5
commit fe2bd15184
2 changed files with 11 additions and 10 deletions

View file

@ -467,7 +467,7 @@ decode(JSON, Opts) -> Term
JSON = json_text()
Term = json_term()
Opts = [option() | labels | {labels, Label} | {post_decode, F}]
Label = binary | atom | existing_atom | sloppy_existing_atom
Label = binary | atom | existing_atom | attempt_atom
F = fun((any()) -> any())
```
@ -477,10 +477,11 @@ term
the option `labels` controls how keys are converted from json to
erlang terms. `binary` (the default behavior) does no conversion
beyond normal escaping. `atom` converts keys to erlang atoms and
results in a badarg error if the keys fall outside the range of erlang
results in a `badarg` error if the keys fall outside the range of erlang
atoms. `existing_atom` is identical to `atom` except it will not add
new atoms to the atom table. `sloppy_existing_atom` will convert keys
to atoms when they exist, and leave them as binary otherwise
new atoms to the atom table and will result in a `badarg` error if the atom
does not exist. `attempt_atom` will convert keys to atoms when they exist,
and leave them as binary otherwise
`{post_decode, F}` is a user defined function of arity 1 that is called on each
output value (objects, arrays, strings, numbers and literals). it may return any