jsonbuilder 0.1.0

A json builder used to create JSON structures using a simple DSL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{context::Context, error::*, parser::Block};
use serde_json::{Map, Value};

pub mod block;
pub mod error;
pub mod expression;
pub mod statement;

pub fn build(ast: Block, context: Context) -> Result<Value> {
    let mut value = Value::Object(Map::new());

    block::run(ast, &context, &mut value)?;

    Ok(value)
}