From 612fd986ab1e00b6d34dc1937136250e08e89325 Mon Sep 17 00:00:00 2001 From: "J.J" Date: Thu, 30 May 2024 21:50:02 -0400 Subject: cleanup --- aoc2023/build/packages/tom/README.md | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 aoc2023/build/packages/tom/README.md (limited to 'aoc2023/build/packages/tom/README.md') diff --git a/aoc2023/build/packages/tom/README.md b/aoc2023/build/packages/tom/README.md new file mode 100644 index 0000000..e6adcbe --- /dev/null +++ b/aoc2023/build/packages/tom/README.md @@ -0,0 +1,47 @@ +# tom + +A Gleam TOML parser! + +[![Package Version](https://img.shields.io/hexpm/v/tom)](https://hex.pm/packages/tom) +[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/tom/) + + +```sh +gleam add tom +``` +```gleam +import tom + +const config = " + [person] + name = \"Lucy\" + is_cool = true +" + +pub fn main() { + // Parse a string of TOML + let assert Ok(parsed) = tom.parse(config) + + // Now you can work with the data directly, or you can use the `get_*` + // functions to retrieve values. + + tom.get_string(parsed, ["person", "name"]) + // -> Ok("Lucy") + + let is_cool = tom.get_bool(parsed, ["person", "is_cool"]) + // -> Ok(True) +} +``` + +Further documentation can be found at . + +## Status + +The following string escape sequences are not supported yet: + +- `\b` +- `\f` +- `\e` +- `\xHH` +- `\uHHHH` +- `\UHHHHHHHH` -- cgit v1.2.3