1
0
Fork 0
forked from wry/wry

config: change default config to use toml-based configuration

This commit is contained in:
Julian Orth 2024-03-13 19:30:34 +01:00
parent e24a61bc62
commit 3cebf651c5
58 changed files with 14093 additions and 145 deletions

View 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),
}
}
}