Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tserialize.lua: fix inf,-inf,nan serialization

  • Loading branch information...
commit a855f809f457f2fe01a29bdfbde98fe65707acc9 1 parent 6047cdf
@altexy altexy authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lua-nucleo/tserialize.lua
View
5 lua-nucleo/tserialize.lua
@@ -20,6 +20,7 @@ do
local string_format, string_match = string.format, string.match
local lua51_keywords = import 'lua-nucleo/language.lua' { 'lua51_keywords' }
+ local serialize_number = import 'lua-nucleo/string.lua' { 'serialize_number' }
local cur_buf
local cat = function(v)
@@ -144,7 +145,7 @@ do
elseif t_type == "string" then
cat(string_format("%q", t))
elseif t_type == "number" then
- cat(string_format("%.55g",t))
+ cat(serialize_number(t))
elseif t_type == "boolean" then
cat(tostring(t))
elseif t == nil then
@@ -207,7 +208,7 @@ do
elseif t_type == "string" then
cat(string_format("%q", t))
elseif t_type == "number" then
- cat(string_format("%.55g",t))
+ cat(serialize_number(t))
elseif t_type == "boolean" then
cat(tostring(t))
elseif t == nil then
Please sign in to comment.
Something went wrong with that request. Please try again.