dex.cf

CF - Configuration File Format

This module provides a parser, document model, and writer for the CF (Configuration File) format as specified in CF-SPEC.md v1.0.

The implementation provides a document model (CST) — a CF-specific tree (CfNode / CfDocument) that preserves all metadata: comments, source locations, original formatting (quote style, separator choice, whitespace, indentation). This enables roundtrip-preserving read-modify-write workflows.

Example:

import dex.cf;

// Document API - for roundtrip editing
auto doc = parseCFDocument(`name = "example"`);
assert(doc.root.members[0].key == "name");

// Write back to CF format
string output = toCF(doc);

Functions 6

fnCfParserConfig makeEnvConfig() @trustedCreates a CfParserConfig with system environment variable support.
fnCfDocument parseCFDocument(string source, string filename = "", CfParserConfig config = CfParserConfig.init) @safeParses a CF source string into a `CfDocument`.
fnCfDocument parseCFDocumentFile(string path, CfParserConfig config = CfParserConfig.init)Parses a CF file into a `CfDocument`.
fnCfDocument parseCFDocumentWithEnv(string source, string filename = "") @trustedParses a CF source string with environment variable substitution.
fnCfDocument parseCFDocumentFileWithEnv(string path) @trustedParses a CF file with environment variable substitution.
fnCfDocument parseCFDocumentWithIncludes(string source, string filename, string delegate(string path) @safe fileReader) @safeParses a CF source string with include support.