rototo 0.1.0-alpha.4

Control plane for runtime configuration of your application.
Documentation
use crate::diagnostics::LintDiagnostic;

use super::super::source::SourceDocument;
use super::diagnostics::toml_span_parse_diagnostic;
use super::{ParsedToml, SyntaxIndex};

pub(super) fn parse_toml_document(
    document: &SourceDocument,
    syntax: &mut SyntaxIndex,
    diagnostics: &mut Vec<LintDiagnostic>,
) {
    match ::toml_span::parse(&document.text) {
        Ok(value) => {
            syntax
                .toml
                .insert(document.id, ParsedToml::new(document.id, value));
        }
        Err(err) => {
            diagnostics.push(toml_span_parse_diagnostic(document, &err));
        }
    }
}