jazzdotdev / jazz

The Scripting Engine that Combines Speed, Safety, and Simplicity
Apache License 2.0
146 stars 11 forks source link

scl.from_table() fails #127

Open naturallymitchell opened 5 years ago

naturallymitchell commented 5 years ago
local inspect = require ("inspect")
tbl = (inspect(torchbear.settings))
print(tbl)
ytbl = yaml.from_table(tbl)
print(ytbl)
stbl = scl.from_table(tbl)
print(stbl)

gives

{
  init = "init.lua"
}
---
"{\n  init = \"init.lua\"\n}"
2018-12-05 10:29:28 ERROR:  error converting Lua string to table
stack traceback:
    [C]: in field 'from_table'
    init.lua:6: in local 'init_f'
    [string "?"]:5: in function <[string "?"]:1>
    [C]: in function 'xpcall'
    [string "?"]:1: in main chunk
2018-12-05 10:29:28 ERROR:  No handler specified
naturallymitchell commented 5 years ago

the test worked:

local x = {
        x=0,
        y=true,
        z="a\nb",
        a=1.2,
        b={c=1},
        d={day=1,month=2,year=2018},
        e={2, 3, 4},
        }
local s = scl.from_table(x)
print(s)

gave

a=1.2
b={c=1,}
d=2018-02-01
e=[2,3,4,]
x=0
y=true
z="""a
b"""

2018-12-05 10:32:38 ERROR:  No handler specified

the only difference looks like the {} wrapper but it looks ready to use!

dariusc93 commented 5 years ago

Is it still failing for you?

naturallymitchell commented 5 years ago

everyone's updating their apps and mp is using it even more. I must've tested poorly