Since there aren't any no_std serde libraries for parsing configuration formats, I guess it's better to write our own. And to gain some experience, we'll make our own configuration file format.
// Integer type
integer = 1;
// Floating point type
float = 1.0;
// Boolean type
bool = true;
// String type, should support escape sequences
string = "text";
// Tuple type
tuple = ("text", 1);
// Array type, all fields should be of one type. Type of array is decided by first element
array = [1, 2, 3];
// Map (dictionary) type
map = !["a": 1, "b": 2];
// Object type
object = {
// Objects can have fields of any type
array = [4, 5, 6];
// Empty objects are allowed too
nested_object = {};
};
// Null type, deserializes into None in Rust.
// If a value should be serialized into Option<T> and is absent, then it is treated as null.
null = _;
// Value copy
copy = #object.array;
// Reference
ref = &object.nested_object;
Serializer and deserializer will be implemented inside CoonCTRB library.
Since there aren't any `no_std` serde libraries for parsing configuration formats, I guess it's better to write our own. And to gain some experience, we'll make our own configuration file format.
```none
// Integer type
integer = 1;
// Floating point type
float = 1.0;
// Boolean type
bool = true;
// String type, should support escape sequences
string = "text";
// Tuple type
tuple = ("text", 1);
// Array type, all fields should be of one type. Type of array is decided by first element
array = [1, 2, 3];
// Map (dictionary) type
map = !["a": 1, "b": 2];
// Object type
object = {
// Objects can have fields of any type
array = [4, 5, 6];
// Empty objects are allowed too
nested_object = {};
};
// Null type, deserializes into None in Rust.
// If a value should be serialized into Option<T> and is absent, then it is treated as null.
null = _;
// Value copy
copy = #object.array;
// Reference
ref = &object.nested_object;
```
Serializer and deserializer will be implemented inside [CoonCTRB](https://git.foxdogcoon.me/CoonOS/CoonCTRB) library.
no_std serde JSON parser is broken, and it would've been better to implement my own configuration format or use another with better parser.
Since there aren't any
no_std
serde libraries for parsing configuration formats, I guess it's better to write our own. And to gain some experience, we'll make our own configuration file format.Serializer and deserializer will be implemented inside CoonCTRB library.