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
use super::{statement, Block, Rule};
use crate::error::*;
use pest::iterators::Pairs;

pub fn parse(pairs: Pairs<Rule>) -> Result<Block> {
    let mut statements = Vec::new();

    for pair in pairs {
        statements.push(statement::parse(pair)?);
    }

    Ok(Block(statements))
}