skip to content
[readonly]

The key = value subset of TOML that program.toml uses: integers, strings, booleans, floats, one-line string lists

sh
$ sexc add @ajax/mesh-toml
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 02:56v/# 1 version
  • drwxr-xr-x-Oct 27 02:56files/# the files of 0.1.0
latest
0.1.0, published Oct 27 02:56 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-text ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-manifest
keywords
mesh alphaos toml manifest parser
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-toml
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-toml
2
3The value syntax of `program.toml`: integers (decimal or `0x`, `_` separators), negative integers, floats (with a `.`), `"strings"` (no escapes), `true`/`false`, one-line lists of strings, and `#` comments outside strings. Not general TOML: exactly what the Rust's hand-rolled parser accepts, with its error messages (`unterminated string`, `bad value "x"`, ...).
4
5```c
6#include "mesh/toml.h"
7mesh_toml_val v;
8char *err = NULL;
9if (!mesh_toml_value("[\"a\", \"b\"]", 10, &v, &err)) ...
10```
11
12## Ported from
13
14[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/manifest.rs (`Val`, `value`, `quoted`, `int`, `pair`, `strip_comment`).
15
16## Tests
17
18Through @ajax/mesh-manifest-encode's golden test: 5696 manifests (every `program.toml` of the Rust repo, the Rust's test cases and mutations of every key) give the Rust's verdicts byte for byte.
19
20## Licence
21
22MIT. See the repository's LICENSE.