Test ran at 2024-11-15 13:08:51.101694+00:00 SOLUTION: ada_toml=0.4.0: TOML parser for Ada Origin: source archive v0.4.tar.gz at https://github.com/pmderodat/ada-toml/archive/v0.4.tar.gz with hash sha512:3f3dd0de717da00a7dfd9982bb19bfb2dd372e02c23deca91329fa11fcfd077b8292e48a2fcfd23d15aef1e8ee9542cda286af1bbb2d6ac1325f7dfe91e0808c Properties: Author: AdaCore Author: Pierre-Marie de Rodat Description: TOML parser for Ada GPR Scenario: ADA_TOML_BUILD_MODE := dev | prod GPR Scenario: LIBRARY_TYPE := static | relocatable | static-pic License: BSD-3-Clause Long_Description: ada-toml: TOML parser for Ada ============================= `ada-toml` is a pure Ada library for parsing and creating [TOML](https://github.com/toml-lang/toml#toml) documents. It conforms to the [version 1.0.0](https://toml.io/en/v1.0.0) of the format standard. Quick tutorial -------------- All basic types and subprograms are in the `TOML` package. All "nodes" in a TOML documents are materialized using the `TOML.TOML_Value` type. Since TOML values make up a tree, this type has reference semantics. This means that modifying a TOML node does not modify the corresponding `TOML_Value` value itself, but rather the TOML value that is referenced. Parsing a TOML file is as easy as using the `TOML.File_IO.Load_File` function: ```ada declare Result : constant TOML.Read_Result := TOML.File_IO.Load_File ("config.toml"); begin if Result.Success then Ada.Text_IO.Put_Line ("config.toml loaded with success!"); else Ada.Text_IO.Put_Line ("error while loading config.toml:"); Ada.Text_IO.Put_Line (Ada.Strings.Unbounded.To_String (Result.Message)); end if; end; ``` Each TOML value has kind, defining which data it contains (a boolean, an integer, a string, a table, ...). To each kind, one or several primitives are associated to let one process the underlying data: ```ada case Result.Kind is when TOML.TOML_Boolean => Ada.Text_IO.Put_Line ("Boolean: " & Result.As_Boolean'Image); when TOML.TOML_Integer => Ada.Text_IO.Put_Line ("Boolean: " & Result.As_Integer'Image); when TOML.TOML_String => Ada.Text_IO.Put_Line ("Boolean: " & Result.As_String); when TOML.TOML_Array => Ada.Text_IO.Put_Line ("Array of " & Result.Length & " elements"); when others => null; end case; ``` There are also primitives to build TOML values: ```ada declare Bool : constant TOML.TOML_Value := TOML.Create_Boolean (False); Int : constant TOML.TOML_Value := TOML.Create_Integer (10); Str : constant TOML.TOML_Value := TOML.Create_String ("Hello, world"); Table : constant TOML.TOML_Value := TOML.Create_Table; begin Table.Set ("bool_field", Bool); Table.Set ("int_field", Int); Table.Set ("str_field", Str); end; ``` And finally one can turn a tree of TOML nodes back in text form: ```ada Ada.Text_IO.Put_Line ("TOML document:"); Ada.Text_IO.Put_Line (Table.Dump_As_String); ``` Contributing ------------ The development of `ada-toml` happens on [GitHub](https://github.com/pmderodat/ada-toml). Everyone is welcome to contribute to this project: please read our [contribution rules](https://github.com/pmderodat/ada-toml/tree/master/CONTRIBUTING.rst) if you consider doing so. Maintainer: pmderodat@kawie.fr Maintainers_Logins: pmderodat Name: ada_toml Project_File: ada_toml.gpr Version: 0.4.0 LOG: Note: Deploying ada_toml=0.4.0... #=#=# ##O#-# Note: Building ada_toml/ada_toml.gpr... Setup [mkdir] object directory for project Ada_TOML [mkdir] library directory for project Ada_TOML Compile [Ada] toml-generic_parse.adb [Ada] toml-file_io.adb [Ada] toml-generic_dump.adb [Ada] toml.adb Build Libraries [gprlib] ada_toml.lexch [archive] libada_toml.a [index] libada_toml.a Build finished successfully in 2.11 seconds. ada_toml=0.4.0 successfully retrieved and built. There are no dependencies. Found declared GPR file: ada_toml.gpr