Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v2 0/2] decimal: expose decimal module to Lua.
@ 2019-06-28 14:36 Serge Petrenko
  2019-06-28 14:36 ` [PATCH v2 1/2] lua/utils: add a function to register FFI metatypes Serge Petrenko
  2019-06-28 14:36 ` [PATCH v2 2/2] decimal: expose decimal type to lua Serge Petrenko
  0 siblings, 2 replies; 4+ messages in thread
From: Serge Petrenko @ 2019-06-28 14:36 UTC (permalink / raw)
  To: vdavydov.dev; +Cc: tarantool-patches, Serge Petrenko

https://github.com/tarantool/tarantool/issues/692
https://github.com/tarantool/tarantool/tree/sp/gh-692-decimal-lua

This patchset adds decimal module to lua.

Since FFI CDATA is chosen to store decimals on lua stack, a new helper to
register FFI metatypes is added in the first patch.

The second patch does the job itself of exposing the decimal module to lua and
adds a minor test. The patch also contains a documentation request in the commit
message.

Changes in v2:
  - various review fixes requested by @vdavydov
    - clarify commit message and docbot request.
    - remove decimal.add and similar. Only leave
      the '+', ... operators for binary operations.
    - add more tests.
    - minor code cleanup.

Serge Petrenko (2):
  lua/utils: add a function to register FFI metatypes.
  decimal: expose decimal type to lua.

 src/CMakeLists.txt        |   1 +
 src/lua/decimal.c         | 351 ++++++++++++++++++++++++++++++++++
 src/lua/decimal.h         |  47 +++++
 src/lua/init.c            |   2 +
 src/lua/utils.c           |  28 +++
 src/lua/utils.h           |  13 ++
 test/app/decimal.result   | 382 ++++++++++++++++++++++++++++++++++++++
 test/app/decimal.test.lua | 110 +++++++++++
 8 files changed, 934 insertions(+)
 create mode 100644 src/lua/decimal.c
 create mode 100644 src/lua/decimal.h
 create mode 100644 test/app/decimal.result
 create mode 100644 test/app/decimal.test.lua

-- 
2.20.1 (Apple Git-117)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-28 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 14:36 [PATCH v2 0/2] decimal: expose decimal module to Lua Serge Petrenko
2019-06-28 14:36 ` [PATCH v2 1/2] lua/utils: add a function to register FFI metatypes Serge Petrenko
2019-06-28 14:36 ` [PATCH v2 2/2] decimal: expose decimal type to lua Serge Petrenko
2019-06-28 15:32   ` Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox