Config-UCL

 view release on metacpan or  search on metacpan

libucl-0.8.1/doc/lua_api.md  view on Meta::CPAN

## Module `ucl`

This lua module allows to parse objects from strings and to store data into
ucl objects. It uses `libucl` C library to parse and manipulate with ucl objects.

Example:

~~~lua
local ucl = require("ucl")

local parser = ucl.parser()
local res,err = parser:parse_string('{key=value}')

if not res then
	print('parser error: ' .. err)
else
	local obj = parser:get_object()
	local got = ucl.to_format(obj, 'json')
end

libucl-0.8.1/lua/lua_ucl.c  view on Meta::CPAN

#include "ucl.h"
#include "ucl_internal.h"
#include "lua_ucl.h"
#include <strings.h>

/***
 * @module ucl
 * This lua module allows to parse objects from strings and to store data into
 * ucl objects. It uses `libucl` C library to parse and manipulate with ucl objects.
 * @example
local ucl = require("ucl")

local parser = ucl.parser()
local res,err = parser:parse_string('{key=value}')

if not res then
	print('parser error: ' .. err)
else
	local obj = parser:get_object()
	local got = ucl.to_format(obj, 'json')
endif

libucl-0.8.1/lua/test.lua  view on Meta::CPAN

local ucl = require("ucl")

function test_simple()
  local expect =
    '['..
    '"float",1.5,'..
    '"integer",5,'..
    '"true",true,'..
    '"false",false,'..
    '"null",null,'..
    '"string","hello",'..



( run in 0.303 second using v1.01-cache-2.11-cpan-0d8aa00de5b )