Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scl.from_table() fails #127

Open
naturallymitchell opened this issue Dec 5, 2018 · 3 comments
Open

scl.from_table() fails #127

naturallymitchell opened this issue Dec 5, 2018 · 3 comments

Comments

@naturallymitchell
Copy link
Member

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
Copy link
Member Author

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
Copy link
Contributor

Is it still failing for you?

@naturallymitchell
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants