Skip to content

dlang-community/toml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
o3o
Jun 7, 2023
aa17362 · Jun 7, 2023

History

50 Commits
Nov 30, 2022
Nov 30, 2022
Nov 30, 2022
Jun 7, 2023
Sep 8, 2022
Aug 29, 2022
Sep 8, 2022
Feb 15, 2018
Jun 7, 2017
Dec 12, 2022
Sep 2, 2022
Jun 7, 2023
Sep 2, 2022

Repository files navigation

Logo

Implementation of Tom's Obvious, Minimal Language for D, based on TOML 0.5.0

Build Status Code Coverage DUB Package DUB Downloads

Usage

import toml;

TOMLDocument doc;

doc = parseTOML("example = 1");
assert(doc["example"].integer == 1);

doc = parseTOML(`
	bool = true
	integer = 42
	floating = 1e2
	string = "string"
`)
assert(doc["bool"] == true);
assert(doc["integer"] == 42);
assert(doc["floating"] == 1e2);
assert(doc["string"] == "string");

// from a file
import std.file : read;
doc = parseTOML(cast(string)read("/path/to/file.toml"));

Compile and test

$ dub build
$ dub test

Compile and test with reggae

Firts time:

mkdir build
cd build
reggae .. -b ninja
cd -
ninja -C build -t targets // list targets
ninja -C build -t clean // clean build files

then:

ninja -C build
ninja -C build ut
./build/ut

Conversion