|
1 | 1 | hslua-aeson
|
2 | 2 | ===========
|
3 | 3 |
|
4 |
| -[![travis build status]](https://travis-ci.org/hslua/hslua-aeson) |
5 | 4 | [![MIT License]](./LICENSE)
|
6 | 5 |
|
| 6 | +Pushes and retrieves aeson `Value`s to and from the Lua stack. |
7 | 7 |
|
8 |
| -Glue to hslua for aeson values. |
| 8 | +- `Null` values are encoded as a special value (stored in the |
| 9 | + registry field `HSLUA_AESON_NULL`). |
9 | 10 |
|
10 |
| -This provides a `StackValue` instance for aeson's `Value` type. The following |
11 |
| -conventions are used: |
| 11 | +- Objects are converted to string-indexed tables. |
12 | 12 |
|
13 |
| -- `Null` values are encoded as a special value (stored in the registry field |
14 |
| - `HSLUA_AESON_NULL`). Using `nil` would cause problems with null-containing |
15 |
| - arrays. |
| 13 | +- Arrays are converted to sequence tables. Array-length is |
| 14 | + included as the value at index 0. This makes it possible to |
| 15 | + distinguish between empty arrays and empty objects. |
16 | 16 |
|
17 |
| -- Objects are converted to tables in a straight-forward way. |
18 |
| - |
19 |
| -- Arrays are converted to Lua tables. Array-length is included as the value at |
20 |
| - index 0. This makes it possible to distinguish between empty arrays and empty |
21 |
| - objects. |
22 |
| - |
23 |
| -- JSON numbers are converted to Lua numbers (usually doubles), which can cause |
24 |
| - a loss of precision. |
| 17 | +- JSON numbers are converted to Lua numbers (usually doubles). |
25 | 18 |
|
26 | 19 | License
|
27 | 20 | -------
|
28 | 21 |
|
29 |
| -This project is licensed under the liberal MIT license, the same license under |
30 |
| -which hslua and lua itself are published. See the [LICENSE](./LICENSE) file for |
31 |
| -details. |
| 22 | +This project is licensed under the MIT license, the same license |
| 23 | +under which hslua and lua itself are published. See the |
| 24 | +[LICENSE](./LICENSE) file for details. |
32 | 25 |
|
33 |
| -[travis build status]: https://img.shields.io/travis/hslua/hslua-aeson/master.svg?style=flat-square |
34 | 26 | [MIT License]: https://img.shields.io/github/license/hslua/hslua-aeson.svg?style=flat-square
|
0 commit comments