config: change default config to use toml-based configuration
This commit is contained in:
parent
e24a61bc62
commit
3cebf651c5
58 changed files with 14093 additions and 145 deletions
17
toml-config/src/config/value.rs
Normal file
17
toml-config/src/config/value.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use crate::{
|
||||
config::parser::{ParseResult, Parser},
|
||||
toml::{toml_span::Span, toml_value::Value},
|
||||
};
|
||||
|
||||
impl Value {
|
||||
pub fn parse<P: Parser>(&self, span: Span, parser: &mut P) -> ParseResult<P> {
|
||||
match self {
|
||||
Value::String(a) => parser.parse_string(span, a),
|
||||
Value::Integer(a) => parser.parse_integer(span, *a),
|
||||
Value::Float(a) => parser.parse_float(span, *a),
|
||||
Value::Boolean(a) => parser.parse_bool(span, *a),
|
||||
Value::Array(a) => parser.parse_array(span, a),
|
||||
Value::Table(a) => parser.parse_table(span, a),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue